Skip to content
Permalink
Browse files

Add tests for unscoped info

Update approval tests as new tests are added for messaging.
  • Loading branch information...
ozars authored and horenmar committed Feb 1, 2019
1 parent 99575b4 commit 7aee973a4aeeaae11a5731aa4b720cb87d1d6652
@@ -1285,6 +1285,7 @@ Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
loose text artifact
Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'Previous info should not be seen'
Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'previous unscoped info SHOULD not be seen'
Misc.tests.cpp:<line number>: passed: l == std::numeric_limits<long long>::max() for: 9223372036854775807 (0x<hex digits>)
==
9223372036854775807 (0x<hex digits>)
@@ -1306,6 +1307,8 @@ Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 mes
Misc.tests.cpp:<line number>: passed: ( fib[i] % 2 ) == 0 for: 0 == 0 with 1 message: 'Testing if fib[5] (8) is even'
Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[6] (13) is even'
Misc.tests.cpp:<line number>: failed: ( fib[i] % 2 ) == 0 for: 1 == 0 with 1 message: 'Testing if fib[7] (21) is even'
Message.tests.cpp:<line number>: warning: 'info' with 2 messages: 'unscoped info' and 'and warn may mix'
Message.tests.cpp:<line number>: warning: 'info' with 2 messages: 'unscoped info' and 'they are not cleared after warnings'
Misc.tests.cpp:<line number>: failed: a == b for: 1 == 2
Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
Misc.tests.cpp:<line number>: passed: a < b for: 1 < 2
@@ -1315,13 +1318,22 @@ Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
Tricky.tests.cpp:<line number>: passed: s == "7" for: "7" == "7"
Tricky.tests.cpp:<line number>: passed: ti == typeid(int) for: {?} == {?}
Misc.tests.cpp:<line number>: passed:
Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen only for the FIRST assertion IF info is printed for passing assertions'
Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen only for the SECOND assertion IF info is printed for passing assertions'
Message.tests.cpp:<line number>: failed: false with 1 message: 'this SHOULD be seen'
Misc.tests.cpp:<line number>: passed: makeString( false ) != static_cast<char*>(0) for: "valid string" != {null string}
Misc.tests.cpp:<line number>: passed: makeString( true ) == static_cast<char*>(0) for: {null string} == {null string}
Tricky.tests.cpp:<line number>: passed: ptr.get() == 0 for: 0 == 0
ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" for: "{ { 42, "Arthur" }, { "Ford", 24 } }"
==
"{ { 42, "Arthur" }, { "Ford", 24 } }"
Tricky.tests.cpp:<line number>: passed: p == 0 for: 0 == 0
Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY be seen IF info is printed for passing assertions'
Message.tests.cpp:<line number>: failed: false with 2 messages: 'this SHOULD be seen' and 'this SHOULD also be seen'
Message.tests.cpp:<line number>: failed: false with 1 message: 'this SHOULD be seen only ONCE'
Message.tests.cpp:<line number>: passed: true
Message.tests.cpp:<line number>: passed: true with 1 message: 'this MAY also be seen only ONCE IF info is printed for passing assertions'
Message.tests.cpp:<line number>: passed: true
Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
Misc.tests.cpp:<line number>: passed: b != a for: 2 != 1
Misc.tests.cpp:<line number>: passed: a != b for: 1 != 2
@@ -1341,6 +1353,8 @@ String.tests.cpp:<line number>: passed: Catch::replaceInPlace( s, "'", "|'" ) fo
String.tests.cpp:<line number>: passed: s == "didn|'t" for: "didn|'t" == "didn|'t"
Misc.tests.cpp:<line number>: failed: false with 1 message: '3'
Message.tests.cpp:<line number>: failed: false with 2 messages: 'hi' and 'i := 7'
Message.tests.cpp:<line number>: failed: false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3'
Message.tests.cpp:<line number>: failed: false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6'
ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( emptyMap ) == "{ }" for: "{ }" == "{ }"
ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" for: "{ { "one", 1 } }" == "{ { "one", 1 } }"
ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" for: "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }"
@@ -1462,5 +1476,5 @@ Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
Failed 70 test cases, failed 130 assertions.
Failed 77 test cases, failed 138 assertions.

@@ -1056,6 +1056,16 @@ Message.tests.cpp:<line number>: FAILED:
explicitly with message:
Previous info should not be seen

-------------------------------------------------------------------------------
just failure after unscoped info
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
explicitly with message:
previous unscoped info SHOULD not be seen

-------------------------------------------------------------------------------
looped SECTION tests
b is currently: 0
@@ -1128,6 +1138,18 @@ with expansion:
with message:
Testing if fib[7] (21) is even

-------------------------------------------------------------------------------
mix info, unscoped info and warning
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: warning:
and warn may mix

Message.tests.cpp:<line number>: warning:
they are not cleared after warnings

-------------------------------------------------------------------------------
more nested SECTION tests
doesn't equal
@@ -1141,6 +1163,40 @@ Misc.tests.cpp:<line number>: FAILED:
with expansion:
1 == 2

-------------------------------------------------------------------------------
not prints unscoped info from previous failures
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
REQUIRE( false )
with message:
this SHOULD be seen

