Changeset 14966 in josm for trunk/test


Ignore:
Timestamp:
2019-04-07T07:54:49+02:00 (5 years ago)
Author:
GerdP
Message:

fix #17561 Confusing error message for turn restriction
fix #17567 rephrase warning for role location_hint in restriction relation

  • improve validator messages for restriction relations
  • suppress duplicate warnings for wrong roles from RelationChecker when TurnrestrictionTest is enabled
  • add unit test for TurnrestrictionTest similar to the one for MultipolygonTest
Location:
trunk/test/unit/org/openstreetmap/josm/data/validation/tests
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/ValidatorTestUtils.java

    r12663 r14966  
    3838            for (T t: provider.apply(OsmReader.parseDataSet(is, null))) {
    3939                String name = DefaultNameFormatter.getInstance().format(t);
     40                List<TestError> errors = new ArrayList<>();
     41                for (Test test : tests) {
     42                    test.initialize();
     43                    test.startTest(null);
     44                    test.visit(Collections.singleton(t));
     45                    test.endTest();
     46                    errors.addAll(test.getErrors());
     47                }
    4048                String codes = t.get("josm_error_codes");
    4149                if (codes != null) {
    42                     List<TestError> errors = new ArrayList<>();
    43                     for (Test test : tests) {
    44                         test.initialize();
    45                         test.startTest(null);
    46                         test.visit(Collections.singleton(t));
    47                         test.endTest();
    48                         errors.addAll(test.getErrors());
    49                     }
    5050                    Set<Integer> expectedCodes = new TreeSet<>();
    5151                    if (!"none".equals(codes)) {
     
    6565                } else if (t.hasKey("name") && namePredicate != null && namePredicate.test(t.getName())) {
    6666                    fail(name + " lacks josm_error_codes tag");
     67                } else if (t.hasKey("name") && name.startsWith("OK") && !errors.isEmpty()) {
     68                    fail(name + "has unexpected error(s) ");
    6769                }
    6870            }
Note: See TracChangeset for help on using the changeset viewer.