aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-05 15:41:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-05 15:41:01 +0000
commitf054305e69d8c194cda6d302ed671c137fea07d0 (patch)
tree4567482f7aaa1271696a830d7fbf8dcd7ce96d9e
parent2789476aefeceaa742130c285be3810913d01423 (diff)
downloadpaludis-f054305e69d8c194cda6d302ed671c137fea07d0.tar.gz
paludis-f054305e69d8c194cda6d302ed671c137fea07d0.tar.xz
Dep list tests on simple blockers
-rw-r--r--paludis/dep_list.cc5
-rw-r--r--paludis/dep_list_TEST.cc101
2 files changed, 105 insertions, 1 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index a2385fa..b1eae23 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -514,7 +514,12 @@ DepList::visit(const AnyDepAtom * const a)
std::back_inserter(viable_children), IsViable(*_implementation)));
if (viable_children.empty())
+ {
+ if (_implementation->current_package)
+ Log::get_instance()->message(ll_qa, "Package '" + stringify(*_implementation->current_package)
+ + "' has suspicious || ( ) block that resolves to empty");
return;
+ }
bool found(false);
for (CompositeDepAtom::Iterator i(viable_children.begin()),
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 15a466b..2261433 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -33,7 +33,8 @@ namespace test_cases
*
* \ingroup Test
*/
- class DepListTestCaseBase : TestCase
+ class DepListTestCaseBase :
+ public TestCase
{
#ifndef DOXYGEN
protected:
@@ -959,6 +960,104 @@ namespace test_cases
} test_dep_list_37;
/**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
+ struct DepListTestCase38 : DepListTestCase<38>
+ {
+ void populate_repo()
+ {
+ repo->add_version("cat", "one", "1")->set(vmk_depend, "!cat/two");
+ repo->add_version("cat", "two", "1");
+ }
+
+ void populate_expected()
+ {
+ merge_target = "cat/one";
+ expected.push_back("cat/one-1:0::repo");
+ }
+ } test_dep_list_38;
+
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
+ struct DepListTestCase39 : DepListTestCase<39>
+ {
+ void populate_repo()
+ {
+ repo->add_version("cat", "one", "1")->set(vmk_depend, "cat/two !cat/two");
+ repo->add_version("cat", "two", "1");
+ }
+
+ void populate_expected()
+ {
+ merge_target="cat/one";
+ }
+
+ void check_lists()
+ {
+ TEST_CHECK(true);
+ DepList d(&env);
+ TEST_CHECK_THROWS(d.add(DepParser::parse(merge_target)), DepListError);
+ TEST_CHECK(d.begin() == d.end());
+ }
+ } test_dep_list_39;
+
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
+ struct DepListTestCase40 : DepListTestCase<40>
+ {
+ void populate_repo()
+ {
+ repo->add_version("cat", "one", "1")->set(vmk_depend, "cat/two cat/three");
+ repo->add_version("cat", "two", "1");
+ repo->add_version("cat", "three", "1")->set(vmk_depend, "!cat/two");
+ }
+
+ void populate_expected()
+ {
+ merge_target="cat/one";
+ }
+
+ void check_lists()
+ {
+ TEST_CHECK(true);
+ DepList d(&env);
+ TEST_CHECK_THROWS(d.add(DepParser::parse(merge_target)), DepListError);
+ TEST_CHECK(d.begin() == d.end());
+ }
+ } test_dep_list_40;
+
+ /**
+ * \test Test DepList resolution behaviour.
+ *
+ * \ingroup Test
+ */
+ struct DepListTestCase41 : DepListTestCase<41>
+ {
+ void populate_repo()
+ {
+ repo->add_version("cat", "one", "1")->set(vmk_depend, "cat/three cat/two");
+ repo->add_version("cat", "two", "1");
+ repo->add_version("cat", "three", "1")->set(vmk_depend, "!cat/two");
+ }
+
+ void populate_expected()
+ {
+ merge_target="cat/one";
+ expected.push_back("cat/three-1:0::repo");
+ expected.push_back("cat/two-1:0::repo");
+ expected.push_back("cat/one-1:0::repo");
+ }
+ } test_dep_list_41;
+
+ /**
* \test Test DepList transactional add behaviour.
*
* \ingroup Test