summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2010-05-09 20:46:50 -0700
committerDaniel Burrows <dburrows@debian.org>2010-05-09 20:46:50 -0700
commit76b71430c895c61d8a1587102185ed9d2be555a7 (patch)
treeaf44f20107a67eefb342f673491e6e52ff649753 /tests
parentfa7c5d49d23d6f1b9b52c1185362ab8b2610faa0 (diff)
downloadaptitude-76b71430c895c61d8a1587102185ed9d2be555a7.tar.gz
Also verify that inserting a set twice doesn't somehow make it stay alive too long.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dynamic_set.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_dynamic_set.cc b/tests/test_dynamic_set.cc
index 85b5784c..fad066d1 100644
--- a/tests/test_dynamic_set.cc
+++ b/tests/test_dynamic_set.cc
@@ -609,6 +609,8 @@ BOOST_FIXTURE_TEST_CASE(dynamicSetUnionInsertNonEmptySets, set_union_test)
BOOST_FIXTURE_TEST_CASE(dynamicSetUnionInsertSetTwice, set_union_test)
{
+ weak_ptr<dynamic_set<int> > set1_weak(set1);
+
set1->insert(4);
set1->insert(2);
set1->insert(6);
@@ -637,4 +639,8 @@ BOOST_FIXTURE_TEST_CASE(dynamicSetUnionInsertSetTwice, set_union_test)
CHECK_EQUAL_SETS(expected_signals, signals, set_signal<int>);
CHECK_EQUAL_SETS(expected, values, int);
+
+ BOOST_CHECK(!set1_weak.expired());
+ set1.reset();
+ BOOST_CHECK(set1_weak.expired());
}