Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/Test/TrickyTests.cpp
diff options
context:
space:
mode:
authorPhil Nash2010-11-16 19:30:41 +0000
committerPhil Nash2010-11-16 19:30:41 +0000
commit7d1ce5fadeaa20ef22a974e3bd269c1465dedc2a (patch)
tree6310d4481e29c733e0f6057ba4d05df96a02e271 /Test/TrickyTests.cpp
parentf59ecbcad6f33210af9d2a8f1de20bc94eba89a0 (diff)
downloadcatch3-7d1ce5fadeaa20ef22a974e3bd269c1465dedc2a.tar.gz
toString() now works with non-specialised non-streamable types
Diffstat (limited to 'Test/TrickyTests.cpp')
-rw-r--r--Test/TrickyTests.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/TrickyTests.cpp b/Test/TrickyTests.cpp
index 73378323..707e50d5 100644
--- a/Test/TrickyTests.cpp
+++ b/Test/TrickyTests.cpp
@@ -41,3 +41,23 @@ TEST_CASE( "succeeding/Tricky/complex lhs", "Where the LHS is not a simple value
// This only captures part of the expression, but issues a warning about the rest
EXPECT( a == 2 || b == 2 );
}
+
+struct Opaque
+{
+ int val;
+ bool operator ==( const Opaque& o )
+ {
+ return val = o.val;
+ }
+};
+
+TEST_CASE( "failing/Tricky/non streamable type", "A failing expression with a non streamable type is still captured" )
+{
+
+ Opaque o1, o2;
+ o1.val = 7;
+ o2.val = 8;
+
+ CHECK( &o1 == &o2 );
+ CHECK( o1 == o2 );
+} \ No newline at end of file