Skip to content

Commit eeabf7c

Browse files
committed
refactor: format code and improve header file includes for consistency
1 parent 83a58f9 commit eeabf7c

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

lib/mylib/MyClass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "MyClass.hpp"
22

3-
MyClass::MyClass(std::ostream& out) : out_(out) {}
3+
MyClass::MyClass(std::ostream& out) : out_(out) {
4+
}
45

56
void MyClass::Print(const std::string& str) {
67
out_ << str;

lib/mylib/MyClass.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
#include <iostream>
55

66
class MyClass {
7-
public:
7+
public:
88
explicit MyClass(std::ostream& out);
99

1010
void Print(const std::string& str);
1111

12-
private:
12+
private:
1313
std::ostream& out_;
1414
};
1515

16-
#endif //MYCLASS_HPP_
16+
#endif // MYCLASS_HPP_

lib/ui/ui_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "ui_functions.hpp"
21
#include "lib/mylib/MyClass.hpp"
2+
#include "ui_functions.hpp"
33

44
int32_t StartConsoleUI(const std::vector<std::string>& args, std::ostream& out) {
55
if (args.size() < 2) {

lib/ui/ui_functions.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef UI_FUNCTIONS_HPP_
22
#define UI_FUNCTIONS_HPP_
33

4-
#include <vector>
5-
#include <string>
64
#include <cstdint>
5+
#include <string>
6+
#include <vector>
77

88
int32_t StartConsoleUI(const std::vector<std::string>& args, std::ostream& out);
99

10-
#endif //UI_FUNCTIONS_HPP_
10+
#endif // UI_FUNCTIONS_HPP_

tests/test_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ std::vector<std::string> SplitString(const std::string& str) {
77
std::istringstream iss(str);
88

99
return {std::istream_iterator<std::string>(iss), std::istream_iterator<std::string>()};
10-
}
10+
}

tests/test_functions.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#ifndef TESTFUNCTIONS_HPP_
22
#define TESTFUNCTIONS_HPP_
33

4-
#include <iostream>
5-
#include <vector>
64
#include <string>
5+
#include <vector>
76

87
std::vector<std::string> SplitString(const std::string& str);
98

10-
#endif //TESTFUNCTIONS_HPP_
9+
#endif // TESTFUNCTIONS_HPP_

tests/unit_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <sstream>
22

33
#include <gtest/gtest.h>
4-
#include "test_functions.hpp" // include your library here
54
#include "lib/mylib/MyClass.hpp"
5+
#include "test_functions.hpp" // include your library here
66

77
TEST(MyLibUnitTestSuite, BasicTest1) {
88
std::ostringstream out;
@@ -12,4 +12,4 @@ TEST(MyLibUnitTestSuite, BasicTest1) {
1212
ASSERT_EQ(out_by_words.size(), 2);
1313
ASSERT_EQ(out_by_words[0], "Hello,");
1414
ASSERT_EQ(out_by_words[1], "World!");
15-
}
15+
}

0 commit comments

Comments
 (0)