From 0c123e4af30c6d2976f4e59babf532b48d05d5cb Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 5 May 2010 04:01:26 +0200 Subject: [PATCH] Bugfix --- src/lib/advice/index.hpp | 2 +- tests/lib/advice/advice-index-test.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/advice/index.hpp b/src/lib/advice/index.hpp index 4f98ea2a1..2f842ae24 100644 --- a/src/lib/advice/index.hpp +++ b/src/lib/advice/index.hpp @@ -139,7 +139,7 @@ namespace advice { friend bool operator== (Entry const& a, POA const& p) { - return a.second != &p; + return a.second == &p; } }; diff --git a/tests/lib/advice/advice-index-test.cpp b/tests/lib/advice/advice-index-test.cpp index dfc1ce73f..3a645ca05 100644 --- a/tests/lib/advice/advice-index-test.cpp +++ b/tests/lib/advice/advice-index-test.cpp @@ -394,11 +394,12 @@ namespace test { CHECK (r_cnt == idx.request_count()); CHECK (_hasDefault (1)); CHECK (_hasDefault (2)); - CHECK (_hasDefault (3)); + CHECK (_hasDefault (6)); CHECK (_hasSolution (3,8)); idx.addProvision (_entry (7,"cat")); idx.addProvision (_entry (9,"cat")); + CHECK (p_cnt+2 == idx.provision_count()); CHECK (idx.hasProvision (_entry (7,"cat"))); CHECK (idx.hasProvision (_entry (9,"cat"))); CHECK (_hasSolution (1,9)); // all cats got the second cat solution @@ -413,14 +414,12 @@ namespace test { CHECK (!idx.hasProvision (_entry (7,"cat"))); CHECK ( idx.hasProvision (_entry (4,"dog"))); - CHECK (p_cnt == idx.provision_count()); - CHECK (r_cnt == idx.request_count()); CHECK (_hasSolution (1,9)); // cats unaffected, because we're changing a shadowed cat solution CHECK (_hasSolution (2,9)); CHECK (_hasSolution (6,9)); CHECK (_hasSolution (3,4)); // but the dog got switched to the transmogrified-into-dog solution, // because it was added later than the existing solution 8 - CHECK (p_cnt == idx.provision_count()); + CHECK (p_cnt+2 == idx.provision_count()); CHECK (r_cnt == idx.request_count()); CHECK (idx.isValid()); }