summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2010-05-09 21:06:31 -0700
committerDaniel Burrows <dburrows@debian.org>2010-05-09 21:06:31 -0700
commitceb8e597dbdda022c9724736bd8da98943634846 (patch)
tree0f3abad60eed11d0f07f1b9b2625dfbb5129cd93
parenteceadb89793cfb6b62ec0dfa4b526ab2e90f9be3 (diff)
downloadaptitude-ceb8e597dbdda022c9724736bd8da98943634846.tar.gz
Write up some tests of the behavior of insert() on individual sets in a set union.
-rw-r--r--tests/test_dynamic_set.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/test_dynamic_set.cc b/tests/test_dynamic_set.cc
index 668c89f3..0b0cf1d2 100644
--- a/tests/test_dynamic_set.cc
+++ b/tests/test_dynamic_set.cc
@@ -721,3 +721,42 @@ BOOST_FIXTURE_TEST_CASE(dynamicSetUnionRemoveNotPresentSet, set_union_test)
CHECK_EQUAL_SETS(expected_signals, signals, set_signal<int>);
CHECK_EQUAL_SETS(expected, values, int);
}
+
+BOOST_FIXTURE_TEST_CASE(dynamicSetInsertIntoSubsetWhenEmpty, set_union_test)
+{
+ addSets();
+
+ set1->insert(99);
+ expected.push_back(99);
+ expected_signals.push_back(ins(99));
+
+ FINISH_SET_TEST();
+}
+
+BOOST_FIXTURE_TEST_CASE(dynamicSetInsertIntoSubsetWhenNonEmpty, set_union_test)
+{
+ set1->insert(55);
+
+ addSets();
+ clear();
+
+ set1->insert(66);
+ expected.push_back(55);
+ expected.push_back(66);
+ expected_signals.push_back(ins(66));
+
+ FINISH_SET_TEST();
+}
+
+BOOST_FIXTURE_TEST_CASE(dynamicSetInsertIntoSubsetWhenAlreadyPresent, set_union_test)
+{
+ set1->insert(55);
+
+ addSets();
+ clear();
+
+ set2->insert(55);
+ expected.push_back(55);
+
+ FINISH_SET_TEST();
+}