Search in sources :

Example 1 with SpaceVisitor

use of org.mmtk.policy.Space.SpaceVisitor in project JikesRVM by JikesRVM.

the class Harness method checkSpaces.

private static void checkSpaces() {
    Set<String> expectedSpaces = PlanSpecificConfig.get(plan.getValue()).getExpectedSpaces();
    final Set<String> actualSpaces = new HashSet<String>();
    Space.visitSpaces(new SpaceVisitor() {

        @Override
        public void visit(Space s) {
            actualSpaces.add(s.getName());
        }
    });
    if (!expectedSpaces.equals(actualSpaces)) {
        for (String name : expectedSpaces) {
            if (!actualSpaces.contains(name)) {
                System.err.printf("Expected space %s was not found%n", name);
            }
        }
        for (String name : actualSpaces) {
            if (!expectedSpaces.contains(name)) {
                System.err.printf("Space %s was not expected%n", name);
            }
        }
        throw new AssertionError("Space map does not match expectations");
    }
}
Also used : Space(org.mmtk.policy.Space) SpaceVisitor(org.mmtk.policy.Space.SpaceVisitor) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Space (org.mmtk.policy.Space)1 SpaceVisitor (org.mmtk.policy.Space.SpaceVisitor)1