summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2009-06-09 21:19:58 -0700
committerDaniel Burrows <dburrows@debian.org>2009-06-09 21:19:58 -0700
commitb48cad72b35fda792f8a5060b70f244a97c60149 (patch)
tree82597455cd6d334a275e6b827f4adc1cf54e5558 /tests
parent9c476d57ab7c1bfde3be512321b58e88c3942e66 (diff)
downloadaptitude-b48cad72b35fda792f8a5060b70f244a97c60149.tar.gz
Add more sanity checks to the choice set test.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_choice_set.cc41
1 files changed, 39 insertions, 2 deletions
diff --git a/tests/test_choice_set.cc b/tests/test_choice_set.cc
index 103d034c..320dfa70 100644
--- a/tests/test_choice_set.cc
+++ b/tests/test_choice_set.cc
@@ -260,37 +260,74 @@ public:
choice_set s;
s.insert_or_narrow(c1);
+ CPPUNIT_ASSERT(s.contains(c1));
s.insert_or_narrow(c2);
+ CPPUNIT_ASSERT(s.contains(c1));
+ CPPUNIT_ASSERT(s.contains(c2));
s.insert_or_narrow(c3);
+ CPPUNIT_ASSERT(s.contains(c1));
+ CPPUNIT_ASSERT(s.contains(c2));
+ CPPUNIT_ASSERT(s.contains(c3));
s.insert_or_narrow(c4);
+ CPPUNIT_ASSERT(s.contains(c1));
+ CPPUNIT_ASSERT(s.contains(c2));
+ CPPUNIT_ASSERT(s.contains(c3));
+ CPPUNIT_ASSERT(s.contains(c4));
s.insert_or_narrow(c5);
+ CPPUNIT_ASSERT(s.contains(c1));
+ CPPUNIT_ASSERT(s.contains(c2));
+ CPPUNIT_ASSERT(s.contains(c3));
+ CPPUNIT_ASSERT(s.contains(c4));
+ CPPUNIT_ASSERT(s.contains(c5));
- CPPUNIT_ASSERT(s.contains(c1));
const choice r1(make_install_version_from_dep_source(av1, av2d1));
s.remove_overlaps(r1);
CPPUNIT_ASSERT(!s.contains(r1));
CPPUNIT_ASSERT(!s.contains(c1));
+ CPPUNIT_ASSERT(s.contains(c2));
+ CPPUNIT_ASSERT(s.contains(c3));
+ CPPUNIT_ASSERT(s.contains(c4));
+ CPPUNIT_ASSERT(s.contains(c5));
CPPUNIT_ASSERT(s.contains(c2));
const choice r2(make_install_version(bv1));
s.remove_overlaps(r2);
CPPUNIT_ASSERT(!s.contains(r2));
+ CPPUNIT_ASSERT(!s.contains(c1));
CPPUNIT_ASSERT(!s.contains(c2));
+ CPPUNIT_ASSERT(s.contains(c3));
+ CPPUNIT_ASSERT(s.contains(c4));
+ CPPUNIT_ASSERT(s.contains(c5));
CPPUNIT_ASSERT(s.contains(c3));
const choice r3(make_install_version(cv2));
s.remove_overlaps(r3);
CPPUNIT_ASSERT(!s.contains(r3));
+ CPPUNIT_ASSERT(!s.contains(c1));
+ CPPUNIT_ASSERT(!s.contains(c2));
CPPUNIT_ASSERT(!s.contains(c3));
+ CPPUNIT_ASSERT(s.contains(c4));
+ CPPUNIT_ASSERT(s.contains(c5));
CPPUNIT_ASSERT(s.contains(c4));
const choice r4(make_break_soft_dep(av2d1));
s.remove_overlaps(r4);
+ CPPUNIT_ASSERT(!s.contains(c1));
+ CPPUNIT_ASSERT(!s.contains(c2));
+ CPPUNIT_ASSERT(!s.contains(c3));
CPPUNIT_ASSERT(!s.contains(r4));
CPPUNIT_ASSERT(!s.contains(c4));
-
CPPUNIT_ASSERT(s.contains(c5));
+
+ const choice r5(make_break_soft_dep(bv2d1));
+ s.remove_overlaps(r5);
+ CPPUNIT_ASSERT(!s.contains(c1));
+ CPPUNIT_ASSERT(!s.contains(c2));
+ CPPUNIT_ASSERT(!s.contains(c3));
+ CPPUNIT_ASSERT(!s.contains(c4));
+ CPPUNIT_ASSERT(!s.contains(r5));
+ CPPUNIT_ASSERT(!s.contains(c5));
}
void testContainsChoice()