Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82825 - trunk/libs/utility/test
From: marshall_at_[hidden]
Date: 2013-02-11 16:49:57


Author: marshall
Date: 2013-02-11 16:49:56 EST (Mon, 11 Feb 2013)
New Revision: 82825
URL: http://svn.boost.org/trac/boost/changeset/82825

Log:
Update Boost.StringRef tests to use newer Boost.Test features
Text files modified:
   trunk/libs/utility/test/Jamfile.v2 | 9 +++++++--
   trunk/libs/utility/test/string_ref_test1.cpp | 12 +++++-------
   trunk/libs/utility/test/string_ref_test2.cpp | 10 +++++-----
   3 files changed, 17 insertions(+), 14 deletions(-)

Modified: trunk/libs/utility/test/Jamfile.v2
==============================================================================
--- trunk/libs/utility/test/Jamfile.v2 (original)
+++ trunk/libs/utility/test/Jamfile.v2 2013-02-11 16:49:56 EST (Mon, 11 Feb 2013)
@@ -8,6 +8,11 @@
 # bring in rules for testing
 import testing ;
 
+alias unit_test_framework
+ : # sources
+ /boost//unit_test_framework
+ ;
+
 # Please keep the tests ordered by filename
 test-suite utility
     :
@@ -31,8 +36,8 @@
         [ run ../ref_test.cpp ../../test/build//boost_test_exec_monitor/<link>static ]
         [ compile result_of_test.cpp ]
         [ run ../shared_iterator_test.cpp ]
- [ run string_ref_test1.cpp ]
- [ run string_ref_test2.cpp ]
+ [ run string_ref_test1.cpp unit_test_framework ]
+ [ run string_ref_test2.cpp unit_test_framework ]
         [ run ../value_init_test.cpp ]
         [ run ../value_init_workaround_test.cpp ]
         [ run ../initialized_test.cpp ]

Modified: trunk/libs/utility/test/string_ref_test1.cpp
==============================================================================
--- trunk/libs/utility/test/string_ref_test1.cpp (original)
+++ trunk/libs/utility/test/string_ref_test1.cpp 2013-02-11 16:49:56 EST (Mon, 11 Feb 2013)
@@ -13,8 +13,8 @@
 
 #include <boost/utility/string_ref.hpp>
 
-
-#include <boost/test/included/test_exec_monitor.hpp>
+#define BOOST_TEST_MAIN
+#include <boost/test/unit_test.hpp>
 
 typedef boost::string_ref string_ref;
 
@@ -94,8 +94,8 @@
     NULL
     };
     
-int test_main( int , char* [] ) {
-
+BOOST_AUTO_TEST_CASE( test_main )
+{
     const char **p = &test_strings[0];
 
     while ( *p != NULL ) {
@@ -106,6 +106,4 @@
     
         p++;
         }
-
- return 0;
- }
+}

Modified: trunk/libs/utility/test/string_ref_test2.cpp
==============================================================================
--- trunk/libs/utility/test/string_ref_test2.cpp (original)
+++ trunk/libs/utility/test/string_ref_test2.cpp 2013-02-11 16:49:56 EST (Mon, 11 Feb 2013)
@@ -12,7 +12,8 @@
 
 #include <boost/utility/string_ref.hpp>
 
-#include <boost/test/included/test_exec_monitor.hpp>
+#define BOOST_TEST_MAIN
+#include <boost/test/unit_test.hpp>
 
 typedef boost::string_ref string_ref;
 
@@ -240,7 +241,8 @@
     NULL
     };
     
-int test_main( int , char* [] ) {
+BOOST_AUTO_TEST_CASE( test_main )
+{
     const char **p = &test_strings[0];
     
     while ( *p != NULL ) {
@@ -251,6 +253,4 @@
 
         p++;
         }
-
- return 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