|
Boost-Commit : |
From: gennadiy.rozental_at_[hidden]
Date: 2007-10-21 16:59:16
Author: rogeeff
Date: 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
New Revision: 40271
URL: http://svn.boost.org/trac/boost/changeset/40271
Log:
correct run rules in examples
make example 2 more pronounced
removed unnecessary ; in example 4 and 5
new alias test in test directory
msvc 6.5 should use static lib
test case for new tools added
Removed:
trunk/libs/test/example/.cvsignore
Text files modified:
trunk/libs/test/example/Jamfile.v2 | 20 ++++++++++----------
trunk/libs/test/example/test_case_template_example.cpp | 4 ++++
trunk/libs/test/example/unit_test_example_02.cpp | 2 +-
trunk/libs/test/example/unit_test_example_04.cpp | 8 ++++----
trunk/libs/test/example/unit_test_example_05.cpp | 2 +-
trunk/libs/test/test/Jamfile.v2 | 10 +++++++++-
trunk/libs/test/test/test_files/test_tools_test.pattern | 32 +++++++++++++++++++-------------
trunk/libs/test/test/test_tools_test.cpp | 27 +++++++++++++++++++++++++++
8 files changed, 75 insertions(+), 30 deletions(-)
Deleted: trunk/libs/test/example/.cvsignore
==============================================================================
--- trunk/libs/test/example/.cvsignore 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
+++ (empty file)
@@ -1 +0,0 @@
-bin
Modified: trunk/libs/test/example/Jamfile.v2
==============================================================================
--- trunk/libs/test/example/Jamfile.v2 (original)
+++ trunk/libs/test/example/Jamfile.v2 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -31,13 +31,13 @@
test-suite boost_test_examples
:
[ run exec_mon_example.cpp prg_exec_monitor ]
- [ run prg_exec_example.cpp prg_exec_monitor ]
+ [ run-fail prg_exec_example.cpp prg_exec_monitor ]
- [ run test_case_template_example.cpp unit_test_framework ]
+ [ run-fail test_case_template_example.cpp unit_test_framework/<link>static ]
- [ run-fail unit_test_example_01.cpp ]
- [ run unit_test_example_02.cpp unit_test_framework ]
- [ run unit_test_example_03.cpp unit_test_framework ]
+ [ run-fail unit_test_example_01.cpp unit_test_framework ]
+ [ run-fail unit_test_example_02.cpp unit_test_framework/<link>static ]
+ [ run-fail unit_test_example_03.cpp unit_test_framework/<link>static ]
[ run-fail unit_test_example_04.cpp unit_test_framework ]
[ run-fail unit_test_example_05.cpp unit_test_framework ]
[ run-fail unit_test_example_06.cpp unit_test_framework ]
@@ -45,14 +45,14 @@
[ run unit_test_example_08.cpp unit_test_framework ]
[ run unit_test_example_09_1.cpp
unit_test_example_09_2.cpp unit_test_framework ]
- [ run-fail unit_test_example_10.cpp unit_test_framework ]
- [ run-fail unit_test_example_11.cpp unit_test_framework ]
- [ link unit_test_example_12.cpp unit_test_framework ]
+ [ run-fail unit_test_example_10.cpp unit_test_framework/<link>static ]
+ [ run-fail unit_test_example_11.cpp unit_test_framework/<link>static ]
+ [ link unit_test_example_12.cpp unit_test_framework/<link>static ]
[ run est_example1.cpp unit_test_framework ]
- [ run est_example2.cpp unit_test_framework ]
+ [ run-fail est_example2.cpp unit_test_framework ]
- [ run logged_exp_example.cpp unit_test_framework ]
+ [ run-fail logged_exp_example.cpp unit_test_framework ]
[ run named_param_example.cpp ]
;
Modified: trunk/libs/test/example/test_case_template_example.cpp
==============================================================================
--- trunk/libs/test/example/test_case_template_example.cpp (original)
+++ trunk/libs/test/example/test_case_template_example.cpp 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -6,6 +6,10 @@
// See http://www.boost.org/libs/test for the library home page.
// Boost.Test
+#ifdef BOOST_MSVC
+# pragma warning(disable: C4345)
+#endif
+
#include <boost/test/test_tools.hpp>
#include <boost/test/test_case_template.hpp>
using boost::unit_test::test_suite;
Modified: trunk/libs/test/example/unit_test_example_02.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_02.cpp (original)
+++ trunk/libs/test/example/unit_test_example_02.cpp 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -21,7 +21,7 @@
// reports 'unknown location(0): fatal error in "free_test_function": memory access violation
// d:\source code\boost\libs\test\example\unit_test_example_02.cpp(25): last checkpoint'
- int* p = (int*)0;
+ int* p = (int*)0x01;
BOOST_CHECK( *p == 0 );
}
Modified: trunk/libs/test/example/unit_test_example_04.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_04.cpp (original)
+++ trunk/libs/test/example/unit_test_example_04.cpp 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -12,7 +12,7 @@
//____________________________________________________________________________//
// automatically registerred test cases could be organized in test suites
-BOOST_AUTO_TEST_SUITE( my_suite1 );
+BOOST_AUTO_TEST_SUITE( my_suite1 )
BOOST_AUTO_TEST_CASE( my_test1 )
{
@@ -31,7 +31,7 @@
BOOST_CHECK_EQUAL( i, 0 );
}
-BOOST_AUTO_TEST_SUITE_END();
+BOOST_AUTO_TEST_SUITE_END()
//____________________________________________________________________________//
@@ -45,7 +45,7 @@
//____________________________________________________________________________//
-BOOST_AUTO_TEST_SUITE( my_suite2 );
+BOOST_AUTO_TEST_SUITE( my_suite2 )
// this test case belongs to suite2 test suite
BOOST_AUTO_TEST_CASE( my_test4 )
@@ -55,7 +55,7 @@
BOOST_CHECK_EQUAL( i, 1 );
}
-BOOST_AUTO_TEST_SUITE_END();
+BOOST_AUTO_TEST_SUITE_END()
//____________________________________________________________________________//
Modified: trunk/libs/test/example/unit_test_example_05.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_05.cpp (original)
+++ trunk/libs/test/example/unit_test_example_05.cpp 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -11,7 +11,7 @@
//____________________________________________________________________________//
-BOOST_AUTO_TEST_SUITE( my_suite );
+BOOST_AUTO_TEST_SUITE( my_suite )
struct F {
F() : i( 0 ) { BOOST_TEST_MESSAGE( "setup fixture" ); }
Modified: trunk/libs/test/test/Jamfile.v2
==============================================================================
--- trunk/libs/test/test/Jamfile.v2 (original)
+++ trunk/libs/test/test/Jamfile.v2 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -14,7 +14,8 @@
: #args
: $(pattern_file)
: #<stlport-iostream>on
- <toolset>borland:<cxxflags>-w-8080
+ <toolset>borland:<cxxflags>-w-8080
+ <toolset>msvc-6.5:<link>static
<define>BOOST_TEST_NO_AUTO_LINK=1 # requirements
: $(test-name)
] ;
@@ -55,3 +56,10 @@
[ test-btl-lib run : token_iterator_test : boost_unit_test_framework ]
[ test-btl-lib run : boost_check_equal_str : boost_unit_test_framework ]
;
+
+
+# A target that runs all the tests
+alias test : basics_test prg_exec_monitor_test unit_test_framework_test ;
+
+# Only run tests when explicitly requested
+explicit test basics_test prg_exec_monitor_test unit_test_framework_test ;
Modified: trunk/libs/test/test/test_files/test_tools_test.pattern
==============================================================================
--- trunk/libs/test/test/test_files/test_tools_test.pattern (original)
+++ trunk/libs/test/test/test_files/test_tools_test.pattern 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -33,23 +33,29 @@
355: warning in "test_BOOST_CHECK_EQUAL": condition b1 == b2 is not satisfied [B(1) != B(2)]
361: error in "test_BOOST_CHECK_EQUAL": check c1 == c3 failed [C(0,100) != C(1,102)]. Index mismatch
362: error in "test_BOOST_CHECK_EQUAL": check c1 == c2 failed [C(0,100) != C(0,101)]. Id mismatch
-392: error in "test_BOOST_CHECK_PREDICATE": check is_even( i ) failed for ( 17 )
-395: error in "test_BOOST_CHECK_PREDICATE": check not_equal_to<int>()( i, 17 ) failed for ( 17, 17 )
-401: warning in "test_BOOST_CHECK_PREDICATE": condition moo( 12, i, j ) is not satisfied for ( 12, 17, 15 )
-409: error in "test_BOOST_CHECK_PREDICATE": check compare_lists( l1, l2 ) failed for ( , ). Different sizes [2!=0]
-420: error in "test_BOOST_REQUIRE_PREDICATE": not aborted
-422: fatal error in "test_BOOST_REQUIRE_PREDICATE": critical check less_equal<int>()( arg2, arg1 ) failed for ( 2, 1 )
-443: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+7 } failed.
+373: error in "test_BOOST_CHECK_LOGICAL_EXPR": check ++i != j failed [2 == 2]
+375: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i < j failed [2 >= 2]
+376: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i > j failed [2 <= 2]
+383: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i <= j failed [3 > 2]
+384: error in "test_BOOST_CHECK_LOGICAL_EXPR": check j >= i failed [2 < 3]
+389: error in "test_BOOST_CHECK_LOGICAL_EXPR": check str1 != str2 failed [test1 == test1]
+419: error in "test_BOOST_CHECK_PREDICATE": check is_even( i ) failed for ( 17 )
+422: error in "test_BOOST_CHECK_PREDICATE": check not_equal_to<int>()( i, 17 ) failed for ( 17, 17 )
+428: warning in "test_BOOST_CHECK_PREDICATE": condition moo( 12, i, j ) is not satisfied for ( 12, 17, 15 )
+436: error in "test_BOOST_CHECK_PREDICATE": check compare_lists( l1, l2 ) failed for ( , ). Different sizes [2!=0]
+447: error in "test_BOOST_REQUIRE_PREDICATE": not aborted
+449: fatal error in "test_BOOST_REQUIRE_PREDICATE": critical check less_equal<int>()( arg2, arg1 ) failed for ( 2, 1 )
+470: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+7 } failed.
Mismatch in a position 2: 4 != 3
Mismatch in a position 5: 7 != 6
-444: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+2 } failed.
+471: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+2 } failed.
Collections size mismatch: 7 != 2
-453: error in "test_BOOST_CHECK_BITWISE_EQUAL": check (char)0x06 =.= (char)0x16 failed.
+480: error in "test_BOOST_CHECK_BITWISE_EQUAL": check (char)0x06 =.= (char)0x16 failed.
Mismatch in a position 4
-456: warning in "test_BOOST_CHECK_BITWISE_EQUAL": condition (char)0x26 =.= (char)0x04 is not satisfied.
+483: warning in "test_BOOST_CHECK_BITWISE_EQUAL": condition (char)0x26 =.= (char)0x04 is not satisfied.
Mismatch in a position 1
Mismatch in a position 5
-459: fatal error in "test_BOOST_CHECK_BITWISE_EQUAL": critical check (char)0x26 =.= (int)0x26 failed.
+486: fatal error in "test_BOOST_CHECK_BITWISE_EQUAL": critical check (char)0x26 =.= (int)0x26 failed.
Operands bit sizes mismatch: 8 != 32
still testing
1+1=2
@@ -58,6 +64,6 @@
0x14
20
0: fatal error in "test_BOOST_TEST_CHECKPOINT": C string: some error
-494: last checkpoint: Going to do a silly things
+521: last checkpoint: Going to do a silly things
0: fatal error in "test_BOOST_TEST_PASSPOINT": unknown type
-505: last checkpoint
+532: last checkpoint
Modified: trunk/libs/test/test/test_tools_test.cpp
==============================================================================
--- trunk/libs/test/test/test_tools_test.cpp (original)
+++ trunk/libs/test/test/test_tools_test.cpp 2007-10-21 16:59:15 EDT (Sun, 21 Oct 2007)
@@ -364,6 +364,33 @@
//____________________________________________________________________________//
+TEST_CASE( test_BOOST_CHECK_LOGICAL_EXPR )
+{
+ int i=1;
+ int j=2;
+ BOOST_CHECK_NE( i, j );
+
+ BOOST_CHECK_NE( ++i, j );
+
+ BOOST_CHECK_LT( i, j );
+ BOOST_CHECK_GT( i, j );
+
+ BOOST_CHECK_LE( i, j );
+ BOOST_CHECK_GE( i, j );
+
+ ++i;
+
+ BOOST_CHECK_LE( i, j );
+ BOOST_CHECK_GE( j, i );
+
+ char const* str1 = "test1";
+ char const* str2 = "test1";
+
+ BOOST_CHECK_NE( str1, str2 );
+}
+
+//____________________________________________________________________________//
+
bool is_even( int i ) { return i%2 == 0; }
int foo( int arg, int mod ) { return arg % mod; }
bool moo( int arg1, int arg2, int mod ) { return ((arg1+arg2) % mod) == 0; }
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