From eda51170f955a073f0c1052f936dd1243650c443 Mon Sep 17 00:00:00 2001 From: jhoffert Date: Fri, 20 Mar 2009 19:58:42 +0000 Subject: Removing extraneous comments --- TAO/tests/Sequence_Iterators/StringSeq.cpp | 12 ----- .../Sequence_Iterators/Unbounded_Objectref.cpp | 54 ++-------------------- TAO/tests/Sequence_Iterators/Unbounded_Value.cpp | 17 +------ 3 files changed, 5 insertions(+), 78 deletions(-) diff --git a/TAO/tests/Sequence_Iterators/StringSeq.cpp b/TAO/tests/Sequence_Iterators/StringSeq.cpp index dee83a07290..63c88554da3 100644 --- a/TAO/tests/Sequence_Iterators/StringSeq.cpp +++ b/TAO/tests/Sequence_Iterators/StringSeq.cpp @@ -470,9 +470,6 @@ int test_const_sequence () ::CORBA::StringSeq test; test.length (a.length ()); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); @@ -630,9 +627,6 @@ int test_sequence_reverse () ::CORBA::StringSeq test; test.length (a.length ()); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); @@ -779,9 +773,6 @@ int test_sequence_reverse_const_iterator () ::CORBA::StringSeq test; test.length (a.length ()); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); @@ -920,9 +911,6 @@ int test_const_sequence_reverse () ::CORBA::StringSeq test; test.length (a.length ()); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); 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; } diff --git a/TAO/tests/Sequence_Iterators/Unbounded_Value.cpp b/TAO/tests/Sequence_Iterators/Unbounded_Value.cpp index 036fa7ce493..0aabf9b81d2 100644 --- a/TAO/tests/Sequence_Iterators/Unbounded_Value.cpp +++ b/TAO/tests/Sequence_Iterators/Unbounded_Value.cpp @@ -151,9 +151,6 @@ int test_sequence () v_sequence test; test.length (4); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); @@ -193,7 +190,6 @@ int test_const_sequence () v_sequence setup; setup.length (4); - int elem0 = 0; int elem1 = 1; int elem2 = 2; @@ -312,9 +308,6 @@ int test_const_sequence () v_sequence test; test.length (4); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); @@ -365,7 +358,6 @@ int test_sequence_reverse () // setup of an example sequence a.length (4); - int elem0 = 0; int elem1 = 1; int elem2 = 2; @@ -476,9 +468,6 @@ int test_sequence_reverse () v_sequence test; test.length (a.length ()); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); @@ -518,7 +507,6 @@ int test_const_sequence_reverse () v_sequence setup; setup.length (4); - int elem0 = 0; int elem1 = 1; int elem2 = 2; @@ -637,9 +625,6 @@ int test_const_sequence_reverse () v_sequence test; test.length (a.length ()); - // Memory is leaked here from - // TAO::details::string_traits_base::default_initializer() - std::copy (a.begin (), a.end (), test.begin ()); @@ -699,4 +684,4 @@ int main(int,char*[]) status += test_const_sequence_reverse (); return status; -} \ No newline at end of file +} -- cgit v1.2.1