summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhoffert <jhoffert@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-03-19 19:06:18 +0000
committerjhoffert <jhoffert@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-03-19 19:06:18 +0000
commit61c868e909e00f16c20d4732fac2037ba1b38835 (patch)
treed807d0750d87834eb5a322c65ff0251251e7f55c
parentead0bffea0ad23fd050cb84935f2ff3104fed59a (diff)
downloadATCD-61c868e909e00f16c20d4732fac2037ba1b38835.tar.gz
Narrowing in on memory problems but they still exist
-rw-r--r--TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp b/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
index 83a43406154..20c83be5273 100644
--- a/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
+++ b/TAO/tests/Sequence_Iterators/Unbounded_Objectref.cpp
@@ -315,6 +315,8 @@ int test_const_sequence ()
// Memory is leaked here from
// TAO::details::string_traits_base<char>::default_initializer()
+ /*
+ * The copy call below causes double deletes and seg faults.
std::copy (a.begin (),
a.end (),
test.begin ());
@@ -328,6 +330,7 @@ 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.
@@ -522,17 +525,20 @@ int test_const_sequence_reverse ()
// setup of an example sequence
/*
- * JWH2 - I don't think _duplicate is needed. Memory leaks show
- * up when it's used.
+ * 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
@@ -643,9 +649,8 @@ int test_const_sequence_reverse ()
tested_sequence test;
test.length (a.length ());
- // Memory is leaked here from
- // TAO::details::string_traits_base<char>::default_initializer()
-
+ /*
+ * The copy call below causes double deletes and seg faults.
std::copy (a.begin (),
a.end (),
test.begin ());
@@ -659,6 +664,7 @@ 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.
@@ -695,7 +701,7 @@ int main(int,char*[])
// 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> ();
+ status += test_const_sequence< tested_sequence::const_iterator> ();
// Test Generic_Sequence_Reverse_Iterator.
status += test_sequence_reverse< tested_sequence::reverse_iterator> ();
@@ -705,8 +711,10 @@ int main(int,char*[])
// 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.
- //status += test_const_sequence_reverse< tested_sequence::const_reverse_iterator> ();
+ // 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> ();
return status;
}