diff options
Diffstat (limited to 'TAO/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp')
-rw-r--r-- | TAO/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp | 460 |
1 files changed, 206 insertions, 254 deletions
diff --git a/TAO/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp b/TAO/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp index 2c42548cd69..8edf040fb69 100644 --- a/TAO/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp +++ b/TAO/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp @@ -15,11 +15,9 @@ #include "value_sequence_tester.hpp" -#include <boost/test/unit_test.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> +#include "test_macros.h" + -using namespace boost::unit_test_framework; using namespace TAO_VERSIONED_NAMESPACE_NAME::TAO; typedef unbounded_value_sequence<int> tested_sequence; @@ -31,81 +29,85 @@ struct Tester { typedef tested_sequence::value_type value_type; - void test_copy_constructor_from_ulong() + int test_copy_constructor_from_ulong() { expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence x(16); - BOOST_CHECK_MESSAGE(a.expect(1), a); + FAIL_RETURN_IF_NOT(a.expect(1), a); x.length(8); - BOOST_CHECK_EQUAL(CORBA::ULong(16), x.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(8), x.length()); - BOOST_CHECK_EQUAL(true, x.release()); + CHECK_EQUAL(CORBA::ULong(16), x.maximum()); + CHECK_EQUAL(CORBA::ULong(8), x.length()); + CHECK_EQUAL(true, x.release()); tested_sequence y(x); - BOOST_CHECK_MESSAGE(a.expect(1), a); - BOOST_CHECK_EQUAL(CORBA::ULong(16), y.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(8), y.length()); - BOOST_CHECK_EQUAL(true, y.release()); + FAIL_RETURN_IF_NOT(a.expect(1), a); + CHECK_EQUAL(CORBA::ULong(16), y.maximum()); + CHECK_EQUAL(CORBA::ULong(8), y.length()); + CHECK_EQUAL(true, y.release()); } - BOOST_CHECK_MESSAGE(f.expect(2), f); + FAIL_RETURN_IF_NOT(f.expect(2), f); + return 0; } - void test_assignment_from_ulong() + int test_assignment_from_ulong() { expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence x(16); x.length(8); - BOOST_CHECK_MESSAGE(a.expect(1), a); - BOOST_CHECK_EQUAL(CORBA::ULong(16), x.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(8), x.length()); - BOOST_CHECK_EQUAL(true, x.release()); + FAIL_RETURN_IF_NOT(a.expect(1), a); + CHECK_EQUAL(CORBA::ULong(16), x.maximum()); + CHECK_EQUAL(CORBA::ULong(8), x.length()); + CHECK_EQUAL(true, x.release()); tested_sequence y; - BOOST_CHECK_MESSAGE(a.expect(0), a); + FAIL_RETURN_IF_NOT(a.expect(0), a); y = x; - BOOST_CHECK_MESSAGE(a.expect(1), a); - BOOST_CHECK_MESSAGE(f.expect(0), f); - BOOST_CHECK_EQUAL(CORBA::ULong(16), y.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(8), y.length()); - BOOST_CHECK_EQUAL(true, y.release()); + FAIL_RETURN_IF_NOT(a.expect(1), a); + FAIL_RETURN_IF_NOT(f.expect(0), f); + CHECK_EQUAL(CORBA::ULong(16), y.maximum()); + CHECK_EQUAL(CORBA::ULong(8), y.length()); + CHECK_EQUAL(true, y.release()); } - BOOST_CHECK_MESSAGE(f.expect(2), f); + FAIL_RETURN_IF_NOT(f.expect(2), f); + return 0; } - void test_ulong_constructor() + int test_ulong_constructor() { expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence x(16); - BOOST_CHECK_EQUAL(CORBA::ULong(16), x.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(0), x.length()); - BOOST_CHECK_EQUAL(true, x.release()); + CHECK_EQUAL(CORBA::ULong(16), x.maximum()); + CHECK_EQUAL(CORBA::ULong(0), x.length()); + CHECK_EQUAL(true, x.release()); } - BOOST_CHECK_MESSAGE(a.expect(1), a); - BOOST_CHECK_MESSAGE(f.expect(1), f); + FAIL_RETURN_IF_NOT(a.expect(1), a); + FAIL_RETURN_IF_NOT(f.expect(1), f); + return 0; } - void test_exception_in_ulong_constructor() + int test_exception_in_ulong_constructor() { expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_allocation_traits::allocbuf_calls.failure_countdown(1); - BOOST_CHECK_THROW(tested_sequence x(16), testing_exception); - BOOST_CHECK_MESSAGE(a.expect(1), a); + CHECK_THROW(tested_sequence x(16), testing_exception); + FAIL_RETURN_IF_NOT(a.expect(1), a); } - BOOST_CHECK_MESSAGE(f.expect(0), f); + FAIL_RETURN_IF_NOT(f.expect(0), f); + return 0; } - void test_set_length_less_than_maximum() + int test_set_length_less_than_maximum() { expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); @@ -113,34 +115,36 @@ struct Tester tested_sequence x(16); x.length(8); - BOOST_CHECK_EQUAL(CORBA::ULong(16), x.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(8), x.length()); - BOOST_CHECK_EQUAL(true, x.release()); + CHECK_EQUAL(CORBA::ULong(16), x.maximum()); + CHECK_EQUAL(CORBA::ULong(8), x.length()); + CHECK_EQUAL(true, x.release()); } - BOOST_CHECK_MESSAGE(a.expect(1), a); - BOOST_CHECK_MESSAGE(f.expect(1), f); + FAIL_RETURN_IF_NOT(a.expect(1), a); + FAIL_RETURN_IF_NOT(f.expect(1), f); + return 0; } - void test_set_length_more_than_maximum() + int test_set_length_more_than_maximum() { expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence x(16); - BOOST_CHECK_MESSAGE(a.expect(1), a); + FAIL_RETURN_IF_NOT(a.expect(1), a); x.length(32); - BOOST_CHECK_MESSAGE(a.expect(1), a); - BOOST_CHECK_MESSAGE(f.expect(1), f); + FAIL_RETURN_IF_NOT(a.expect(1), a); + FAIL_RETURN_IF_NOT(f.expect(1), f); - BOOST_CHECK_EQUAL(CORBA::ULong(32), x.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(32), x.length()); - BOOST_CHECK_EQUAL(true, x.release()); + CHECK_EQUAL(CORBA::ULong(32), x.maximum()); + CHECK_EQUAL(CORBA::ULong(32), x.length()); + CHECK_EQUAL(true, x.release()); } - BOOST_CHECK_MESSAGE(f.expect(1), f); + FAIL_RETURN_IF_NOT(f.expect(1), f); + return 0; } - void test_exception_in_set_length() + int test_exception_in_set_length() { expected_calls f(tested_allocation_traits::freebuf_calls); { @@ -148,10 +152,11 @@ struct Tester expected_calls a(tested_allocation_traits::allocbuf_calls); tested_allocation_traits::allocbuf_calls.failure_countdown(1); - BOOST_CHECK_THROW(x.length(8), testing_exception); - BOOST_CHECK_MESSAGE(a.expect(1), a); + CHECK_THROW(x.length(8), testing_exception); + FAIL_RETURN_IF_NOT(a.expect(1), a); } - BOOST_CHECK_MESSAGE(f.expect(0), f); + FAIL_RETURN_IF_NOT(f.expect(0), f); + return 0; } value_type * alloc_and_init_buffer() @@ -162,34 +167,34 @@ struct Tester return buf; } - void test_regression_2201 () + int test_regression_2201 () { value_type * buffer = alloc_and_init_buffer(); expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { - tested_sequence a(8, 4, buffer); - BOOST_CHECK_EQUAL(CORBA::ULong(8), a.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(buffer, a.get_buffer()); - BOOST_CHECK_EQUAL(int( 1), a[0]); - BOOST_CHECK_EQUAL(int( 4), a[1]); - BOOST_CHECK_EQUAL(int( 9), a[2]); - BOOST_CHECK_EQUAL(int(16), a[3]); - BOOST_CHECK_EQUAL(false, a.release()); - a.length (3); - BOOST_CHECK_EQUAL(CORBA::ULong(3), a.length()); - a.length (4); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(int(0), a[3]); + tested_sequence x(8, 4, buffer, true); + CHECK_EQUAL(CORBA::ULong(8), x.maximum()); + CHECK_EQUAL(CORBA::ULong(4), x.length()); + CHECK_EQUAL(buffer, x.get_buffer()); + CHECK_EQUAL(int( 1), x[0]); + CHECK_EQUAL(int( 4), x[1]); + CHECK_EQUAL(int( 9), x[2]); + CHECK_EQUAL(int(16), x[3]); + CHECK_EQUAL(true, x.release()); + x.length (3); + CHECK_EQUAL(CORBA::ULong(3), x.length()); + x.length (4); + CHECK_EQUAL(CORBA::ULong(4), x.length()); + CHECK_EQUAL(int(0), x[3]); } - BOOST_CHECK_MESSAGE(a.expect(0), a); - BOOST_CHECK_MESSAGE(f.expect(0), f); - tested_sequence::freebuf(buffer); + FAIL_RETURN_IF_NOT(a.expect(0), a); + FAIL_RETURN_IF_NOT(f.expect(1), f); + return 0; } - void test_buffer_constructor_default() + int test_buffer_constructor_default() { value_type * buffer = alloc_and_init_buffer(); @@ -197,62 +202,65 @@ struct Tester expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence a(8, 4, buffer); - BOOST_CHECK_EQUAL(CORBA::ULong(8), a.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(buffer, a.get_buffer()); - BOOST_CHECK_EQUAL(int( 1), a[0]); - BOOST_CHECK_EQUAL(int( 4), a[1]); - BOOST_CHECK_EQUAL(int( 9), a[2]); - BOOST_CHECK_EQUAL(int(16), a[3]); - BOOST_CHECK_EQUAL(false, a.release()); + CHECK_EQUAL(CORBA::ULong(8), a.maximum()); + CHECK_EQUAL(CORBA::ULong(4), a.length()); + CHECK_EQUAL(buffer, a.get_buffer()); + CHECK_EQUAL(int( 1), a[0]); + CHECK_EQUAL(int( 4), a[1]); + CHECK_EQUAL(int( 9), a[2]); + CHECK_EQUAL(int(16), a[3]); + CHECK_EQUAL(false, a.release()); } - BOOST_CHECK_MESSAGE(a.expect(0), a); - BOOST_CHECK_MESSAGE(f.expect(0), f); + FAIL_RETURN_IF_NOT(a.expect(0), a); + FAIL_RETURN_IF_NOT(f.expect(0), f); tested_sequence::freebuf(buffer); + return 0; } - void test_buffer_constructor_false() + int test_buffer_constructor_false() { value_type * buffer = alloc_and_init_buffer(); expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence a(8, 4, buffer, false); - BOOST_CHECK_EQUAL(CORBA::ULong(8), a.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(buffer, a.get_buffer()); - BOOST_CHECK_EQUAL(int( 1), a[0]); - BOOST_CHECK_EQUAL(int( 4), a[1]); - BOOST_CHECK_EQUAL(int( 9), a[2]); - BOOST_CHECK_EQUAL(int(16), a[3]); - BOOST_CHECK_EQUAL(false, a.release()); + CHECK_EQUAL(CORBA::ULong(8), a.maximum()); + CHECK_EQUAL(CORBA::ULong(4), a.length()); + CHECK_EQUAL(buffer, a.get_buffer()); + CHECK_EQUAL(int( 1), a[0]); + CHECK_EQUAL(int( 4), a[1]); + CHECK_EQUAL(int( 9), a[2]); + CHECK_EQUAL(int(16), a[3]); + CHECK_EQUAL(false, a.release()); } - BOOST_CHECK_MESSAGE(a.expect(0), a); - BOOST_CHECK_MESSAGE(f.expect(0), f); + FAIL_RETURN_IF_NOT(a.expect(0), a); + FAIL_RETURN_IF_NOT(f.expect(0), f); tested_sequence::freebuf(buffer); + return 0; } - void test_buffer_constructor_true() + int test_buffer_constructor_true() { value_type * buffer = alloc_and_init_buffer(); expected_calls a(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence a(8, 4, buffer, true); - BOOST_CHECK_EQUAL(CORBA::ULong(8), a.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(buffer, a.get_buffer()); - BOOST_CHECK_EQUAL(int( 1), a[0]); - BOOST_CHECK_EQUAL(int( 4), a[1]); - BOOST_CHECK_EQUAL(int( 9), a[2]); - BOOST_CHECK_EQUAL(int(16), a[3]); - BOOST_CHECK_EQUAL(true, a.release()); + CHECK_EQUAL(CORBA::ULong(8), a.maximum()); + CHECK_EQUAL(CORBA::ULong(4), a.length()); + CHECK_EQUAL(buffer, a.get_buffer()); + CHECK_EQUAL(int( 1), a[0]); + CHECK_EQUAL(int( 4), a[1]); + CHECK_EQUAL(int( 9), a[2]); + CHECK_EQUAL(int(16), a[3]); + CHECK_EQUAL(true, a.release()); } - BOOST_CHECK_MESSAGE(a.expect(0), a); - BOOST_CHECK_MESSAGE(f.expect(1), f); + FAIL_RETURN_IF_NOT(a.expect(0), a); + FAIL_RETURN_IF_NOT(f.expect(1), f); + return 0; } - void test_replace_default() + int test_replace_default() { value_type * buffer = alloc_and_init_buffer(); @@ -261,24 +269,25 @@ struct Tester { tested_sequence a; a.replace(8, 4, buffer); - BOOST_CHECK_MESSAGE(c.expect(0), c); - BOOST_CHECK_MESSAGE(f.expect(0), f); - - BOOST_CHECK_EQUAL(CORBA::ULong(8), a.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(buffer, a.get_buffer()); - BOOST_CHECK_EQUAL(int( 1), a[0]); - BOOST_CHECK_EQUAL(int( 4), a[1]); - BOOST_CHECK_EQUAL(int( 9), a[2]); - BOOST_CHECK_EQUAL(int(16), a[3]); - BOOST_CHECK_EQUAL(false, a.release()); + FAIL_RETURN_IF_NOT(c.expect(0), c); + FAIL_RETURN_IF_NOT(f.expect(0), f); + + CHECK_EQUAL(CORBA::ULong(8), a.maximum()); + CHECK_EQUAL(CORBA::ULong(4), a.length()); + CHECK_EQUAL(buffer, a.get_buffer()); + CHECK_EQUAL(int( 1), a[0]); + CHECK_EQUAL(int( 4), a[1]); + CHECK_EQUAL(int( 9), a[2]); + CHECK_EQUAL(int(16), a[3]); + CHECK_EQUAL(false, a.release()); } - BOOST_CHECK_MESSAGE(c.expect(0), c); - BOOST_CHECK_MESSAGE(f.expect(0), f); + FAIL_RETURN_IF_NOT(c.expect(0), c); + FAIL_RETURN_IF_NOT(f.expect(0), f); tested_sequence::freebuf(buffer); + return 0; } - void test_replace_false() + int test_replace_false() { value_type * buffer = alloc_and_init_buffer(); expected_calls c(tested_allocation_traits::allocbuf_calls); @@ -287,24 +296,25 @@ struct Tester { tested_sequence a; a.replace(8, 4, buffer, false); - BOOST_CHECK_MESSAGE(c.expect(0), c); - BOOST_CHECK_MESSAGE(f.expect(0), f); - - BOOST_CHECK_EQUAL(CORBA::ULong(8), a.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(buffer, a.get_buffer()); - BOOST_CHECK_EQUAL(int( 1), a[0]); - BOOST_CHECK_EQUAL(int( 4), a[1]); - BOOST_CHECK_EQUAL(int( 9), a[2]); - BOOST_CHECK_EQUAL(int(16), a[3]); - BOOST_CHECK_EQUAL(false, a.release()); + FAIL_RETURN_IF_NOT(c.expect(0), c); + FAIL_RETURN_IF_NOT(f.expect(0), f); + + CHECK_EQUAL(CORBA::ULong(8), a.maximum()); + CHECK_EQUAL(CORBA::ULong(4), a.length()); + CHECK_EQUAL(buffer, a.get_buffer()); + CHECK_EQUAL(int( 1), a[0]); + CHECK_EQUAL(int( 4), a[1]); + CHECK_EQUAL(int( 9), a[2]); + CHECK_EQUAL(int(16), a[3]); + CHECK_EQUAL(false, a.release()); } - BOOST_CHECK_MESSAGE(c.expect(0), c); - BOOST_CHECK_MESSAGE(f.expect(0), f); + FAIL_RETURN_IF_NOT(c.expect(0), c); + FAIL_RETURN_IF_NOT(f.expect(0), f); tested_sequence::freebuf(buffer); + return 0; } - void test_replace_true() + int test_replace_true() { value_type * buffer = alloc_and_init_buffer(); expected_calls c(tested_allocation_traits::allocbuf_calls); @@ -313,165 +323,107 @@ struct Tester { tested_sequence a; a.replace(8, 4, buffer, true); - BOOST_CHECK_MESSAGE(c.expect(0), c); - BOOST_CHECK_MESSAGE(f.expect(0), f); - - BOOST_CHECK_EQUAL(CORBA::ULong(8), a.maximum()); - BOOST_CHECK_EQUAL(CORBA::ULong(4), a.length()); - BOOST_CHECK_EQUAL(buffer, a.get_buffer()); - BOOST_CHECK_EQUAL(int( 1), a[0]); - BOOST_CHECK_EQUAL(int( 4), a[1]); - BOOST_CHECK_EQUAL(int( 9), a[2]); - BOOST_CHECK_EQUAL(int(16), a[3]); - BOOST_CHECK_EQUAL(true, a.release()); + FAIL_RETURN_IF_NOT(c.expect(0), c); + FAIL_RETURN_IF_NOT(f.expect(0), f); + + CHECK_EQUAL(CORBA::ULong(8), a.maximum()); + CHECK_EQUAL(CORBA::ULong(4), a.length()); + CHECK_EQUAL(buffer, a.get_buffer()); + CHECK_EQUAL(int( 1), a[0]); + CHECK_EQUAL(int( 4), a[1]); + CHECK_EQUAL(int( 9), a[2]); + CHECK_EQUAL(int(16), a[3]); + CHECK_EQUAL(true, a.release()); } - BOOST_CHECK_MESSAGE(c.expect(0), c); - BOOST_CHECK_MESSAGE(f.expect(1), f); + FAIL_RETURN_IF_NOT(c.expect(0), c); + FAIL_RETURN_IF_NOT(f.expect(1), f); + return 0; } - void test_get_buffer_default() + int test_get_buffer_default() { value_type * buffer = alloc_and_init_buffer(); tested_sequence a(8, 4, buffer, true); - BOOST_CHECK_EQUAL(a.get_buffer(), buffer); + CHECK_EQUAL(a.get_buffer(), buffer); + return 0; } - void test_get_buffer_false() + int test_get_buffer_false() { value_type * buffer = alloc_and_init_buffer(); tested_sequence a(8, 4, buffer, true); - BOOST_CHECK_EQUAL(a.get_buffer(), buffer); + CHECK_EQUAL(a.get_buffer(), buffer); + return 0; } - void test_get_buffer_true_with_release_false() + int test_get_buffer_true_with_release_false() { value_type * buffer = alloc_and_init_buffer(); tested_sequence a(8, 4, buffer, false); - BOOST_CHECK(0 == a.get_buffer(true)); + CHECK(0 == a.get_buffer(true)); tested_sequence::freebuf(buffer); + return 0; } - void test_get_buffer_true_with_release_true() + int test_get_buffer_true_with_release_true() { value_type * buffer = alloc_and_init_buffer(); expected_calls c(tested_allocation_traits::allocbuf_calls); expected_calls f(tested_allocation_traits::freebuf_calls); { tested_sequence a(8, 4, buffer, true); - BOOST_CHECK_EQUAL(buffer, a.get_buffer(true)); + CHECK_EQUAL(buffer, a.get_buffer(true)); tested_sequence const & b = a; - BOOST_CHECK_EQUAL(0UL, b.maximum()); - BOOST_CHECK_EQUAL(0UL, b.length()); - BOOST_CHECK(0 != b.get_buffer()); - BOOST_CHECK_EQUAL(true, b.release()); + CHECK_EQUAL(0UL, b.maximum()); + CHECK_EQUAL(0UL, b.length()); + CHECK(0 != b.get_buffer()); + CHECK_EQUAL(true, b.release()); - BOOST_CHECK_MESSAGE(c.expect(1), c); + FAIL_RETURN_IF_NOT(c.expect(1), c); - BOOST_CHECK(buffer != b.get_buffer()); + CHECK(buffer != b.get_buffer()); } - BOOST_CHECK_MESSAGE(c.expect(0), c); - BOOST_CHECK_MESSAGE(f.expect(1), f); + FAIL_RETURN_IF_NOT(c.expect(0), c); + FAIL_RETURN_IF_NOT(f.expect(1), f); tested_sequence::freebuf(buffer); + return 0; } - void add_all(test_suite * ts) - { - boost::shared_ptr<Tester> shared_this(self_); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_ulong_constructor, - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_copy_constructor_from_ulong, - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_assignment_from_ulong, - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_exception_in_ulong_constructor, - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_set_length_less_than_maximum, - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_set_length_more_than_maximum, - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_exception_in_set_length, - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_regression_2201 , - shared_this)); - - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_buffer_constructor_default, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_buffer_constructor_false, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_buffer_constructor_true, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_replace_default, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_replace_false, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_replace_true, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_get_buffer_false, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_get_buffer_true_with_release_false, - shared_this)); - ts->add(BOOST_CLASS_TEST_CASE( - &Tester::test_get_buffer_true_with_release_true, - shared_this)); - - } - - static boost::shared_ptr<Tester> allocate() + int test_all() { - boost::shared_ptr<Tester> ptr(new Tester); - ptr->self_ = ptr; - - return ptr; + int status = 0; + status += this->test_ulong_constructor(); + status += this->test_copy_constructor_from_ulong(); + status += this->test_assignment_from_ulong(); + status += this->test_exception_in_ulong_constructor(); + status += this->test_set_length_less_than_maximum(); + status += this->test_set_length_more_than_maximum(); + status += this->test_exception_in_set_length(); + status += this->test_regression_2201 (); + status += this->test_buffer_constructor_default(); + status += this->test_buffer_constructor_false(); + status += this->test_buffer_constructor_true(); + status += this->test_replace_default(); + status += this->test_replace_false(); + status += this->test_replace_true(); + status += this->test_get_buffer_false(); + status += this->test_get_buffer_true_with_release_false(); + status += this->test_get_buffer_true_with_release_true(); + return status; } - -private: Tester() {} - - boost::weak_ptr<Tester> self_; }; -ACE_Proper_Export_Flag test_suite * -init_unit_test_suite(int, char*[]) +int ACE_TMAIN(int,ACE_TCHAR*[]) { - test_suite * ts = - BOOST_TEST_SUITE("unbounded value sequence unit test"); - - { - boost::shared_ptr<Tester> tester(Tester::allocate()); - tester->add_all(ts); - } + int status = 0; + Tester tester; + status += tester.test_all (); - { - typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; - boost::shared_ptr<common> tester(common::allocate()); - tester->add_all(ts); - } + typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; + common tester2; + status += tester2.test_all (); - return ts; + return status; } - |