-------------------------------------------------------------------------------
prints unscoped info on failure
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
REQUIRE( false )
with messages:
this SHOULD be seen
this SHOULD also be seen

-------------------------------------------------------------------------------
prints unscoped info only for the first assertion
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
CHECK( false )
with message:
this SHOULD be seen only ONCE

-------------------------------------------------------------------------------
send a single char to INFO
-------------------------------------------------------------------------------
@@ -1164,6 +1220,28 @@ with messages:
hi
i := 7

-------------------------------------------------------------------------------
stacks unscoped info in loops
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
CHECK( false )
with messages:
Count 1 to 3...
1
2
3

Message.tests.cpp:<line number>: FAILED:
CHECK( false )
with messages:
Count 4 to 6...
4
5
6

-------------------------------------------------------------------------------
string literals of different sizes can be compared
-------------------------------------------------------------------------------
@@ -1186,6 +1264,6 @@ due to unexpected exception with message:
Why would you throw a std::string?

===============================================================================
test cases: 247 | 186 passed | 57 failed | 4 failed as expected
assertions: 1381 | 1244 passed | 116 failed | 21 failed as expected
test cases: 255 | 189 passed | 62 failed | 4 failed as expected
assertions: 1393 | 1250 passed | 122 failed | 21 failed as expected

@@ -9368,6 +9368,16 @@ Message.tests.cpp:<line number>: FAILED:
explicitly with message:
Previous info should not be seen

-------------------------------------------------------------------------------
just failure after unscoped info
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
explicitly with message:
previous unscoped info SHOULD not be seen

-------------------------------------------------------------------------------
just info
-------------------------------------------------------------------------------
@@ -9377,6 +9387,15 @@ Message.tests.cpp:<line number>

No assertions in test case 'just info'

-------------------------------------------------------------------------------
just unscoped info
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................


No assertions in test case 'just unscoped info'

-------------------------------------------------------------------------------
long long
-------------------------------------------------------------------------------
@@ -9572,6 +9591,25 @@ with expansion:
with message:
Testing if fib[7] (21) is even

-------------------------------------------------------------------------------
mix info, unscoped info and warning
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: warning:
info
unscoped info
and warn may mix

Message.tests.cpp:<line number>: warning:
info
unscoped info
they are not cleared after warnings


No assertions in test case 'mix info, unscoped info and warning'

-------------------------------------------------------------------------------
more nested SECTION tests
doesn't equal
@@ -9671,6 +9709,29 @@ Misc.tests.cpp:<line number>

Misc.tests.cpp:<line number>: PASSED:

-------------------------------------------------------------------------------
not prints unscoped info from previous failures
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: PASSED:
REQUIRE( true )
with message:
this MAY be seen only for the FIRST assertion IF info is printed for passing
assertions

Message.tests.cpp:<line number>: PASSED:
REQUIRE( true )
with message:
this MAY be seen only for the SECOND assertion IF info is printed for passing
assertions

Message.tests.cpp:<line number>: FAILED:
REQUIRE( false )
with message:
this SHOULD be seen

-------------------------------------------------------------------------------
null strings
-------------------------------------------------------------------------------
@@ -9722,6 +9783,51 @@ Tricky.tests.cpp:<line number>: PASSED:
with expansion:
0 == 0

-------------------------------------------------------------------------------
print unscoped info if passing unscoped info is printed
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: PASSED:
REQUIRE( true )
with message:
this MAY be seen IF info is printed for passing assertions

-------------------------------------------------------------------------------
prints unscoped info on failure
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
REQUIRE( false )
with messages:
this SHOULD be seen
this SHOULD also be seen

-------------------------------------------------------------------------------
prints unscoped info only for the first assertion
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
CHECK( false )
with message:
this SHOULD be seen only ONCE

Message.tests.cpp:<line number>: PASSED:
CHECK( true )

Message.tests.cpp:<line number>: PASSED:
CHECK( true )
with message:
this MAY also be seen only ONCE IF info is printed for passing assertions

Message.tests.cpp:<line number>: PASSED:
CHECK( true )

-------------------------------------------------------------------------------
random SECTION tests
doesn't equal
@@ -9902,6 +10008,28 @@ with messages:
hi
i := 7

-------------------------------------------------------------------------------
stacks unscoped info in loops
-------------------------------------------------------------------------------
Message.tests.cpp:<line number>
...............................................................................

Message.tests.cpp:<line number>: FAILED:
CHECK( false )
with messages:
Count 1 to 3...
1
2
3

Message.tests.cpp:<line number>: FAILED:
CHECK( false )
with messages:
Count 4 to 6...
4
5
6

-------------------------------------------------------------------------------
std::map is convertible string
empty
@@ -10721,6 +10849,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:

===============================================================================
test cases: 247 | 173 passed | 70 failed | 4 failed as expected
assertions: 1395 | 1244 passed | 130 failed | 21 failed as expected
test cases: 255 | 174 passed | 77 failed | 4 failed as expected
assertions: 1409 | 1250 passed | 138 failed | 21 failed as expected

Oops, something went wrong.

0 comments on commit 7aee973

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.