From dbd24ffd7573a8d5d62ac80e829370f893632f1d Mon Sep 17 00:00:00 2001 From: tchernobog Date: Thu, 20 Jul 2006 08:27:56 +0000 Subject: [PATCH] - Fix compilation of PoliciesGatekeeper, making sure we don't invalidate iterators - Fix test-history wrong index variable that made the program try to poke its nose where it shouldn't git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@783 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/backend/policies_gatekeeper.cc | 5 +++-- src/testsuite/test-history.cc | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/backend/policies_gatekeeper.cc b/src/backend/policies_gatekeeper.cc index 183fe87..87ea037 100644 --- a/src/backend/policies_gatekeeper.cc +++ b/src/backend/policies_gatekeeper.cc @@ -129,8 +129,9 @@ PoliciesGatekeeper::deactivate_policies(PolicyManager* manager) { if(act_it->second == *avail_it) { - act_it->second->deactivate(); - act_it = _active_policies.erase(act_it); + ActiveIterator removable = act_it++; + removable->second->deactivate(); + _active_policies.erase(removable); } else act_it++; diff --git a/src/testsuite/test-history.cc b/src/testsuite/test-history.cc index 408ad7e..971665a 100644 --- a/src/testsuite/test-history.cc +++ b/src/testsuite/test-history.cc @@ -438,7 +438,7 @@ main(int argc, char** argv) h.append_new_environment(environment6); - info << "Added a new environment to the history as a clear-cut copy of the last\n"; + info << "Added a new environment to the history as a clear-cut copy of the last" << endl; h.remove(res1.first); @@ -487,7 +487,7 @@ main(int argc, char** argv) { // NOTE this will of course fail if the subrequests which should not be here // are still in the environment - if(!final_sreq2_match && *subrequests[i] == sreq2) + if(!final_sreq2_match && *subrequests[x] == sreq2) final_sreq2_match = true; else final_bad_match = true; @@ -511,6 +511,8 @@ main(int argc, char** argv) test << "PASS"; else test << "FAIL"; + test << endl; + test << "Checking whether ConcreteHistory throws an exception if we try to use "; test << "a negative index to access an environment... ";