summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhoffert <jhoffert@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-01-30 17:07:54 +0000
committerjhoffert <jhoffert@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-01-30 17:07:54 +0000
commit39501e837e25cfa7253ef070fd8e9745d0cde55c (patch)
treee59ae937e887c3c1ef3309244bfcf65dd72fa6ef
parent8b1921daff6110f44a70c6454a56dd6689302dc4 (diff)
downloadATCD-39501e837e25cfa7253ef070fd8e9745d0cde55c.tar.gz
Updated tests to match updates to iterators
-rw-r--r--TAO/tests/Sequence_Iterators/Bounded_String.cpp48
-rw-r--r--TAO/tests/Sequence_Iterators/StringSeq.cpp4
2 files changed, 35 insertions, 17 deletions
diff --git a/TAO/tests/Sequence_Iterators/Bounded_String.cpp b/TAO/tests/Sequence_Iterators/Bounded_String.cpp
index 34822993435..c9fbd7d4a7a 100644
--- a/TAO/tests/Sequence_Iterators/Bounded_String.cpp
+++ b/TAO/tests/Sequence_Iterators/Bounded_String.cpp
@@ -62,8 +62,11 @@ int test_sequence ()
FAIL_RETURN_IF (a_it != a.begin ());
// test non const dereferencing
- char* value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
+ // I don't think this test makes sense. I believe the compiler
+ // will always return a const value since the dereference is on
+ // the right hand side of the assignment (i.e., r value).
+ //char* value0 = *a_it;
+ //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
// test const dereferencing
const char* const value1 = *a_it;
@@ -172,8 +175,10 @@ int test_sequence ()
std::ostringstream ostream;
std::copy (a.begin (),
a.end (),
- std::ostream_iterator<s_sequence::value_type> (ostream,
- "\n"));
+ // JWH2 - I changed value_type to const_value_type. Is that
+ // the correct approach?
+ std::ostream_iterator<s_sequence::const_value_type> (ostream,
+ "\n"));
FAIL_RETURN_IF (
ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
@@ -217,8 +222,11 @@ int test_const_sequence ()
FAIL_RETURN_IF (a_it != a.begin ());
// test non const dereferencing
- char* value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
+ // I don't think this test makes sense. I believe the compiler
+ // will always return a const value since the dereference is on
+ // the right hand side of the assignment (i.e., r value).
+ //char* value0 = *a_it;
+ //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem0_cstr) != 0);
// test const dereferencing
const char* const value1 = *a_it;
@@ -327,8 +335,10 @@ int test_const_sequence ()
std::ostringstream ostream;
std::copy (a.begin (),
a.end (),
- std::ostream_iterator<s_sequence::value_type> (ostream,
- "\n"));
+ // JWH2 - I changed value_type to const_value_type. Is that
+ // the correct approach?
+ std::ostream_iterator<s_sequence::const_value_type> (ostream,
+ "\n"));
FAIL_RETURN_IF (
ostream.str ().compare ("elem0\nelem1\nelem2\nelem3\n") != 0);
@@ -376,8 +386,11 @@ int test_sequence_reverse ()
FAIL_RETURN_IF (a_it != a.rbegin ());
// test non const dereferencing
- char* value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
+ // I don't think this test makes sense. I believe the compiler
+ // will always return a const value since the dereference is on
+ // the right hand side of the assignment (i.e., r value).
+ //char* value0 = *a_it;
+ //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
// test const dereferencing
const char* const value1 = *a_it;
@@ -486,7 +499,9 @@ int test_sequence_reverse ()
std::ostringstream ostream;
std::copy (a.rbegin (),
a.rend (),
- std::ostream_iterator<s_sequence::value_type> (ostream,
+ // JWH2 - I changed value_type to const_value_type. Is that
+ // the correct approach?
+ std::ostream_iterator<s_sequence::const_value_type> (ostream,
"\n"));
FAIL_RETURN_IF (
@@ -531,8 +546,11 @@ int test_const_sequence_reverse ()
FAIL_RETURN_IF (a_it != a.rbegin ());
// test non const dereferencing
- char* value0 = *a_it;
- FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
+ // I don't think this test makes sense. I believe the compiler
+ // will always return a const value since the dereference is on
+ // the right hand side of the assignment (i.e., r value).
+ //char* value0 = *a_it;
+ //FAIL_RETURN_IF (ACE_OS::strcmp (value0, elem3_cstr) != 0);
// test const dereferencing
const char* const value1 = *a_it;
@@ -641,7 +659,9 @@ int test_const_sequence_reverse ()
std::ostringstream ostream;
std::copy (a.rbegin (),
a.rend (),
- std::ostream_iterator<s_sequence::value_type> (ostream,
+ // JWH2 - I changed value_type to const_value_type. Is that
+ // the correct approach?
+ std::ostream_iterator<s_sequence::const_value_type> (ostream,
"\n"));
FAIL_RETURN_IF (
diff --git a/TAO/tests/Sequence_Iterators/StringSeq.cpp b/TAO/tests/Sequence_Iterators/StringSeq.cpp
index f35158a173b..f7487049e3c 100644
--- a/TAO/tests/Sequence_Iterators/StringSeq.cpp
+++ b/TAO/tests/Sequence_Iterators/StringSeq.cpp
@@ -163,8 +163,6 @@ int test_sequence ()
::CORBA::StringSeq test;
test.length (a.length ());
- // Memory is leaked here from
- // TAO::details::string_traits_base<char>::default_initializer()
std::copy (a.begin (),
a.end (),
test.begin ());
@@ -541,7 +539,7 @@ int test_sequence_reverse ()
// Create a case to test for memory leaks
// in the iterator.
- *a_it = CORBA::string_dup (elem0_cstr);
+ *a_it = CORBA::string_dup (elem3_cstr);
FAIL_RETURN_IF (a_it != a.rbegin ());
// test non const dereferencing