Skip to content

Commit a37d273

Browse files
committedMar 9, 2022
minor cleanup
1 parent 49e2b6b commit a37d273

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed
 

‎README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ Below is the program written as unit-test for validating the correctness of gene
4949

5050
namespace fs = boost::filesystem;
5151

52-
TEST_CASE(" Parsing hello world program")
52+
TEST_CASE("Parsing hello world program")
5353
{
54-
CppParser parser;
55-
parser.parseFunctionBodyAsBlob(false);
56-
auto testFilePath = fs::path(__FILE__).parent_path() / "test-files/hello-world.cpp";
57-
auto ast = parser.parseFile(testFilePath.string());
54+
CppParser parser;
55+
const auto testFilePath = fs::path(__FILE__).parent_path() / "test-files/hello-world.cpp";
56+
const auto ast = parser.parseFile(testFilePath.string());
5857
REQUIRE(ast != nullptr);
5958

6059
const auto& members = ast->members();

‎test/unit/disabled-code-test.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class DisabledCodeTest : public EmbeddedSnippetTestBase
1515
}
1616
};
1717

18-
TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #if")
18+
TEST_CASE_METHOD(DisabledCodeTest, "Code disabled using #if")
1919
{
2020
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
2121
void FunctionWithDisabledParams(int normalParam
@@ -43,7 +43,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #if")
4343
CHECK(params->size() == 1);
4444
}
4545

46-
TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #if !")
46+
TEST_CASE_METHOD(DisabledCodeTest, "Code disabled using #if !")
4747
{
4848
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
4949
void FunctionWithDisabledParams(int normalParam
@@ -71,7 +71,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #if !")
7171
CHECK(params->size() == 2);
7272
}
7373

74-
TEST_CASE_METHOD(DisabledCodeTest, " Code enabled in #else part of #if")
74+
TEST_CASE_METHOD(DisabledCodeTest, "Code enabled in #else part of #if")
7575
{
7676
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
7777
void FunctionWithDisabledParams(int normalParam
@@ -101,7 +101,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code enabled in #else part of #if")
101101
CHECK(params->size() == 2);
102102
}
103103

104-
TEST_CASE_METHOD(DisabledCodeTest, " Code enabled using #if {ID} >= {NUM}")
104+
TEST_CASE_METHOD(DisabledCodeTest, "Code enabled using #if {ID} >= {NUM}")
105105
{
106106
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
107107
void FunctionWithDisabledParams(int normalParam
@@ -129,7 +129,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code enabled using #if {ID} >= {NUM}")
129129
CHECK(params->size() == 2);
130130
}
131131

132-
TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #ifdef")
132+
TEST_CASE_METHOD(DisabledCodeTest, "Code disabled using #ifdef")
133133
{
134134
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
135135
void FunctionWithDisabledParams(int normalParam
@@ -157,7 +157,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #ifdef")
157157
CHECK(params->size() == 1);
158158
}
159159

160-
TEST_CASE_METHOD(DisabledCodeTest, " Code enabled in #else part of #ifdef")
160+
TEST_CASE_METHOD(DisabledCodeTest, "Code enabled in #else part of #ifdef")
161161
{
162162
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
163163
void FunctionWithDisabledParams(int normalParam
@@ -187,7 +187,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code enabled in #else part of #ifdef")
187187
CHECK(params->size() == 2);
188188
}
189189

190-
TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #ifndef")
190+
TEST_CASE_METHOD(DisabledCodeTest, "Code disabled using #ifndef")
191191
{
192192
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
193193
void FunctionWithDisabledParams(int normalParam
@@ -216,7 +216,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code disabled using #ifndef")
216216
CHECK(params->size() == 1);
217217
}
218218

219-
TEST_CASE_METHOD(DisabledCodeTest, " Code enabled in #else part of #ifndef")
219+
TEST_CASE_METHOD(DisabledCodeTest, "Code enabled in #else part of #ifndef")
220220
{
221221
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
222222
void FunctionWithDisabledParams(int normalParam
@@ -246,7 +246,7 @@ TEST_CASE_METHOD(DisabledCodeTest, " Code enabled in #else part of #ifndef")
246246
CHECK(params->size() == 2);
247247
}
248248

249-
TEST_CASE_METHOD(DisabledCodeTest, " Enabled code section has disabled subsection")
249+
TEST_CASE_METHOD(DisabledCodeTest, "Enabled code section has disabled subsection")
250250
{
251251
#if TEST_CASE_SNIPPET_STARTS_FROM_NEXT_LINE
252252
# if CPPPARSER_TEST_DEFINED_MACRO

‎test/unit/namespace-test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ auto p = new char*[5];
2121
# endif
2222
#endif
2323

24-
TEST_CASE_METHOD(NamespaceTest, " C++17 style nested namespace")
24+
TEST_CASE_METHOD(NamespaceTest, "C++17 style nested namespace")
2525
{
2626
auto testSnippet = getTestSnippetParseStream(__LINE__ - 5);
2727

‎test/unit/test-hello-world.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
namespace fs = boost::filesystem;
88

9-
TEST_CASE(" Parsing hello world program")
9+
TEST_CASE("Parsing hello world program")
1010
{
11-
CppParser parser;
12-
parser.parseFunctionBodyAsBlob(false);
13-
auto testFilePath = fs::path(__FILE__).parent_path() / "test-files/hello-world.cpp";
14-
auto ast = parser.parseFile(testFilePath.string());
11+
CppParser parser;
12+
const auto testFilePath = fs::path(__FILE__).parent_path() / "test-files/hello-world.cpp";
13+
const auto ast = parser.parseFile(testFilePath.string());
1514
REQUIRE(ast != nullptr);
1615

1716
const auto& members = ast->members();

0 commit comments

Comments
 (0)