|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81252 - in trunk/libs/test/test: . test_files
From: gennadiy.rozental_at_[hidden]
Date: 2012-11-08 05:46:08
Author: rogeeff
Date: 2012-11-08 05:46:07 EST (Thu, 08 Nov 2012)
New Revision: 81252
URL: http://svn.boost.org/trac/boost/changeset/81252
Log:
updated unit test
Text files modified:
trunk/libs/test/test/test_assertion_construction.cpp | 28 +++++++++++++++++++++++++---
trunk/libs/test/test/test_files/errors_handling_test.pattern | 32 ++++++++++++++++----------------
trunk/libs/test/test/test_files/errors_handling_test.pattern2 | 24 ++++++++++++------------
3 files changed, 53 insertions(+), 31 deletions(-)
Modified: trunk/libs/test/test/test_assertion_construction.cpp
==============================================================================
--- trunk/libs/test/test/test_assertion_construction.cpp (original)
+++ trunk/libs/test/test/test_assertion_construction.cpp 2012-11-08 05:46:07 EST (Thu, 08 Nov 2012)
@@ -19,7 +19,7 @@
//____________________________________________________________________________//
-#if BOOST_NO_CXX11_AUTO_DECLARATIONS
+#ifdef BOOST_NO_CXX11_AUTO_DECLARATIONS
#define EXPR_TYPE assertion::expression const&
#else
#define EXPR_TYPE auto const&
@@ -303,8 +303,6 @@
BOOST_CHECK_EQUAL( res.message(), "Testee == Testee" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
BOOST_CHECK_EQUAL( Testee::s_copy_counter, 0 );
-#else
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 1 );
#endif
}
@@ -467,6 +465,8 @@
//____________________________________________________________________________//
+#ifndef BOOST_NO_CXX11_AUTO_DECLARATIONS
+
BOOST_AUTO_TEST_CASE( collection_comparison )
{
using namespace boost::test_tools;
@@ -517,9 +517,31 @@
BOOST_CHECK( !res );
BOOST_CHECK_EQUAL( res.message(), "\nMismatch in a position 1: 2 < 3");
}
+
+ {
+ std::string s1 = "asdfhjk";
+ std::string s2 = "asdfgjk";
+
+ EXPR_TYPE E = seed->* s1 == s2;
+ predicate_result const& res = E.evaluate();
+ BOOST_CHECK( !res );
+ BOOST_CHECK_EQUAL( res.message(), "asdfhjk != asdfgjk");
+ }
+
+ {
+ std::string str1 = "hello world";
+ std::string str2 = "helko worlt";
+
+ EXPR_TYPE E = seed->* boost::unit_test::const_string( str1 ) == boost::unit_test::const_string( str2 );
+ predicate_result const& res = E.evaluate();
+ BOOST_CHECK( !res );
+ BOOST_CHECK_EQUAL( res.message(), "hello world != helko worlt");
+ }
}
//____________________________________________________________________________//
+#endif
+
// EOF
Modified: trunk/libs/test/test/test_files/errors_handling_test.pattern
==============================================================================
--- trunk/libs/test/test/test_files/errors_handling_test.pattern (original)
+++ trunk/libs/test/test/test_files/errors_handling_test.pattern 2012-11-08 05:46:07 EST (Thu, 08 Nov 2012)
@@ -2,14 +2,14 @@
===========================
log level: log_successful_tests; error type: no error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
99: info: check 'no error' passed
Leaving test case "error_on_demand"
===========================
log level: log_successful_tests; error type: user message;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
message
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -17,7 +17,7 @@
===========================
log level: log_successful_tests; error type: user warning;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
107: warning: in "error_on_demand": warning
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -25,14 +25,14 @@
===========================
log level: log_successful_tests; error type: user non-fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
111: error: in "error_on_demand": non-fatal error
Leaving test case "error_on_demand"
===========================
log level: log_successful_tests; error type: cpp exception;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": class std::runtime_error: test std::runtime error what() message
121: last checkpoint: error_on_demand() throw runtime_error
Leaving test case "error_on_demand"
@@ -40,7 +40,7 @@
===========================
log level: log_successful_tests; error type: system error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": integer divide by zero
126: last checkpoint: error_on_demand() divide by zero
Leaving test case "error_on_demand"
@@ -48,14 +48,14 @@
===========================
log level: log_successful_tests; error type: user fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
115: fatal error: in "error_on_demand": fatal error
Leaving test case "error_on_demand"
===========================
log level: log_successful_tests; error type: system fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": memory access violation
131: last checkpoint: write to an invalid address
Test is aborted
@@ -64,13 +64,13 @@
===========================
log level: log_test_suites; error type: no error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
Leaving test case "error_on_demand"
===========================
log level: log_test_suites; error type: user message;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
message
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -78,7 +78,7 @@
===========================
log level: log_test_suites; error type: user warning;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
107: warning: in "error_on_demand": warning
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -86,14 +86,14 @@
===========================
log level: log_test_suites; error type: user non-fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
111: error: in "error_on_demand": non-fatal error
Leaving test case "error_on_demand"
===========================
log level: log_test_suites; error type: cpp exception;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": class std::runtime_error: test std::runtime error what() message
121: last checkpoint: error_on_demand() throw runtime_error
Leaving test case "error_on_demand"
@@ -101,7 +101,7 @@
===========================
log level: log_test_suites; error type: system error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": integer divide by zero
126: last checkpoint: error_on_demand() divide by zero
Leaving test case "error_on_demand"
@@ -109,14 +109,14 @@
===========================
log level: log_test_suites; error type: user fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
115: fatal error: in "error_on_demand": fatal error
Leaving test case "error_on_demand"
===========================
log level: log_test_suites; error type: system fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": memory access violation
131: last checkpoint: write to an invalid address
Test is aborted
Modified: trunk/libs/test/test/test_files/errors_handling_test.pattern2
==============================================================================
--- trunk/libs/test/test/test_files/errors_handling_test.pattern2 (original)
+++ trunk/libs/test/test/test_files/errors_handling_test.pattern2 2012-11-08 05:46:07 EST (Thu, 08 Nov 2012)
@@ -2,14 +2,14 @@
===========================
log level: log_successful_tests; error type: no error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
99: info: check 'no error' passed
Leaving test case "error_on_demand"
===========================
log level: log_successful_tests; error type: user message;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
message
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -17,7 +17,7 @@
===========================
log level: log_successful_tests; error type: user warning;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
107: warning: in "error_on_demand": warning
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -25,14 +25,14 @@
===========================
log level: log_successful_tests; error type: user non-fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
111: error: in "error_on_demand": non-fatal error
Leaving test case "error_on_demand"
===========================
log level: log_successful_tests; error type: cpp exception;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": std::runtime_error: test std::runtime error what() message
121: last checkpoint: error_on_demand() throw runtime_error
Leaving test case "error_on_demand"
@@ -40,20 +40,20 @@
===========================
log level: log_successful_tests; error type: system error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
115: fatal error: in "error_on_demand": fatal error
Leaving test case "error_on_demand"
===========================
log level: log_test_suites; error type: no error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
Leaving test case "error_on_demand"
===========================
log level: log_test_suites; error type: user message;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
message
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -61,7 +61,7 @@
===========================
log level: log_test_suites; error type: user warning;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
107: warning: in "error_on_demand": warning
Test case error_on_demand did not check any assertions
Leaving test case "error_on_demand"
@@ -69,14 +69,14 @@
===========================
log level: log_test_suites; error type: user non-fatal error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
111: error: in "error_on_demand": non-fatal error
Leaving test case "error_on_demand"
===========================
log level: log_test_suites; error type: cpp exception;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
0: fatal error in "error_on_demand": std::runtime_error: test std::runtime error what() message
121: last checkpoint: error_on_demand() throw runtime_error
Leaving test case "error_on_demand"
@@ -84,7 +84,7 @@
===========================
log level: log_test_suites; error type: system error;
-Entering test case "error_on_demand"
+164: Entering test case "error_on_demand"
115: fatal error: in "error_on_demand": fatal error
Leaving test case "error_on_demand"
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk