aboutsummaryrefslogtreecommitdiff
path: root/paludis/selection_TEST.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/selection_TEST.cc')
-rw-r--r--paludis/selection_TEST.cc41
1 files changed, 21 insertions, 20 deletions
diff --git a/paludis/selection_TEST.cc b/paludis/selection_TEST.cc
index 928d2d4da..4d5c82049 100644
--- a/paludis/selection_TEST.cc
+++ b/paludis/selection_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -30,6 +30,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -69,41 +70,41 @@ namespace test_cases
TEST_CHECK(true);
PackageDepSpec d1(parse_user_package_dep_spec("r1c1/r1c1p1", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d1, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d1, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q1->begin(), q1->end()), 1);
PackageDepSpec d2(parse_user_package_dep_spec("r1c1/r1c1p2", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsSorted(generator::Matches(d2, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsSorted(generator::Matches(d2, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q2->begin(), q2->end()), 2);
PackageDepSpec d3(parse_user_package_dep_spec(">=r1c1/r1c1p2-1", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q3(env[selection::AllVersionsSorted(generator::Matches(d3, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q3(env[selection::AllVersionsSorted(generator::Matches(d3, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q3->begin(), q3->end()), 2);
PackageDepSpec d4(parse_user_package_dep_spec(">=r1c1/r1c1p2-2", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q4(env[selection::AllVersionsSorted(generator::Matches(d4, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q4(env[selection::AllVersionsSorted(generator::Matches(d4, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q4->begin()), indirect_iterator(q4->end()), " "),
"r1c1/r1c1p2-2:0::repo1");
TEST_CHECK_EQUAL(std::distance(q4->begin(), q4->end()), 1);
PackageDepSpec d5(parse_user_package_dep_spec(">=r1c1/r1c1p2-3", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(d5, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(d5, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q5->begin(), q5->end()), 0);
PackageDepSpec d6(parse_user_package_dep_spec("<r1c1/r1c1p2-3", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsSorted(generator::Matches(d6, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsSorted(generator::Matches(d6, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q6->begin(), q6->end()), 2);
PackageDepSpec d7(parse_user_package_dep_spec("rac1/rac1pa", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q7(env[selection::AllVersionsSorted(generator::Matches(d7, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q7(env[selection::AllVersionsSorted(generator::Matches(d7, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q7->begin(), q7->end()), 4);
PackageDepSpec d8(parse_user_package_dep_spec("foo/bar", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q8(env[selection::AllVersionsSorted(generator::Matches(d8, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q8(env[selection::AllVersionsSorted(generator::Matches(d8, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q8->begin(), q8->end()), 0);
PackageDepSpec d9(parse_user_package_dep_spec("r1c1/r1c1p1", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsSorted(generator::Matches(d9, { })
+ const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsSorted(generator::Matches(d9, make_null_shared_ptr(), { })
| filter::SupportsAction<InstallAction>())]);
TEST_CHECK_EQUAL(std::distance(q9->begin(), q9->end()), 1);
}
@@ -137,19 +138,19 @@ namespace test_cases
PackageDepSpec d(parse_user_package_dep_spec("cat/pkg", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q1->begin()), indirect_iterator(q1->end()), " "),
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-2:c::repo1 cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsGroupedBySlot(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsGroupedBySlot(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q2->begin()), indirect_iterator(q2->end()), " "),
"cat/pkg-3:b::repo2 cat/pkg-2:c::repo1 cat/pkg-3:c::repo1 cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q3(env[selection::BestVersionOnly(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q3(env[selection::BestVersionOnly(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q3->begin()), indirect_iterator(q3->end()), " "),
"cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q4(env[selection::BestVersionInEachSlot(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q4(env[selection::BestVersionInEachSlot(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q4->begin()), indirect_iterator(q4->end()), " "),
"cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
@@ -162,31 +163,31 @@ namespace test_cases
PackageDepSpec c(parse_user_package_dep_spec("cat/*", &env, { updso_allow_wildcards }));
- const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q5->begin()), indirect_iterator(q5->end()), " "),
"cat/other-1:a::repo3 cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-2:c::repo1 "
"cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsGroupedBySlot(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsGroupedBySlot(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q6->begin()), indirect_iterator(q6->end()), " "),
"cat/other-1:a::repo3 cat/pkg-3:b::repo2 cat/pkg-2:c::repo1 cat/pkg-3:c::repo1 "
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q7(env[selection::BestVersionOnly(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q7(env[selection::BestVersionOnly(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q7->begin()), indirect_iterator(q7->end()), " "),
"cat/other-1:a::repo3 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q8(env[selection::BestVersionInEachSlot(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q8(env[selection::BestVersionInEachSlot(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q8->begin()), indirect_iterator(q8->end()), " "),
"cat/other-1:a::repo3 cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
PackageDepSpec b(parse_user_package_dep_spec("cat/pkg:a", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsGroupedBySlot(generator::Matches(b, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsGroupedBySlot(generator::Matches(b, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q9->begin()), indirect_iterator(q9->end()), " "),
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-4:a::repo1");
PackageDepSpec a(parse_user_package_dep_spec("cat/pkg[=1|=3]", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q10(env[selection::AllVersionsGroupedBySlot(generator::Matches(a, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q10(env[selection::AllVersionsGroupedBySlot(generator::Matches(a, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q10->begin()), indirect_iterator(q10->end()), " "),
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-3:b::repo2 cat/pkg-3:c::repo1");
}