From c5a24255838e60eddbdf673fdd19576bffbe4da2 Mon Sep 17 00:00:00 2001 From: Gennadiy Rozental Date: Wed, 4 Sep 2002 07:23:32 +0000 Subject: [PATCH] minimal testiing unit test added [SVN r15150] --- test/Jamfile | 1 + test/minimal_test.cpp | 86 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 test/minimal_test.cpp diff --git a/test/Jamfile b/test/Jamfile index a92d9985..07843b01 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -28,6 +28,7 @@ test-suite "test_exec_monitor_test" test-suite "unit_test_framework_test" : [ test-btl-lib run : errors_handling_test : test_exec_monitor ] [ test-btl-lib run : online_test ] + [ test-btl-lib run : minimal_test ] [ test-btl-lib run : output_test_stream_test : unit_test_framework ] [ test-btl-lib run : result_report_test : test_exec_monitor ] [ test-btl-lib run : test_tools_test : unit_test_framework ] diff --git a/test/minimal_test.cpp b/test/minimal_test.cpp new file mode 100644 index 00000000..73e2a5d0 --- /dev/null +++ b/test/minimal_test.cpp @@ -0,0 +1,86 @@ +// (C) Copyright Gennadiy Rozental 2001-2002. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version including documentation. +// +// File : $RCSfile$ +// +// Version : $Id$ +// +// Description : minimal testing unit test +// *************************************************************************** + +// Boost.Test +#include + +//____________________________________________________________________________// + +struct bool_convertible1 { + bool_convertible1( bool v ) : v_( v ) {} + operator bool() { return v_; } + + bool v_; +}; + +//____________________________________________________________________________// + +struct bool_convertible2 { + bool_convertible2( int v ) : v_( v ) {} + operator int() { return v_; } + + int v_; +}; + +//____________________________________________________________________________// + +struct bool_convertible3 { + bool_convertible3( void* v ) : v_( v ) {} + + struct Tester {}; + operator Tester*() { return (Tester*)v_; } + + void* v_; +}; + +//____________________________________________________________________________// + +int +test_main( int argc, char* argv[] ) +{ + int i = 1; + BOOST_CHECK( i == 1 ); + BOOST_CHECK( i == 2 ); + + BOOST_CHECK( bool_convertible1( true ) ); + BOOST_CHECK( bool_convertible1( false ) ); + + BOOST_CHECK( bool_convertible2( 1 ) ); + BOOST_CHECK( bool_convertible2( 0 ) ); + + BOOST_CHECK( bool_convertible3( (void*)1 ) ); + BOOST_CHECK( bool_convertible3( NULL ) ); + + + BOOST_ERROR( "Some error" ); + + BOOST_REQUIRE( i == 4 ); + + return 0; +} + +//____________________________________________________________________________// + +// *************************************************************************** +// Revision History : +// +// $Log$ +// Revision 1.1 2002/09/04 07:23:32 rogeeff +// minimal testiing unit test added +// + +// *************************************************************************** + +// EOF