diff options
| author | Phil Nash | 2011-03-10 14:09:32 +0000 |
|---|---|---|
| committer | Phil Nash | 2011-03-10 14:09:32 +0000 |
| commit | e0e74774e275df703039745360a5d9fa816cd35c (patch) | |
| tree | 85d5369348dde3b5426b640b26df257704a3a65a /Test/TrickyTests.cpp | |
| parent | b708789ee9aa5888e104adbcaa7048b2432eaf9b (diff) | |
| download | catch3-e0e74774e275df703039745360a5d9fa816cd35c.tar.gz | |
More Single Evaluation work
Diffstat (limited to 'Test/TrickyTests.cpp')
| -rw-r--r-- | Test/TrickyTests.cpp | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/Test/TrickyTests.cpp b/Test/TrickyTests.cpp index 69e54bb0..6078733d 100644 --- a/Test/TrickyTests.cpp +++ b/Test/TrickyTests.cpp @@ -24,7 +24,12 @@ namespace Catch } } -TEST_CASE( "./succeeding/Tricky/std::pair", "Parsing a std::pair" ) +/////////////////////////////////////////////////////////////////////////////// +TEST_CASE +( + "./succeeding/Tricky/std::pair", + "Parsing a std::pair" +) { std::pair<int, int> aNicePair( 1, 2 ); @@ -33,7 +38,12 @@ TEST_CASE( "./succeeding/Tricky/std::pair", "Parsing a std::pair" ) } -TEST_CASE( "./succeeding/Tricky/complex lhs", "Where the LHS is not a simple value" ) +/////////////////////////////////////////////////////////////////////////////// +TEST_CASE +( + "./inprogress/succeeding/Tricky/complex lhs", + "Where the LHS is not a simple value" +) { int a = 1; int b = 2; @@ -45,13 +55,18 @@ TEST_CASE( "./succeeding/Tricky/complex lhs", "Where the LHS is not a simple val struct Opaque { int val; - bool operator ==( const Opaque& o ) + bool operator ==( const Opaque& o ) const { return val == o.val; } }; -TEST_CASE( "./failing/Tricky/non streamable type", "A failing expression with a non streamable type is still captured" ) +/////////////////////////////////////////////////////////////////////////////// +TEST_CASE +( + "./failing/Tricky/non streamable type", + "A failing expression with a non streamable type is still captured" +) { Opaque o1, o2; @@ -61,3 +76,28 @@ TEST_CASE( "./failing/Tricky/non streamable type", "A failing expression with a CHECK( &o1 == &o2 ); CHECK( o1 == o2 ); } + +/////////////////////////////////////////////////////////////////////////////// +TEST_CASE +( + "./failing/string literals", + "string literals of different sizes can be compared" +) +{ + REQUIRE( std::string( "first" ) == "second" ); + +} + +/////////////////////////////////////////////////////////////////////////////// +TEST_CASE +( + "./succeeding/side-effects", + "An expression with side-effects should only be evaluated once" +) +{ + int i = 7; + + REQUIRE( i++ == 7 ); + REQUIRE( i++ == 8 ); + +} |