summaryrefslogtreecommitdiff
path: root/tests/test_resolver_hints.cc
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2010-01-27 09:27:56 -0800
committerDaniel Burrows <dburrows@debian.org>2010-01-27 09:27:56 -0800
commit2e88c6d725918fa12a12de019a5a630a388f9e31 (patch)
tree55864043df145a16fc17e94dcd3fea081f432e37 /tests/test_resolver_hints.cc
parent126c7445eda3076d221377b498c333e334f8edfd (diff)
downloadaptitude-2e88c6d725918fa12a12de019a5a630a388f9e31.tar.gz
Update the unit tests for the new tier object.
Diffstat (limited to 'tests/test_resolver_hints.cc')
-rw-r--r--tests/test_resolver_hints.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/test_resolver_hints.cc b/tests/test_resolver_hints.cc
index d39e678c..46b61c49 100644
--- a/tests/test_resolver_hints.cc
+++ b/tests/test_resolver_hints.cc
@@ -1,6 +1,6 @@
// test_resolver_hints.cc -*-c++-*-
//
-// Copyright (C) 2009 Daniel Burrows
+// Copyright (C) 2009-2010 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -21,6 +21,9 @@
#include <generic/apt/aptitude_resolver.h>
+#include <generic/problemresolver/tier.h>
+#include <generic/problemresolver/tier_limits.h>
+
#include <cppunit/extensions/HelperMacros.h>
using namespace aptitude::matching;
@@ -29,6 +32,13 @@ namespace
{
typedef aptitude_resolver::hint hint;
+ tier make_tier(int first_user_level)
+ {
+ return tier(tier_limits::minimum_level,
+ &first_user_level,
+ (&first_user_level) + 1);
+ }
+
struct test
{
// A string version of the hint.
@@ -76,15 +86,15 @@ namespace
test("increase-tier-to 100 wesnoth <5.0.0",
hint::make_increase_tier_to(pattern::make_exact_name("wesnoth"),
hint::version_selection::make_version(hint::version_selection::less_than, "5.0.0"),
- aptitude_resolver::tier(100))),
+ make_tier(100))),
test("increase-tier-to 500 xroach",
hint::make_increase_tier_to(pattern::make_exact_name("xroach"),
hint::version_selection::make_inst(),
- aptitude_resolver::tier(500))),
+ make_tier(500))),
test("increase-tier-to 800 xroach",
hint::make_increase_tier_to(pattern::make_exact_name("xroach"),
hint::version_selection::make_inst(),
- aptitude_resolver::tier(800))),
+ make_tier(800))),
};
const int num_resolver_tests =
sizeof(resolver_tests) / sizeof(resolver_tests[0]);