summaryrefslogtreecommitdiff
path: root/tests/test_resolver_hints.cc
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2010-03-05 19:09:50 -0800
committerDaniel Burrows <dburrows@debian.org>2010-03-05 19:09:50 -0800
commit58b44d3be06d1e2156c93039fc2a80cf4cecb7e1 (patch)
tree5e2c6ed76e8d3260abbd1e668f9f295eb18f6a7a /tests/test_resolver_hints.cc
parent60c099c45c50d44432af03010f6027054de22c2a (diff)
downloadaptitude-58b44d3be06d1e2156c93039fc2a80cf4cecb7e1.tar.gz
Overhaul the resolver to distinguish between tiers and changes to tiers; this is the first step towards being able to minimize the number of changes meeting a criterion.
The biggest change for this is that the new cost objects (tier operations) are not totally ordered, so various places that used to take a maximum now take a least-upper-bound instead; similarly for minimum and greatest-lower-bound. Still to do: find a sound way to allow the resolver to add together costs instead of upper-bounding them: "this change will force us to remove 10 packages". The new code seems to be a little too slow -- probably it lost some optimizations by accident. It does seem to be correct, though.
Diffstat (limited to 'tests/test_resolver_hints.cc')
-rw-r--r--tests/test_resolver_hints.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/test_resolver_hints.cc b/tests/test_resolver_hints.cc
index 2ab82f6a..a1ead827 100644
--- a/tests/test_resolver_hints.cc
+++ b/tests/test_resolver_hints.cc
@@ -32,12 +32,9 @@ namespace
{
typedef aptitude_resolver::hint hint;
- tier make_tier(int first_user_level)
+ tier_operation make_tier_op(int first_user_level)
{
- level l(level::make_lower_bounded(first_user_level));
- return tier(tier_limits::minimum_level,
- &l,
- (&l) + 1);
+ return tier_operation::make_advance_user_level(0, first_user_level);
}
struct test
@@ -85,17 +82,17 @@ namespace
test("reject ?task(desktop) <>4.0", hint::make_reject(pattern::make_task("desktop"),
hint::version_selection::make_version(hint::version_selection::not_equal_to, "4.0"))),
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"),
- make_tier(100))),
+ hint::make_compose_tier_op(pattern::make_exact_name("wesnoth"),
+ hint::version_selection::make_version(hint::version_selection::less_than, "5.0.0"),
+ make_tier_op(100))),
test("increase-tier-to 500 xroach",
- hint::make_increase_tier_to(pattern::make_exact_name("xroach"),
- hint::version_selection::make_inst(),
- make_tier(500))),
+ hint::make_compose_tier_op(pattern::make_exact_name("xroach"),
+ hint::version_selection::make_inst(),
+ make_tier_op(500))),
test("increase-tier-to 800 xroach",
- hint::make_increase_tier_to(pattern::make_exact_name("xroach"),
- hint::version_selection::make_inst(),
- make_tier(800))),
+ hint::make_compose_tier_op(pattern::make_exact_name("xroach"),
+ hint::version_selection::make_inst(),
+ make_tier_op(800))),
};
const int num_resolver_tests =
sizeof(resolver_tests) / sizeof(resolver_tests[0]);