aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-21 19:19:57 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-21 22:01:52 +0100
commit576e0a19ba6bbf718d050f5743d687c3afc67641 (patch)
tree544032f388e6132acd7adb03271bfa488dcda75b
parentdd3736da2c72911ed8e7c3db6b45ae504d234af4 (diff)
downloadpaludis-576e0a19ba6bbf718d050f5743d687c3afc67641.tar.gz
paludis-576e0a19ba6bbf718d050f5743d687c3afc67641.tar.xz
Kill old ctor
-rw-r--r--paludis/dep_list_TEST.cc36
-rw-r--r--paludis/dep_list_TEST.hh7
-rw-r--r--paludis/elike_use_requirement_TEST.cc61
-rw-r--r--paludis/filter_TEST.cc11
-rw-r--r--paludis/fuzzy_finder_TEST.cc31
-rw-r--r--paludis/generator_TEST.cc9
-rw-r--r--paludis/package_database_TEST.cc24
-rw-r--r--paludis/repositories/e/aa_visitor_TEST.cc5
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc83
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer_TEST.cc11
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc6
-rw-r--r--paludis/repositories/e/fix_locked_dependencies_TEST.cc6
-rw-r--r--paludis/repositories/e/source_uri_finder_TEST.cc11
-rw-r--r--paludis/repositories/fake/fake_repository.cc18
-rw-r--r--paludis/repositories/fake/fake_repository.hh4
-rw-r--r--paludis/repositories/fake/fake_repository_TEST.cc8
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_TEST.cc7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc28
-rw-r--r--paludis/repository_name_cache_TEST.cc38
-rw-r--r--paludis/selection_TEST.cc23
-rw-r--r--paludis/user_dep_spec_TEST.cc9
-rw-r--r--python/additional_tests.cc5
-rw-r--r--python/repository.cc21
-rw-r--r--ruby/repository.cc7
24 files changed, 355 insertions, 114 deletions
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 668104a..63337c5 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -1929,7 +1929,9 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(&env,
RepositoryName("installed_repo")));
@@ -1969,7 +1971,9 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(&env,
RepositoryName("installed_repo")));
@@ -2010,7 +2014,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1");
@@ -2037,7 +2043,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
@@ -2065,7 +2073,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
@@ -2095,7 +2105,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
@@ -2146,7 +2158,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
repo->add_version("cat", "two", "2");
@@ -2184,7 +2198,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "zero", "1")->build_dependencies_key()->set_from_string(
"( cat/one cat/two cat/three-live cat/four-cvs cat/five-svn cat/six-darcs )");
@@ -2226,7 +2242,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/three");
std::tr1::shared_ptr<FakePackageID> idcat(repo->add_version("cat", "two", "1"));
diff --git a/paludis/dep_list_TEST.hh b/paludis/dep_list_TEST.hh
index a04ecc5..38cf6a4 100644
--- a/paludis/dep_list_TEST.hh
+++ b/paludis/dep_list_TEST.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 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
@@ -26,6 +26,7 @@
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repository_factory.hh>
@@ -125,7 +126,9 @@ namespace test_cases
DepListTestCaseBase(const std::string & s) :
TestCase(s),
env(),
- repo(new FakeRepository(&env, RepositoryName("repo"))),
+ repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))))),
installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed"))),
#ifdef ENABLE_VIRTUALS_REPOSITORY
virtuals_repo(RepositoryFactory::get_instance()->create(&env, virtuals_repo_keys)),
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index afe9366..a1f1ba9 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/choice.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -54,7 +55,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
@@ -92,7 +96,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
@@ -130,7 +137,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
@@ -174,7 +184,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -274,7 +287,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -346,7 +362,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -474,7 +493,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -501,7 +523,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -532,7 +557,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -558,7 +586,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -686,7 +717,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -814,7 +848,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake"))
+ )));
env.package_database()->add_repository(1, fake);
std::tr1::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index e4afd34..5692985 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.cc
@@ -30,6 +30,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -53,8 +54,14 @@ namespace test_cases
FilterTestCaseBase(const std::string & s, const Filter & f) :
TestCase("filter " + s + " with " + stringify(f)),
filter(f),
- repo1(new FakeRepository(&env, RepositoryName("repo1"))),
- repo2(new FakeRepository(&env, RepositoryName("repo2"))),
+ repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo1"))
+ ))),
+ repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo2"))
+ ))),
inst_repo1(new FakeInstalledRepository(&env, RepositoryName("inst_repo1")))
{
env.package_database()->add_repository(1, repo1);
diff --git a/paludis/fuzzy_finder_TEST.cc b/paludis/fuzzy_finder_TEST.cc
index b376467..fbdb382 100644
--- a/paludis/fuzzy_finder_TEST.cc
+++ b/paludis/fuzzy_finder_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/package_database.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -41,14 +42,20 @@ namespace test_cases
{
TestEnvironment e;
- std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(&e, RepositoryName("r1")));
+ const std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("r1"))
+ )));
r1->add_version("some-cat", "foo", "1");
r1->add_version("other-cat", "foo", "1");
r1->add_version("some-cat", "bar", "1");
r1->add_version("some-cat", "one-two-three", "1");
e.package_database()->add_repository(1, r1);
- std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&e, RepositoryName("r2")));
+ const std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("r2"))
+ )));
e.package_database()->add_repository(2, r2);
FuzzyCandidatesFinder f1(e, std::string("some-cat/one-two-thee"), filter::All());
@@ -81,11 +88,21 @@ namespace test_cases
TestEnvironment e;
PackageDatabase & p(*e.package_database());
- p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(&e, RepositoryName("my-main-repository"))));
- p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(&e, RepositoryName("x-new-repository"))));
- p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(&e, RepositoryName("bar-overlay"))));
- p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(&e, RepositoryName("baz-overlay"))));
- p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(&e, RepositoryName("sunrise"))));
+ p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("my-main-repository"))))));
+ p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("x-new-repository"))))));
+ p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("bar-overlay"))))));
+ p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("baz-overlay"))))));
+ p.add_repository(1, std::tr1::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("sunrise"))))));
FuzzyRepositoriesFinder f1(e, "my-main-respository");
TEST_CHECK_EQUAL(std::distance(f1.begin(), f1.end()), 1);
diff --git a/paludis/generator_TEST.cc b/paludis/generator_TEST.cc
index 6a7f971..b4e1840 100644
--- a/paludis/generator_TEST.cc
+++ b/paludis/generator_TEST.cc
@@ -30,6 +30,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -53,8 +54,12 @@ namespace test_cases
GeneratorTestCaseBase(const std::string & s, const Generator & f) :
TestCase("generator " + s + " with " + stringify(f)),
generator(f),
- repo1(new FakeRepository(&env, RepositoryName("repo1"))),
- repo2(new FakeRepository(&env, RepositoryName("repo2"))),
+ repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo1"))))),
+ repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo2"))))),
inst_repo1(new FakeInstalledRepository(&env, RepositoryName("inst_repo1")))
{
env.package_database()->add_repository(1, repo1);
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index 3126f2e..62eba97 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -29,6 +29,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -51,8 +52,14 @@ namespace test_cases
TestEnvironment e;
PackageDatabase & p(*e.package_database());
- std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(&e, RepositoryName("repo1")));
- std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&e, RepositoryName("repo2")));
+ const std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("repo1"))
+ )));
+ const std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("repo2"))
+ )));
TEST_CHECK_THROWS(p.fetch_repository(RepositoryName("repo1")), NoSuchRepositoryError);
TEST_CHECK_THROWS(p.fetch_repository(RepositoryName("repo2")), NoSuchRepositoryError);
@@ -98,7 +105,10 @@ namespace test_cases
FakeRepository
{
CoolFakeRepository(const Environment * const e, const RepositoryName & rn) :
- FakeRepository(e, rn)
+ FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(e),
+ value_for<n::name>(rn)
+ ))
{
}
@@ -116,7 +126,9 @@ namespace test_cases
TestEnvironment e;
PackageDatabase & p(*e.package_database());
- std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(&e, RepositoryName("repo1")));
+ std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("repo1")))));
r1->add_version(CategoryNamePart("cat-one") + PackageNamePart("pkg-one"), VersionSpec("0", VersionSpecOptions()));
r1->add_version(CategoryNamePart("cat-one") + PackageNamePart("pkg-two"), VersionSpec("0", VersionSpecOptions()));
r1->add_version(CategoryNamePart("cat-two") + PackageNamePart("pkg-two"), VersionSpec("0", VersionSpecOptions()));
@@ -124,7 +136,9 @@ namespace test_cases
p.add_repository(10, r1);
TEST_CHECK(true);
- std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&e, RepositoryName("repo2")));
+ std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("repo2")))));
r2->add_version(CategoryNamePart("cat-three") + PackageNamePart("pkg-three"), VersionSpec("0", VersionSpecOptions()));
r2->add_version(CategoryNamePart("cat-three") + PackageNamePart("pkg-four"), VersionSpec("0", VersionSpecOptions()));
p.add_repository(10, r2);
diff --git a/paludis/repositories/e/aa_visitor_TEST.cc b/paludis/repositories/e/aa_visitor_TEST.cc
index b9b1c87..89df618 100644
--- a/paludis/repositories/e/aa_visitor_TEST.cc
+++ b/paludis/repositories/e/aa_visitor_TEST.cc
@@ -20,6 +20,7 @@
#include "aa_visitor.hh"
#include "dep_parser.hh"
#include <paludis/util/join.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
@@ -41,7 +42,9 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo")))));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index a90e2ee..7e6dfed 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009 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
@@ -25,6 +25,7 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/package_database.hh>
#include <paludis/stringify_formatter.hh>
+#include <paludis/util/make_named_values.hh>
#include <sstream>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -51,7 +52,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -74,7 +78,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -97,7 +104,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -121,7 +131,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -154,7 +167,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -173,7 +189,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -192,7 +211,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -223,7 +245,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -246,7 +271,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -268,7 +296,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -286,7 +317,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -315,7 +349,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -345,7 +382,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -397,7 +437,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -418,7 +461,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -438,7 +484,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
diff --git a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
index 37091ef..9a33fb6 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/package_database.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
@@ -42,7 +43,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
@@ -81,7 +85,10 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 41e4f9a..3f47a3d 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_database.hh>
@@ -50,7 +51,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
diff --git a/paludis/repositories/e/fix_locked_dependencies_TEST.cc b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
index 6f44fb0..ca9a535 100644
--- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc
+++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/stringify_formatter.hh>
#include <paludis/package_database.hh>
#include <test/test_framework.hh>
@@ -43,7 +44,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
diff --git a/paludis/repositories/e/source_uri_finder_TEST.cc b/paludis/repositories/e/source_uri_finder_TEST.cc
index 592a2c3..f02bdde 100644
--- a/paludis/repositories/e/source_uri_finder_TEST.cc
+++ b/paludis/repositories/e/source_uri_finder_TEST.cc
@@ -21,6 +21,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/package_database.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
@@ -38,7 +39,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
SourceURIFinder f(&env, repo.get(), "http://example.com/path/input", "output", "monkey");
@@ -64,7 +68,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(1, repo);
SourceURIFinder f(&env, repo.get(), "mirror://example/path/input", "output", "repo");
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index c2a7276..d412c3a 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -56,24 +56,6 @@ namespace paludis
};
}
-FakeRepository::FakeRepository(const Environment * const env, const RepositoryName & r) :
- PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
- FakeRepositoryBase(env, r, make_named_values<RepositoryCapabilities>(
- value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
- value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
- value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
- value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(this),
- value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
- value_for<n::virtuals_interface>((*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).support_old_style_virtuals() ? this : 0)
- )),
- _imp(PrivateImplementationPattern<FakeRepository>::_imp)
-{
- add_metadata_key(_imp->format_key);
-}
-
FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
FakeRepositoryBase(params.environment(), params.name(), make_named_values<RepositoryCapabilities>(
diff --git a/paludis/repositories/fake/fake_repository.hh b/paludis/repositories/fake/fake_repository.hh
index 0c269cb..40c71d4 100644
--- a/paludis/repositories/fake/fake_repository.hh
+++ b/paludis/repositories/fake/fake_repository.hh
@@ -63,12 +63,10 @@ namespace paludis
///\name Basic operations
///\{
- FakeRepository(const Environment * const, const RepositoryName &);
- ~FakeRepository();
-
///\since 0.26
FakeRepository(const FakeRepositoryParams &);
+ ~FakeRepository();
///\}
diff --git a/paludis/repositories/fake/fake_repository_TEST.cc b/paludis/repositories/fake/fake_repository_TEST.cc
index 5c6d7fe..d896dff 100644
--- a/paludis/repositories/fake/fake_repository_TEST.cc
+++ b/paludis/repositories/fake/fake_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -21,6 +21,7 @@
#include <test/test_framework.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/make_named_values.hh>
using namespace test;
using namespace paludis;
@@ -34,7 +35,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<const FakeRepository> r(new FakeRepository(&env, RepositoryName("fake")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
}
} test_fake_repository;
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_TEST.cc b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
index 41a96bc..75ea28c 100644
--- a/paludis/repositories/unavailable/unavailable_repository_TEST.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 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
@@ -96,7 +96,10 @@ namespace test_cases
"cat-two/pkg-six-1:0::unavailable (in ::bar)"
);
- std::tr1::shared_ptr<FakeRepository> hide_bar(new FakeRepository(&env, RepositoryName("bar")));
+ const std::tr1::shared_ptr<FakeRepository> hide_bar(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("bar"))
+ )));
env.package_database()->add_repository(2, hide_bar);
repo->invalidate();
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index cc6da4e..a618913 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -35,6 +35,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/user_dep_spec.hh>
using namespace test;
@@ -50,7 +51,10 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(&env, RepositoryName("installed")));
TEST_CHECK(repo->virtuals_interface());
@@ -84,8 +88,14 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- std::tr1::shared_ptr<FakeRepository> repo1(new FakeRepository(&env, RepositoryName("repo1")));
- std::tr1::shared_ptr<FakeRepository> repo2(new FakeRepository(&env, RepositoryName("repo2")));
+ const std::tr1::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo1"))
+ )));
+ const std::tr1::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo2"))
+ )));
std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(&env, RepositoryName("installed")));
env.package_database()->add_repository(2, virtuals);
@@ -125,8 +135,14 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- std::tr1::shared_ptr<FakeRepository> repo1(new FakeRepository(&env, RepositoryName("repo1")));
- std::tr1::shared_ptr<FakeRepository> repo2(new FakeRepository(&env, RepositoryName("repo2")));
+ const std::tr1::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo1"))
+ )));
+ const std::tr1::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo2"))
+ )));
env.package_database()->add_repository(2, repo1);
env.package_database()->add_repository(3, repo2);
diff --git a/paludis/repository_name_cache_TEST.cc b/paludis/repository_name_cache_TEST.cc
index 7babc3e..a1a6f5e 100644
--- a/paludis/repository_name_cache_TEST.cc
+++ b/paludis/repository_name_cache_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 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
@@ -24,6 +24,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/package_database.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -40,7 +41,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("/var/empty"), repo.get());
@@ -55,7 +59,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/not_generated"), repo.get());
@@ -72,7 +79,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/not_existing"), repo.get());
@@ -89,7 +99,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/old_format"), repo.get());
@@ -106,7 +119,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/bad_repo"), repo.get());
@@ -123,7 +139,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/good_repo"), repo.get());
@@ -148,7 +167,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ const std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo"))
+ )));
env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/generated"), repo.get());
diff --git a/paludis/selection_TEST.cc b/paludis/selection_TEST.cc
index e39737e..644413e 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 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 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
@@ -29,6 +29,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -48,7 +49,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(&env, RepositoryName("repo1")));
+ std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo1")))));
r1->add_version("r1c1", "r1c1p1", "1");
r1->add_version("r1c1", "r1c1p2", "1");
r1->add_version("r1c1", "r1c1p2", "2");
@@ -57,7 +60,9 @@ namespace test_cases
env.package_database()->add_repository(11, r1);
TEST_CHECK(true);
- std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&env, RepositoryName("repo2")));
+ std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo2")))));
r2->add_version("rac1", "rac1pa", "1");
r2->add_version("rac1", "rac1pa", "3");
env.package_database()->add_repository(10, r2);
@@ -112,7 +117,9 @@ namespace test_cases
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(&env, RepositoryName("repo1")));
+ std::tr1::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo1")))));
r1->add_version("cat", "pkg", "1")->set_slot(SlotName("a"));
r1->add_version("cat", "pkg", "2")->set_slot(SlotName("c"));
r1->add_version("cat", "pkg", "3")->set_slot(SlotName("c"));
@@ -120,7 +127,9 @@ namespace test_cases
env.package_database()->add_repository(10, r1);
TEST_CHECK(true);
- std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&env, RepositoryName("repo2")));
+ std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo2")))));
r2->add_version("cat", "pkg", "1")->set_slot(SlotName("a"));
r2->add_version("cat", "pkg", "3")->set_slot(SlotName("b"));
env.package_database()->add_repository(5, r2);
@@ -144,7 +153,9 @@ namespace test_cases
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");
- std::tr1::shared_ptr<FakeRepository> r3(new FakeRepository(&env, RepositoryName("repo3")));
+ std::tr1::shared_ptr<FakeRepository> r3(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("repo3")))));
r3->add_version("cat", "other", "1")->set_slot(SlotName("a"));
env.package_database()->add_repository(5, r3);
TEST_CHECK(true);
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index 0bb2bdc..5c38683 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -27,6 +27,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/version_requirements.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
@@ -311,7 +312,9 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake")))));
std::tr1::shared_ptr<FakeInstalledRepository> fake_inst(new FakeInstalledRepository(&env, RepositoryName("fake_inst")));
env.package_database()->add_repository(1, fake);
env.package_database()->add_repository(2, fake_inst);
@@ -357,7 +360,9 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(&env, RepositoryName("fake")));
+ std::tr1::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("fake")))));
env.package_database()->add_repository(1, fake);
fake->add_version("cat", "world", "1");
fake->add_version("cat", "moon", "1");
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index b116913..0219d67 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -24,6 +24,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/environment.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/package_database.hh>
@@ -45,7 +46,9 @@ namespace environment
{
void test_env(Environment & e)
{
- std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&e, RepositoryName("fakerepo")));
+ std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(&e),
+ value_for<n::name>(RepositoryName("fakerepo")))));
std::tr1::shared_ptr<PackageID> pid(repo->add_version("cat", "pkg", "1.0"));
e.package_database()->add_repository(0, repo);
diff --git a/python/repository.cc b/python/repository.cc
index 83ef173..d950aa8 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -29,6 +29,7 @@
#include <paludis/environment.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_named_values.hh>
using namespace paludis;
using namespace paludis::python;
@@ -130,6 +131,18 @@ struct RepositoryEInterfaceWrapper
// bp::to_python_converter<I_, repository_interface_to_python<I_> >();
//}
+namespace
+{
+ std::tr1::shared_ptr<FakeRepository>
+ make_fake_repository(const Environment * const env, const RepositoryName & n)
+ {
+ return make_shared_ptr(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(env),
+ value_for<n::name>(n)
+ )));
+ }
+}
+
void expose_repository()
{
/**
@@ -357,8 +370,14 @@ void expose_repository()
(
"FakeRepository",
"Fake repository for use in test cases.",
- bp::init<const Environment * const, const RepositoryName &>("__init__(Environment, RepositoryName)")
+ bp::no_init
)
+
+ .def("__init__",
+ bp::make_constructor(&make_fake_repository),
+ "__init__(Environment, RepositoryName)"
+ )
+
.def("add_category", &FakeRepository::add_category)
.def("add_package", &FakeRepository::add_package)
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 05a886e..30d674f 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -32,6 +32,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/thread.hh>
#include <paludis/util/condition_variable.hh>
+#include <paludis/util/make_named_values.hh>
#include <ruby.h>
#include <list>
#include <tr1/functional>
@@ -664,8 +665,10 @@ namespace
if (2 != argc)
rb_raise(rb_eArgError, "FakeRepository.new expects two arguments, but got %d", argc);
- std::tr1::shared_ptr<Repository> * r = new std::tr1::shared_ptr<Repository>(new
- FakeRepository(value_to_environment(argv[0]).get(), RepositoryName(StringValuePtr(argv[1]))));
+ std::tr1::shared_ptr<Repository> * r = new std::tr1::shared_ptr<Repository>(new FakeRepository(
+ make_named_values<FakeRepositoryParams>(
+ value_for<n::environment>(value_to_environment(argv[0]).get()),
+ value_for<n::name>(RepositoryName(StringValuePtr(argv[1]))))));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<Repository> >::free, r));
rb_obj_call_init(tdata, argc, argv);
return tdata;