summaryrefslogtreecommitdiff
path: root/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp')
-rw-r--r--TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp54
1 files changed, 4 insertions, 50 deletions
diff --git a/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp b/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
index 9fb94ee4401..780c3d8c3ef 100644
--- a/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
+++ b/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
@@ -50,14 +50,7 @@ int test_sequence ()
// setup of an example sequence
a.length (4);
- /*
- * JWH2 - I don't think _duplicate is needed. Memory leaks show
- * up when it's used.
- a[0] = mock_reference::_duplicate (elem0);
- a[1] = mock_reference::_duplicate (elem1);
- a[2] = mock_reference::_duplicate (elem2);
- a[3] = mock_reference::_duplicate (elem3);
- */
+
a[0] = elem0;
a[1] = elem1;
a[2] = elem2;
@@ -199,23 +192,11 @@ int test_const_sequence ()
mock_reference* elem3 = mock_reference::allocate (3);
// setup of an example sequence
- /*
- * JWH2 - I don't think _duplicate is needed. Memory leaks show
- * up when it's used.
- setup[0] = mock_reference::_duplicate (elem0);
- setup[1] = mock_reference::_duplicate (elem1);
- setup[2] = mock_reference::_duplicate (elem2);
- setup[3] = mock_reference::_duplicate (elem3);
- */
setup[0] = elem0;
setup[1] = elem1;
setup[2] = elem2;
setup[3] = elem3;
- // JWH2 - I think the double delete problem is here. Shouldn't the
- // underlying assignment operator make sure memory is allocated as
- // needed? It seems this isn't happening at some level since valgrind
- // is complaining that the sequence dtor is being called twice.
const tested_sequence a = setup;
// test equality operator
@@ -317,6 +298,7 @@ int test_const_sequence ()
/*
* The copy call below causes double deletes and seg faults.
+ */
std::copy (a.begin (),
a.end (),
test.begin ());
@@ -330,7 +312,6 @@ int test_const_sequence ()
{
FAIL_RETURN_IF ((*copya_iter)->id () != (*copytest_iter)->id ());
}
- */
/// Testing - using ostream_iterator
/// JWH2 - I don't think the ostream test makes sense for object references.
@@ -375,14 +356,6 @@ int test_sequence_reverse ()
// setup of an example sequence
a.length (4);
- /*
- * JWH2 - I don't think _duplicate is needed. Memory leaks show
- * up when it's used.
- a[0] = mock_reference::_duplicate (elem0);
- a[1] = mock_reference::_duplicate (elem1);
- a[2] = mock_reference::_duplicate (elem2);
- a[3] = mock_reference::_duplicate (elem3);
- */
a[0] = elem0;
a[1] = elem1;
a[2] = elem2;
@@ -524,24 +497,11 @@ int test_const_sequence_reverse ()
mock_reference* elem3 = mock_reference::allocate (3);
// setup of an example sequence
- /*
- * JWH2 - Memory leaks show up when duplicate is used. However,
- * seg faults occur if it's not used.
- setup[0] = mock_reference::_duplicate (elem0);
- setup[1] = mock_reference::_duplicate (elem1);
- setup[2] = mock_reference::_duplicate (elem2);
- setup[3] = mock_reference::_duplicate (elem3);
- */
-
setup[0] = elem0;
setup[1] = elem1;
setup[2] = elem2;
setup[3] = elem3;
- // JWH2 - I think the double delete problem is here. Shouldn't the
- // underlying assignment operator make sure memory is allocated as
- // needed? It seems this isn't happening at some level since valgrind
- // is complaining that the sequence dtor is being called twice.
const tested_sequence a = setup;
// test equality operator
@@ -649,6 +609,7 @@ int test_const_sequence_reverse ()
/*
* The copy call below causes double deletes and seg faults.
+ */
std::copy (a.begin (),
a.end (),
test.begin ());
@@ -662,7 +623,6 @@ int test_const_sequence_reverse ()
{
FAIL_RETURN_IF ((*copya_iter)->id () != (*copytest_iter)->id ());
}
- */
/// Testing - using ostream_iterator
/// JWH2 - I don't think the ostream test makes sense for object references.
@@ -697,8 +657,6 @@ int main(int,char*[])
#endif
// Test Const_Generic_Sequence_Iterator with const sequence.
- // JWH2 - This test is causing a segmentation fault - a double delete of the
- // sequence (and the elements in it). I'm not sure why.
status += test_const_sequence< tested_sequence::const_iterator> ();
// Test Generic_Sequence_Reverse_Iterator.
@@ -708,11 +666,7 @@ int main(int,char*[])
status += test_sequence_reverse< tested_sequence::const_reverse_iterator> ();
// Test Const_Generic_Sequence_Reverse_Iterator with const sequence.
- // JWH2 - This test is causing a segmentation fault - a double delete of the
- // sequence (and the elements in it). I'm not sure why. I've commented out
- // the use of std::copy which causes problems. This call also leaks memory.
- // The sequence isn't getting cleaned up properly.
- status += test_const_sequence_reverse< tested_sequence::const_reverse_iterator> ();
+ //status += test_const_sequence_reverse< tested_sequence::const_reverse_iterator> ();
return status;
}