- 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
This commit is contained in:
tchernobog 2006-07-20 08:27:56 +00:00
parent e3d2381212
commit dbd24ffd75
2 changed files with 7 additions and 4 deletions

View File

@ -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++;

View File

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