Skip to content

Commit 0492eb0

Browse files
committed
Clean up unit tests (extra output was removed)
1 parent 53fee14 commit 0492eb0

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

tests/coreTests.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ TEST_CASE("Preprocessor Tests")
4141
Lexer lexer(std::make_unique<StringInputStream>(inputSource));
4242

4343
Preprocessor preprocessor(lexer, { errorCallback });
44-
std::cout << preprocessor.Process() << std::endl;
44+
preprocessor.Process();
4545
}
4646

4747
SECTION("TestProcess_PassSourceWithSimpleMacroWithoutValue_ReturnsSourceWithExpandedMacro")
@@ -59,7 +59,7 @@ TEST_CASE("Preprocessor Tests")
5959
Lexer lexer(std::make_unique<StringInputStream>(inputSource));
6060

6161
Preprocessor preprocessor(lexer, { errorCallback });
62-
std::cout << preprocessor.Process() << std::endl;
62+
preprocessor.Process();
6363
}
6464

6565
SECTION("TestProcess_PassSourceWithIncludeDirective_ReturnsSourceStringWithIncludeDirective")
@@ -353,7 +353,7 @@ TEST_CASE("Preprocessor Tests")
353353
result = false;
354354
} });
355355

356-
std::cout << preprocessor.Process() << std::endl;
356+
preprocessor.Process();
357357
REQUIRE(result);
358358
}
359359

@@ -371,7 +371,6 @@ TEST_CASE("Preprocessor Tests")
371371
} });
372372

373373
auto&& output = preprocessor.Process();
374-
std::cout << output << std::endl;
375374
REQUIRE(output == inputSource);
376375
}
377376

@@ -389,7 +388,6 @@ TEST_CASE("Preprocessor Tests")
389388
} });
390389

391390
auto&& output = preprocessor.Process();
392-
std::cout << output << std::endl;
393391
REQUIRE(output == inputSource);
394392
}
395393

@@ -407,8 +405,6 @@ TEST_CASE("Preprocessor Tests")
407405
} });
408406

409407
std::string str = preprocessor.Process();
410-
std::cout << str << std::endl;
411-
412408
REQUIRE((result && (str == "AAABB")));
413409
}
414410

@@ -446,8 +442,6 @@ TEST_CASE("Preprocessor Tests")
446442
} });
447443

448444
std::string actualResult = preprocessor.Process();
449-
std::cout << actualResult << std::endl;
450-
451445
REQUIRE((result && (actualResult == expectedResult)));
452446
}
453447

@@ -474,8 +468,6 @@ TEST_CASE("Preprocessor Tests")
474468
} });
475469

476470
std::string actualResult = preprocessor.Process();
477-
std::cout << actualResult << std::endl;
478-
479471
REQUIRE((result && (actualResult == expectedResult)));
480472
}
481473

@@ -524,7 +516,7 @@ TEST_CASE("Preprocessor Tests")
524516
std::cout << "Error" << ErrorTypeToString(err.mType) << "\n";
525517
} });
526518

527-
std::cout << preprocessor.Process() << "\n";
519+
preprocessor.Process();
528520
}
529521

530522
SECTION("TestProcess_VA_ARGS_MultiExpand")
@@ -546,7 +538,7 @@ int main()
546538
std::cout << "Error" << ErrorTypeToString(err.mType) << "\n";
547539
} });
548540

549-
std::cout << preprocessor.Process() << "\n";
541+
preprocessor.Process();
550542
}
551543

552544
SECTION("TestProcess_PassDefineThatSeparatedWithSpaces_ReturnsCorrectProcessedSource")
@@ -946,8 +938,6 @@ TEST(3)
946938

947939
Preprocessor preprocessor(lexer, { [&result](auto&& arg)
948940
{
949-
std::cerr << "Error: " << ErrorTypeToString(arg.mType) << std::endl;
950-
951941
REQUIRE(arg.mType == E_ERROR_TYPE::INCORRECT_STRINGIFY_OPERATOR_USAGE);
952942
result = false;
953943
}, [](auto&&, auto&&)
@@ -998,7 +988,7 @@ TEST()
998988

999989
Preprocessor preprocessor(lexer, { [&result](auto&& arg)
1000990
{
1001-
std::cerr << "Error: " << ErrorTypeToString(arg.mType) << std::endl;
991+
REQUIRE(arg.mType == E_ERROR_TYPE::INCONSISTENT_MACRO_ARITY);
1002992
result = false;
1003993
}, [](auto&&, auto&&)
1004994
{

0 commit comments

Comments
 (0)