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... ";