mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-27 00:28:49 +03:00
Refactor CHECK_ARRAY_EQUAL details test to look more like the other details tests
This commit is contained in:
parent
c2a9d855b5
commit
a6cbdfcd69
1 changed files with 6 additions and 4 deletions
|
|
@ -280,21 +280,23 @@ TEST(CheckArrayEqualFailureIncludesCheckExpectedAndActual)
|
|||
CHECK(strstr(reporter.lastFailedMessage, "was [ 0 1 3 3 ]"));
|
||||
}
|
||||
|
||||
TEST(CheckArrayEqualFailureContainsCorrectInfo)
|
||||
TEST(CheckArrayEqualFailureContainsCorrectDetails)
|
||||
{
|
||||
int line = 0;
|
||||
RecordingReporter reporter;
|
||||
{
|
||||
UnitTest::TestResults testResults(&reporter);
|
||||
ScopedCurrentTest scopedResults(testResults);
|
||||
UnitTest::TestDetails testDetails("arrayEqualTest", "arrayEqualSuite", "filename", -1);
|
||||
ScopedCurrentTest scopedResults(testResults, &testDetails);
|
||||
|
||||
int const data1[4] = { 0, 1, 2, 3 };
|
||||
int const data2[4] = { 0, 1, 3, 3 };
|
||||
CHECK_ARRAY_EQUAL (data1, data2, 4); line = __LINE__;
|
||||
}
|
||||
|
||||
CHECK_EQUAL("CheckArrayEqualFailureContainsCorrectInfo", reporter.lastFailedTest);
|
||||
CHECK_EQUAL(__FILE__, reporter.lastFailedFile);
|
||||
CHECK_EQUAL("arrayEqualTest", reporter.lastFailedTest);
|
||||
CHECK_EQUAL("arrayEqualSuite", reporter.lastFailedSuite);
|
||||
CHECK_EQUAL("filename", reporter.lastFailedFile);
|
||||
CHECK_EQUAL(line, reporter.lastFailedLine);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue