[Echempp-devel] Experiment/Experiment/test ExperimentTest.cpp, 1.4, 1.5
Status: Beta
Brought to you by:
berndspeiser
|
From: beeblbrox <bee...@us...> - 2007-04-11 08:24:35
|
Update of /cvsroot/echempp/Experiment/Experiment/test In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv30202/test Modified Files: ExperimentTest.cpp Log Message: Added test case for remove function of Compound. Index: ExperimentTest.cpp =================================================================== RCS file: /cvsroot/echempp/Experiment/Experiment/test/ExperimentTest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExperimentTest.cpp 10 Apr 2007 09:18:30 -0000 1.4 --- ExperimentTest.cpp 11 Apr 2007 08:24:32 -0000 1.5 *************** *** 442,445 **** --- 442,456 ---- } + void test_remove() + { + Collection col; + BOOST_REQUIRE_NO_THROW( col.add(new RealDynamicEPTAction()) ); + BOOST_REQUIRE_NO_THROW( col.add(new Homogeneous()) ); + BOOST_REQUIRE_NO_THROW( col.add(new RealDynamicEPTAction()) ); + BOOST_REQUIRE_NO_THROW( col.remove(1) ); + BOOST_REQUIRE_THROW( col.remove(2), ExperimentException ); + BOOST_CHECK( col.num_elements() == 2 ); + } + test_suite* init_unit_test_suite( int argc, char * argv[] ) { *************** *** 450,453 **** --- 461,465 ---- test->add( BOOST_TEST_CASE( &test_container_invariants ) ); test->add( BOOST_TEST_CASE( &test_serialization ) ); + test->add( BOOST_TEST_CASE( &test_remove ) ); // test->add( BOOST_TEST_CASE( &infinite_loop ), 0, /* timeout */ 2 ); return test; |