diff --git a/build/msvc71_proj/boost_test_library.sln b/build/msvc71_proj/boost_test_library.sln
index acc7814b..970dfc93 100644
--- a/build/msvc71_proj/boost_test_library.sln
+++ b/build/msvc71_proj/boost_test_library.sln
@@ -149,6 +149,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_exception_test", "cu
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "class_properties_test", "class_properties_test.vcproj", "{84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {9466C117-7AE0-4AFD-B327-E1612568BCF1} = {9466C117-7AE0-4AFD-B327-E1612568BCF1}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basic_cstring_test", "basic_cstring_test.vcproj", "{84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {9466C117-7AE0-4AFD-B327-E1612568BCF1} = {9466C117-7AE0-4AFD-B327-E1612568BCF1}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -283,6 +293,14 @@ Global
{84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Debug.Build.0 = Debug|Win32
{84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Release.ActiveCfg = Release|Win32
{84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Release.Build.0 = Release|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Debug.ActiveCfg = Debug|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Debug.Build.0 = Debug|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Release.ActiveCfg = Release|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Release.Build.0 = Release|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Debug.ActiveCfg = Debug|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Debug.Build.0 = Debug|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Release.ActiveCfg = Release|Win32
+ {84B8BFE6-0722-4F7A-BB34-B039BD7D6CD7}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
diff --git a/build/msvc71_proj/unit_test_framework.vcproj b/build/msvc71_proj/unit_test_framework.vcproj
index 17ca79d9..78e5735e 100644
--- a/build/msvc71_proj/unit_test_framework.vcproj
+++ b/build/msvc71_proj/unit_test_framework.vcproj
@@ -42,7 +42,7 @@
Name="VCCustomBuildTool"/>
@@ -350,6 +350,22 @@
+
+
+
+
+
+
+
+
+
+
There are two ways to use the output_test_stream tool: explicit output
checks and pattern file matching.
Explicit output checks
- using boost::test_toolbox::output_test_stream;
-
+ using boost::test_tools::output_test_stream;
+
int test_main( int, char* [] ) {
output_test_stream output;
int i=2;
@@ -57,8 +57,8 @@
possible. It's not only simplify patters you compare with, but also allows you to more closely identify
possible source of failure.
Pattern file matching
- using boost::test_toolbox::output_test_stream;
-
+ using boost::test_tools::output_test_stream;
+
int test_main( int argc, char* [] ) {
output_test_stream output( "pattern_file", argc == 1);
int i=2;
@@ -75,7 +75,7 @@
Even more simpler: no need to generate expected patterns. Though you
need to keep the pattern file all the time somewhere around. Your testing will look like a serious
of output operators followed by match pattern checks. And so on again. Try to perform checks as frequently
- as possible,cause it allows you to more closely identify possible source of failure.
+ as possible,cause it allows you to more closely identify possible source of failure.
output_test_stream_test
result_report_test
diff --git a/doc/components/test_tools/output_test_stream_spec.html b/doc/components/test_tools/output_test_stream_spec.html
index 27bb8874..386a4482 100644
--- a/doc/components/test_tools/output_test_stream_spec.html
+++ b/doc/components/test_tools/output_test_stream_spec.html
@@ -9,10 +9,10 @@
+ > boost::test_tools::ostream_test_stream

-
boost::test_toolbox::ostream_test_stream
-
The class boost::test_toolbox::ostream_test_stream encapsulates procedures
+
boost::test_tools::ostream_test_stream
+
The class boost::test_tools::ostream_test_stream encapsulates procedures
needed for effective and convenient operator<<( std::ostream&, ... ) correctness check.
Synopsis
class output_test_stream {
diff --git a/doc/components/unit_test_framework/components/index.html b/doc/components/unit_test_framework/components/index.html
index b796af62..e27c3ea8 100644
--- a/doc/components/unit_test_framework/components/index.html
+++ b/doc/components/unit_test_framework/components/index.html
@@ -13,7 +13,7 @@
The Unit Test Framework components
The Unit Test Framework consists of several cooperating components. All
- components are located in the namespace boost::unit_test_framework.
+ components are located in the namespace boost::unit_test.
- The Test Case - encapsulates the notion of a testing unit
diff --git a/doc/components/unit_test_framework/components/test_case/boost_function_test_case.html b/doc/components/unit_test_framework/components/test_case/boost_function_test_case.html
index 5dbf3083..ad23dc70 100644
--- a/doc/components/unit_test_framework/components/test_case/boost_function_test_case.html
+++ b/doc/components/unit_test_framework/components/test_case/boost_function_test_case.html
@@ -44,7 +44,7 @@
macro is the pointer or reference to zero arity function or function object - body of the test case.
Example
#include <boost/test/unit_test_ex.hpp>
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
#include <boost/bind.hpp>
void test_mask( int arg, int mask )
diff --git a/doc/components/unit_test_framework/components/test_case/function_test_case.html b/doc/components/unit_test_framework/components/test_case/function_test_case.html
index 2c382bc8..be538e6c 100644
--- a/doc/components/unit_test_framework/components/test_case/function_test_case.html
+++ b/doc/components/unit_test_framework/components/test_case/function_test_case.html
@@ -42,7 +42,7 @@
ts->add( BOOST_TEST_CASE( &test_feature1 ) );
_________________________________________________
#include <boost/test/unit_test.hpp>
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
void free_test_function()
diff --git a/doc/components/unit_test_framework/components/test_case/parameterized_boost_function_test_case.html b/doc/components/unit_test_framework/components/test_case/parameterized_boost_function_test_case.html
index 8d174375..21a1925d 100644
--- a/doc/components/unit_test_framework/components/test_case/parameterized_boost_function_test_case.html
+++ b/doc/components/unit_test_framework/components/test_case/parameterized_boost_function_test_case.html
@@ -51,7 +51,7 @@
handle a parameters list lifetime is to place it into a user defined test suite class.
Example
#include <boost/test/unit_test_ex.hpp>
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
#include <boost/bind.hpp>
void test_mask( int arg, int mask )
diff --git a/doc/components/unit_test_framework/components/test_case/parameterized_function_test_case.html b/doc/components/unit_test_framework/components/test_case/parameterized_function_test_case.html
index a971c34c..027da0c1 100644
--- a/doc/components/unit_test_framework/components/test_case/parameterized_function_test_case.html
+++ b/doc/components/unit_test_framework/components/test_case/parameterized_function_test_case.html
@@ -44,7 +44,7 @@
...
}
-struct reader_testing : public boost::unit_test_framework::test_suite
+struct reader_testing : public boost::unit_test::test_suite
{
reader_testing()
{
diff --git a/doc/components/unit_test_framework/getting_started/const_string_test.cpp b/doc/components/unit_test_framework/getting_started/const_string_test.cpp
index 1f8c60db..0183eb2e 100644
--- a/doc/components/unit_test_framework/getting_started/const_string_test.cpp
+++ b/doc/components/unit_test_framework/getting_started/const_string_test.cpp
@@ -15,7 +15,7 @@
using common_layer::const_string;
#include
-using namespace boost::unit_test_framework;
+using namespace boost::unit_test;
#include
#include
diff --git a/doc/components/unit_test_framework/getting_started/index.html b/doc/components/unit_test_framework/getting_started/index.html
index 05ea1bb5..490b3e0e 100644
--- a/doc/components/unit_test_framework/getting_started/index.html
+++ b/doc/components/unit_test_framework/getting_started/index.html
@@ -28,7 +28,7 @@
It will look like this:
const_string_test.cpp:
#include <boost/test/unit_test.hpp>
-using namespace boost::unit_test_framework;
+using namespace boost::unit_test;
test_suite*
init_unit_test_suite( int argc, char* argv[] )
@@ -67,7 +67,7 @@ init_unit_test_suite( int argc, #include <boost/test/unit_test.hpp>
-using namespace boost::unit_test_framework;
+using namespace boost::unit_test;
void constructors_test() {
const_string cs0( "" );
@@ -139,7 +139,7 @@ init_unit_test_suite( int argc, #include <boost/test/unit_test.hpp>
-using namespace boost::unit_test_framework;
+using namespace boost::unit_test;
void constructors_test() {
...
diff --git a/doc/components/unit_test_framework/index.html b/doc/components/unit_test_framework/index.html
index a9f94ef7..2195fe59 100644
--- a/doc/components/unit_test_framework/index.html
+++ b/doc/components/unit_test_framework/index.html
@@ -62,7 +62,7 @@
function main() that initializing testing environment and taking care about results reporting. The
main function also includes a hook for the function that should be supplied by the user. So, to integrate
test program with the framework you should provide the function with the following specification:
- boost::unit_test_framework::test_suite* init_unit_test_suite ( int
+
boost::unit_test::test_suite* init_unit_test_suite ( int
argc, char* argv[] )
This function should create and initialize top
level instance of the class test_suite. The NULL pointer returned by the function
@@ -81,7 +81,7 @@
In case if your test cases may throw custom exceptions (see here for list of exceptions translated by default), you could register translator specific for that exception. For more details on translator specification you could see excecution_monitor description. To register translator in test case monitor use following template function defined in the framework:
template<typename Exception, typename ExceptionTranslator>
void
- boost::unit_test_framework::register_exception_translator( ExceptionTranslator const& tr, boost::type<Exception>* d = 0 )
+ boost::unit_test::register_exception_translator( ExceptionTranslator const& tr, boost::type<Exception>* d = 0 )
Once testing is finished, the framework reports the results and returns
the result code. Here the list of values returned by the test programs integrated with the unit test
diff --git a/example/test_case_template_example.cpp b/example/test_case_template_example.cpp
index eb95c46b..ad103e16 100644
--- a/example/test_case_template_example.cpp
+++ b/example/test_case_template_example.cpp
@@ -8,7 +8,7 @@
// Boost.Test
#include
#include
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
// Boost.MPL
#include
diff --git a/example/unit_test_example1.cpp b/example/unit_test_example1.cpp
index 80a010be..5b880e4a 100644
--- a/example/unit_test_example1.cpp
+++ b/example/unit_test_example1.cpp
@@ -8,13 +8,16 @@
// Boost.Test
#include
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
// most frequently you implement test cases as a free functions
void free_test_function()
{
// reports 'error in "free_test_function": test 2 == 1 failed'
BOOST_CHECK(2 == 1); // non-critical test => continue after failure
+
+ int* p = (int*)0;
+ *p = 0;
}
test_suite*
diff --git a/example/unit_test_example2.cpp b/example/unit_test_example2.cpp
index 05d22b42..9be96cb2 100644
--- a/example/unit_test_example2.cpp
+++ b/example/unit_test_example2.cpp
@@ -8,7 +8,7 @@
// Boost.Test
#include
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
void force_division_by_zero()
{
diff --git a/example/unit_test_example3.cpp b/example/unit_test_example3.cpp
index 8d01545d..d60f2d08 100644
--- a/example/unit_test_example3.cpp
+++ b/example/unit_test_example3.cpp
@@ -10,8 +10,8 @@
// Boost.Test
#include
#include
-using boost::unit_test_framework::test_suite;
-using boost::unit_test_framework::test_case;
+using boost::unit_test::test_suite;
+using boost::unit_test::test_case;
using boost::test_toolbox::close_at_tolerance;
// BOOST
diff --git a/example/unit_test_example4.cpp b/example/unit_test_example4.cpp
index 7ee3c755..5485774d 100644
--- a/example/unit_test_example4.cpp
+++ b/example/unit_test_example4.cpp
@@ -8,7 +8,7 @@
// Boost.Test
#include
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
// STL
#include
diff --git a/example/unit_test_example5.cpp b/example/unit_test_example5.cpp
index 0167660d..83e01670 100644
--- a/example/unit_test_example5.cpp
+++ b/example/unit_test_example5.cpp
@@ -8,7 +8,7 @@
// Boost.Test
#include
#include
-using boost::unit_test_framework::test_suite;
+using boost::unit_test::test_suite;
// BOOST
#include
diff --git a/src/cpp_main.cpp b/src/cpp_main.cpp
index 52e070a0..f177cbf1 100644
--- a/src/cpp_main.cpp
+++ b/src/cpp_main.cpp
@@ -58,8 +58,8 @@ int main( int argc, char* argv[] )
int result;
- boost::unit_test_framework::c_string_literal p( std::getenv( "BOOST_TEST_CATCH_SYSTEM_ERRORS" ) );
- bool catch_system_errors = !p || (std::strcmp( p, "no" ) != 0);
+ boost::unit_test::const_string p( std::getenv( "BOOST_TEST_CATCH_SYSTEM_ERRORS" ) );
+ bool catch_system_errors = p != "no";
try {
result = caller.execute( catch_system_errors );
@@ -84,8 +84,8 @@ int main( int argc, char* argv[] )
// like the clutter. Use an environment variable to avoid command
// line argument modifications; for use in production programs
// that's a no-no in some organizations.
- boost::unit_test_framework::c_string_literal p( std::getenv( "BOOST_PRG_MON_CONFIRM" ) );
- if( !p || std::strcmp( p, "no" ) != 0 ) {
+ boost::unit_test::const_string p( std::getenv( "BOOST_PRG_MON_CONFIRM" ) );
+ if( p != "no" ) {
std::cerr << std::flush << "no errors detected" << std::endl;
}
}
@@ -99,6 +99,11 @@ int main( int argc, char* argv[] )
// Revision History :
//
// $Log$
+// Revision 1.14 2004/05/11 11:04:44 rogeeff
+// basic_cstring introduced and used everywhere
+// class properties reworked
+// namespace names shortened
+//
// Revision 1.13 2003/12/01 00:42:37 rogeeff
// prerelease cleaning
//
diff --git a/src/execution_monitor.cpp b/src/execution_monitor.cpp
index 376909c9..d5fb00af 100644
--- a/src/execution_monitor.cpp
+++ b/src/execution_monitor.cpp
@@ -80,7 +80,7 @@ namespace boost {
namespace detail {
-using unit_test_framework::c_string_literal;
+using unit_test::const_string;
// boost::execution_monitor::execute() calls boost::detail::catch_signals() to
// execute user function with signals control
@@ -91,11 +91,12 @@ const std::size_t REPORT_ERROR_BUFFER_SIZE = 512;
static int catch_signals( execution_monitor & exmon, bool catch_system_errors, int timeout ); // timeout is in seconds. 0 implies none.
-static void report_error( execution_exception::error_code ec,
- c_string_literal msg1, // first part of the message
- c_string_literal msg2 = "" ); // second part of the message; sum length msg1 + msg2 should
- // exceed REPORT_ERROR_BUFFER_SIZE; never concatenate messages
- // manually, cause it should work even in case of memory lack
+static void report_error(
+ execution_exception::error_code ec,
+ const_string msg1, // first part of the message
+ const_string msg2 = "" ); // second part of the message; sum length msg1 + msg2 should not
+ // exceed REPORT_ERROR_BUFFER_SIZE; never concatenate messages
+ // manually, cause it should work even in case of memory lack
//____________________________________________________________________________//
@@ -132,21 +133,22 @@ static void report_ms_se_error( unsigned int id );
#elif defined(BOOST_SIGACTION_BASED_SIGNAL_HANDLING)
class unix_signal_exception {
+ typedef execution_exception::error_code error_code_type;
public:
// Constructor
- unix_signal_exception( execution_exception::error_code ec, c_string_literal em )
+ unix_signal_exception( execution_exception::error_code ec, const_string em )
: m_error_code( ec ), m_error_message( em ) {}
// Destructor
~unix_signal_exception() {}
// access methods
- execution_exception::error_code error_code() const { return m_error_code; }
- c_string_literal error_message() const { return m_error_message; }
+ error_code_type error_code() const { return m_error_code; }
+ const_string error_message() const { return m_error_message; }
private:
// Data members
- execution_exception::error_code m_error_code;
- c_string_literal m_error_message;
+ error_code_type m_error_code;
+ const_string m_error_message;
};
#endif
@@ -191,7 +193,7 @@ execution_monitor::run_function()
int
execution_monitor::execute( bool catch_system_errors, int timeout )
{
- using unit_test_framework::c_string_literal;
+ using unit_test::const_string;
#if defined(BOOST_MS_STRCTURED_EXCEPTION_HANDLING) && !defined(__BORLANDC__)
if( catch_system_errors )
@@ -214,7 +216,7 @@ execution_monitor::execute( bool catch_system_errors, int timeout )
// required. Programmers ask for const anyhow, so we supply it. That's
// easier than answering questions about non-const usage.
- catch( c_string_literal ex )
+ catch( char const* ex )
{ detail::report_error( execution_exception::cpp_exception_error, "C string: ", ex ); }
catch( std::string const& ex )
{ detail::report_error( execution_exception::cpp_exception_error, "std::string: ", ex.c_str() ); }
@@ -397,7 +399,7 @@ int catch_signals( execution_monitor & exmon, bool catch_system_errors, int time
signal_handler local_signal_handler( catch_system_errors, timeout );
int result = 0;
execution_exception::error_code ec = execution_exception::no_error;
- c_string_literal em = c_string_literal();
+ const_string em;
volatile int sigtype = sigsetjmp( signal_handler::jump_buffer(), 1 );
if( sigtype == 0 ) {
@@ -407,28 +409,28 @@ int catch_signals( execution_monitor & exmon, bool catch_system_errors, int time
switch(sigtype) {
case SIGALRM:
ec = execution_exception::timeout_error;
- em = "signal: SIGALRM (timeout while executing function)";
+ em = BOOST_TEST_L( "signal: SIGALRM (timeout while executing function)" );
break;
case SIGTRAP:
ec = execution_exception::system_error;
- em = "signal: SIGTRAP (perhaps integer divide by zero)";
+ em = BOOST_TEST_L( "signal: SIGTRAP (perhaps integer divide by zero)" );
break;
case SIGFPE:
ec = execution_exception::system_error;
- em = "signal: SIGFPE (arithmetic exception)";
+ em = BOOST_TEST_L( "signal: SIGFPE (arithmetic exception)" );
break;
case SIGABRT:
ec = execution_exception::system_error;
- em = "signal: SIGABRT (application abort requested)";
+ em = BOOST_TEST_L( "signal: SIGABRT (application abort requested)" );
break;
case SIGSEGV:
case SIGBUS:
ec = execution_exception::system_fatal_error;
- em = "signal: memory access violation";
+ em = BOOST_TEST_L( "signal: memory access violation" );
break;
default:
ec = execution_exception::system_error;
- em = "signal: unrecognized signal";
+ em = BOOST_TEST_L( "signal: unrecognized signal" );
}
}
@@ -565,12 +567,15 @@ report_ms_se_error( unsigned int id )
// ************** report_error ************** //
// ************************************************************************** //
-static void report_error( execution_exception::error_code ec, c_string_literal msg1, c_string_literal msg2 )
+static void report_error( execution_exception::error_code ec, const_string msg1, const_string msg2 )
{
static char buf[REPORT_ERROR_BUFFER_SIZE];
+
buf[0] = '\0';
- std::strncat( buf, msg1, sizeof(buf)-1 );
- std::strncat( buf, msg2, sizeof(buf)-1-std::strlen(buf) );
+
+ std::strncat( buf, msg1.begin(), sizeof(buf)-1 );
+ std::strncat( buf, msg2.begin(), sizeof(buf) - msg1.size() - 1 );
+
throw execution_exception( ec, buf );
}
@@ -584,6 +589,11 @@ static void report_error( execution_exception::error_code ec, c_string_literal m
// Revision History :
//
// $Log$
+// Revision 1.31 2004/05/11 11:04:44 rogeeff
+// basic_cstring introduced and used everywhere
+// class properties reworked
+// namespace names shortened
+//
// Revision 1.30 2003/12/20 11:27:28 johnmaddock
// Added fixes for Borland C++ 6.0 compiler (With EDG frontend).
//
diff --git a/src/supplied_log_formatters.cpp b/src/supplied_log_formatters.cpp
index d12611ae..6dd300bd 100755
--- a/src/supplied_log_formatters.cpp
+++ b/src/supplied_log_formatters.cpp
@@ -28,7 +28,7 @@
namespace boost {
-namespace unit_test_framework {
+namespace unit_test {
namespace detail {
@@ -77,13 +77,13 @@ msvc65_like_log_formatter::track_test_case_scope( std::ostream& output, test_cas
{
output << (in_out ? "Entering" : "Leaving")
<< " test " << ( tc.p_type ? "case" : "suite" )
- << " \"" << tc.p_name.get() << "\"";
+ << " \"" << tc.p_name << "\"";
}
//____________________________________________________________________________//
void
-msvc65_like_log_formatter::log_exception( std::ostream& output, std::string const& test_case_name, c_string_literal explanation )
+msvc65_like_log_formatter::log_exception( std::ostream& output, const_string test_case_name, const_string explanation )
{
output << "Exception in \"" << test_case_name << "\": " << explanation;
@@ -126,7 +126,7 @@ msvc65_like_log_formatter::begin_log_entry( std::ostream& output, log_entry_type
//____________________________________________________________________________//
void
-msvc65_like_log_formatter::log_entry_value( std::ostream& output, std::string const& value )
+msvc65_like_log_formatter::log_entry_value( std::ostream& output, const_string value )
{
output << value;
}
@@ -141,9 +141,9 @@ msvc65_like_log_formatter::end_log_entry( std::ostream& /* output */ )
//____________________________________________________________________________//
void
-msvc65_like_log_formatter::print_prefix( std::ostream& output, std::string const& file, std::size_t line )
+msvc65_like_log_formatter::print_prefix( std::ostream& output, const_string file, std::size_t line )
{
- output << file << '(' << line << "): ";
+ output << file << '(' << line << "): ";
}
//____________________________________________________________________________//
@@ -153,7 +153,7 @@ msvc65_like_log_formatter::print_prefix( std::ostream& output, std::string const
// ************************************************************************** //
xml_log_formatter::xml_log_formatter( unit_test_log const& log )
-: unit_test_log_formatter( log ), m_indent( 0 ), m_curr_tag( c_string_literal() )
+: unit_test_log_formatter( log ), m_indent( 0 )
{
}
@@ -166,11 +166,11 @@ xml_log_formatter::start_log( std::ostream& output, bool log_build_info )
if( log_build_info )
output << " platform=\"" << BOOST_PLATFORM << '\"'
- << " compiler=\"" << BOOST_COMPILER << '\"'
- << " stl=\"" << BOOST_STDLIB << '\"'
- << " boost=\"" << BOOST_VERSION/100000 << "."
- << BOOST_VERSION/100 % 1000 << "."
- << BOOST_VERSION % 100 << '\"';
+ << " compiler=\"" << BOOST_COMPILER << '\"'
+ << " stl=\"" << BOOST_STDLIB << '\"'
+ << " boost=\"" << BOOST_VERSION/100000 << "."
+ << BOOST_VERSION/100 % 1000 << "."
+ << BOOST_VERSION % 100 << '\"';
output << ">\n";
}
@@ -204,7 +204,7 @@ xml_log_formatter::track_test_case_scope( std::ostream& output, test_case const&
<< ( tc.p_type ? "TestCase" : "TestSuite" );
if( in_out )
- output << " name=\"" << tc.p_name.get() << "\"";
+ output << " name=\"" << tc.p_name << "\"";
output << ">";
@@ -215,7 +215,7 @@ xml_log_formatter::track_test_case_scope( std::ostream& output, test_case const&
//____________________________________________________________________________//
void
-xml_log_formatter::log_exception( std::ostream& output, std::string const& test_case_name, c_string_literal explanation )
+xml_log_formatter::log_exception( std::ostream& output, const_string test_case_name, const_string explanation )
{
print_indent( output );
@@ -255,7 +255,7 @@ xml_log_formatter::log_exception( std::ostream& output, std::string const& test_
void
xml_log_formatter::begin_log_entry( std::ostream& output, log_entry_types let )
{
- static c_string_literal const xml_tags[] = { "Info", "Message", "Warning", "Error", "FatalError" };
+ static literal_string xml_tags[] = { "Info", "Message", "Warning", "Error", "FatalError" };
print_indent( output );
@@ -272,7 +272,7 @@ xml_log_formatter::begin_log_entry( std::ostream& output, log_entry_types let )
//____________________________________________________________________________//
void
-xml_log_formatter::log_entry_value( std::ostream& output, std::string const& value )
+xml_log_formatter::log_entry_value( std::ostream& output, const_string value )
{
output << value;
}
@@ -282,7 +282,7 @@ xml_log_formatter::log_entry_value( std::ostream& output, std::string const& val
void
xml_log_formatter::end_log_entry( std::ostream& output )
{
- if( !m_curr_tag )
+ if( m_curr_tag.is_empty() )
return;
output << '\n';
@@ -292,7 +292,7 @@ xml_log_formatter::end_log_entry( std::ostream& output )
output << "" << m_curr_tag << ">";
- m_curr_tag = c_string_literal();
+ m_curr_tag.clear();
}
//____________________________________________________________________________//
@@ -307,7 +307,7 @@ xml_log_formatter::print_indent( std::ostream& output )
} // namespace detail
-} // namespace unit_test_framework
+} // namespace unit_test
} // namespace boost
@@ -315,6 +315,11 @@ xml_log_formatter::print_indent( std::ostream& output )
// Revision History :
//
// $Log$
+// Revision 1.7 2004/05/11 11:04:44 rogeeff
+// basic_cstring introduced and used everywhere
+// class properties reworked
+// namespace names shortened
+//
// Revision 1.6 2003/12/01 00:42:37 rogeeff
// prerelease cleaning
//
diff --git a/src/test_main.cpp b/src/test_main.cpp
index 187a1ae8..5245a2f1 100644
--- a/src/test_main.cpp
+++ b/src/test_main.cpp
@@ -46,16 +46,16 @@ namespace {
// ************************************************************************** //
int main( int argc, char* argv[] ) {
- using namespace boost::unit_test_framework;
+ using namespace boost::unit_test;
// set the log level
unit_test_log::instance().set_log_threshold_level_by_name( retrieve_framework_parameter( LOG_LEVEL, &argc, argv ) );
// set the report level
- std::string reportlevel = retrieve_framework_parameter( REPORT_LEVEL, &argc, argv );
+ const_string reportlevel = retrieve_framework_parameter( REPORT_LEVEL, &argc, argv );
// set the log/report format
- std::string output_format = retrieve_framework_parameter( OUTPUT_FORMAT, &argc, argv );
+ const_string output_format = retrieve_framework_parameter( OUTPUT_FORMAT, &argc, argv );
if( output_format.empty() ) {
unit_test_log::instance().set_log_format( retrieve_framework_parameter( LOG_FORMAT, &argc, argv ) );
@@ -98,6 +98,11 @@ int main( int argc, char* argv[] ) {
// Revision History :
//
// $Log$
+// Revision 1.16 2004/05/11 11:04:44 rogeeff
+// basic_cstring introduced and used everywhere
+// class properties reworked
+// namespace names shortened
+//
// Revision 1.15 2003/12/01 00:42:37 rogeeff
// prerelease cleaning
//
diff --git a/src/test_tools.cpp b/src/test_tools.cpp
index 800d3acf..6adc4f6f 100644
--- a/src/test_tools.cpp
+++ b/src/test_tools.cpp
@@ -35,7 +35,7 @@ namespace std { using ::strcmp; using ::strncmp; using ::strlen; using ::isprint
namespace boost {
-namespace test_toolbox {
+namespace test_tools {
namespace detail {
@@ -44,19 +44,19 @@ namespace detail {
// ************************************************************************** //
void
-checkpoint_impl( wrap_stringstream& message, c_string_literal file_name, std::size_t line_num )
+checkpoint_impl( wrap_stringstream& message, const_string file_name, std::size_t line_num )
{
- BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test_framework::log_test_suites )
- unit_test_framework::checkpoint( message.str() )
+ BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test::log_test_suites )
+ unit_test::checkpoint( message.str() )
BOOST_UT_LOG_END
}
//____________________________________________________________________________//
void
-message_impl( wrap_stringstream& message, c_string_literal file_name, std::size_t line_num )
+message_impl( wrap_stringstream& message, const_string file_name, std::size_t line_num )
{
- BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test_framework::log_messages )
+ BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test::log_messages )
message.str()
BOOST_UT_LOG_END
}
@@ -65,15 +65,15 @@ message_impl( wrap_stringstream& message, c_string_literal file_name, std::size_
void
warn_and_continue_impl( bool predicate, wrap_stringstream& message,
- c_string_literal file_name, std::size_t line_num, bool add_fail_pass )
+ const_string file_name, std::size_t line_num, bool add_fail_pass )
{
if( !predicate ) {
- BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test_framework::log_warnings )
+ BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test::log_warnings )
(add_fail_pass ? "condition " : "") << message.str() << (add_fail_pass ? " is not satisfied" : "" )
BOOST_UT_LOG_END
}
else {
- BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test_framework::log_successful_tests )
+ BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test::log_successful_tests )
"condition " << message.str() << " is satisfied"
BOOST_UT_LOG_END
}
@@ -82,7 +82,7 @@ warn_and_continue_impl( bool predicate, wrap_stringstream& message,
//____________________________________________________________________________//
void
-warn_and_continue_impl( extended_predicate_value const& v, wrap_stringstream& message, c_string_literal file_name, std::size_t line_num,
+warn_and_continue_impl( extended_predicate_value const& v, wrap_stringstream& message, const_string file_name, std::size_t line_num,
bool add_fail_pass )
{
warn_and_continue_impl( !!v,
@@ -94,11 +94,11 @@ warn_and_continue_impl( extended_predicate_value const& v, wrap_stringstream& me
bool
test_and_continue_impl( bool predicate, wrap_stringstream& message,
- c_string_literal file_name, std::size_t line_num,
- bool add_fail_pass, unit_test_framework::log_level loglevel )
+ const_string file_name, std::size_t line_num,
+ bool add_fail_pass, unit_test::log_level loglevel )
{
if( !predicate ) {
- unit_test_framework::unit_test_result::instance().inc_failed_assertions();
+ unit_test::unit_test_result::instance().inc_failed_assertions();
BOOST_UT_LOG_BEGIN( file_name, line_num, loglevel )
(add_fail_pass ? "test " : "") << message.str() << (add_fail_pass ? " failed" : "")
@@ -107,9 +107,9 @@ test_and_continue_impl( bool predicate, wrap_stringstream& message,
return true;
}
else {
- unit_test_framework::unit_test_result::instance().inc_passed_assertions();
+ unit_test::unit_test_result::instance().inc_passed_assertions();
- BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test_framework::log_successful_tests )
+ BOOST_UT_LOG_BEGIN( file_name, line_num, unit_test::log_successful_tests )
(add_fail_pass ? "test " : "") << message.str() << (add_fail_pass ? " passed" : "")
BOOST_UT_LOG_END
@@ -121,8 +121,8 @@ test_and_continue_impl( bool predicate, wrap_stringstream& message,
bool
test_and_continue_impl( extended_predicate_value const& v, wrap_stringstream& message,
- c_string_literal file_name, std::size_t line_num,
- bool add_fail_pass, unit_test_framework::log_level loglevel )
+ const_string file_name, std::size_t line_num,
+ bool add_fail_pass, unit_test::log_level loglevel )
{
return test_and_continue_impl( !!v,
message << (add_fail_pass ? (!v ? " failed. " : " passed. ") : "") << *(v.p_message),
@@ -133,8 +133,8 @@ test_and_continue_impl( extended_predicate_value const& v, wrap_stringstream& me
void
test_and_throw_impl( bool predicate, wrap_stringstream& message,
- c_string_literal file_name, std::size_t line_num,
- bool add_fail_pass, unit_test_framework::log_level loglevel )
+ const_string file_name, std::size_t line_num,
+ bool add_fail_pass, unit_test::log_level loglevel )
{
if( test_and_continue_impl( predicate, message, file_name, line_num, add_fail_pass, loglevel ) ) {
throw test_tool_failed(); // error already reported by test_and_continue_impl
@@ -145,8 +145,8 @@ test_and_throw_impl( bool predicate, wrap_stringstream& message,
void
test_and_throw_impl( extended_predicate_value const& v, wrap_stringstream& message,
- c_string_literal file_name, std::size_t line_num,
- bool add_fail_pass, unit_test_framework::log_level loglevel )
+ const_string file_name, std::size_t line_num,
+ bool add_fail_pass, unit_test::log_level loglevel )
{
if( test_and_continue_impl( v, message, file_name, line_num, add_fail_pass, loglevel ) ) {
throw test_tool_failed(); // error already reported by test_and_continue_impl
@@ -157,8 +157,8 @@ test_and_throw_impl( extended_predicate_value const& v, wrap_stringstream& messa
bool
equal_and_continue_impl( c_string_literal left, c_string_literal right, wrap_stringstream& message,
- c_string_literal file_name, std::size_t line_num,
- unit_test_framework::log_level loglevel )
+ const_string file_name, std::size_t line_num,
+ unit_test::log_level loglevel )
{
bool predicate = (left && right) ? std::strcmp( left, right ) == 0 : (left == right);
@@ -177,10 +177,11 @@ equal_and_continue_impl( c_string_literal left, c_string_literal right, wrap_str
//____________________________________________________________________________//
bool
-is_defined_impl( c_string_literal symbol_name, c_string_literal symbol_value )
+is_defined_impl( const_string symbol_name, const_string symbol_value )
{
+ symbol_value.trim_left( 2 );
// return std::strncmp( symbol_name, symbol_value, std::strlen( symbol_name ) ) != 0;
- return std::strcmp( symbol_name, symbol_value + 2 ) != 0;
+ return symbol_name != symbol_value;
}
//____________________________________________________________________________//
@@ -248,29 +249,18 @@ struct output_test_stream::Impl
void check_and_fill( extended_predicate_value& res )
{
- if( !res.p_predicate_value.get() )
+ if( !res.p_predicate_value )
*(res.p_message) << "Output content: \"" << m_synced_string << '\"';
}
};
//____________________________________________________________________________//
-output_test_stream::output_test_stream( std::string const& pattern_file_name, bool match_or_save )
+output_test_stream::output_test_stream( const_string pattern_file_name, bool match_or_save )
: m_pimpl( new Impl )
{
- if( !pattern_file_name.empty() )
- m_pimpl->m_pattern_to_match_or_save.open( pattern_file_name.c_str(), match_or_save ? std::ios::in : std::ios::out );
-
- m_pimpl->m_match_or_save = match_or_save;
-}
-
-//____________________________________________________________________________//
-
-output_test_stream::output_test_stream( c_string_literal pattern_file_name, bool match_or_save )
-: m_pimpl( new Impl )
-{
- if( pattern_file_name && pattern_file_name[0] != '\0' )
- m_pimpl->m_pattern_to_match_or_save.open( pattern_file_name, match_or_save ? std::ios::in : std::ios::out );
+ if( !pattern_file_name.is_empty() )
+ m_pimpl->m_pattern_to_match_or_save.open( pattern_file_name.begin(), match_or_save ? std::ios::in : std::ios::out );
m_pimpl->m_match_or_save = match_or_save;
}
@@ -318,45 +308,11 @@ output_test_stream::check_length( std::size_t length_, bool flush_stream )
//____________________________________________________________________________//
extended_predicate_value
-output_test_stream::is_equal( c_string_literal arg, bool flush_stream )
+output_test_stream::is_equal( const_string arg, bool flush_stream )
{
sync();
- result_type res( m_pimpl->m_synced_string == arg );
-
- m_pimpl->check_and_fill( res );
-
- if( flush_stream )
- flush();
-
- return res;
-}
-
-//____________________________________________________________________________//
-
-extended_predicate_value
-output_test_stream::is_equal( std::string const& arg, bool flush_stream )
-{
- sync();
-
- result_type res( m_pimpl->m_synced_string == arg );
-
- m_pimpl->check_and_fill( res );
-
- if( flush_stream )
- flush();
-
- return res;
-}
-
-//____________________________________________________________________________//
-
-extended_predicate_value
-output_test_stream::is_equal( c_string_literal arg, std::size_t n, bool flush_stream )
-{
- sync();
-
- result_type res( m_pimpl->m_synced_string == std::string( arg, n ) );
+ result_type res( const_string( m_pimpl->m_synced_string ) == arg );
m_pimpl->check_and_fill( res );
@@ -469,7 +425,7 @@ output_test_stream::sync()
//____________________________________________________________________________//
-} // namespace test_toolbox
+} // namespace test_tools
} // namespace boost
@@ -477,6 +433,11 @@ output_test_stream::sync()
// Revision History :
//
// $Log$
+// Revision 1.28 2004/05/11 11:04:44 rogeeff
+// basic_cstring introduced and used everywhere
+// class properties reworked
+// namespace names shortened
+//
// Revision 1.27 2004/03/10 09:39:45 tknapen
// parenthesis around std::isprint because it's a macro on mipspro
//
diff --git a/src/unit_test_log.cpp b/src/unit_test_log.cpp
index 1abbbf08..40c667bd 100644
--- a/src/unit_test_log.cpp
+++ b/src/unit_test_log.cpp
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
// BOOST
#include
@@ -26,6 +27,7 @@
// STL
#include
+#include