Changeset 19172 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/resources/data/defaultpresets.xml
r19169 r19172 196 196 </chunk> 197 197 <chunk id="toilets"> 198 <check key="toilets" />199 <check key="toilets:unisex" />200 <combo key="toilets:wheelchair" values="yes,no,limited" values_context="toilets" />201 <combo key="toilets:access" values="customers,yes,no" />198 <check key="toilets" text="Toilets" /> 199 <check key="toilets:unisex" text="Gender neutral" /> 200 <combo key="toilets:wheelchair" values="yes,no,limited" values_context="toilets" text="Wheelchair accessible" /> 201 <combo key="toilets:access" values="customers,yes,no" text="Access" /> 202 202 </chunk> 203 203 <chunk id="color"> … … 8388 8388 <reference ref="name_oh_wheelchair" /> 8389 8389 <optional> 8390 <combo key="agrarian" values="yes,pesticide,fertilizer,seed,feed,tools,machine_parts,agricultural_machinery" values_context="Tag:shop=agrarian" />8390 <combo key="agrarian" values="yes,pesticide,fertilizer,seed,feed,tools,machine_parts,agricultural_machinery" values_context="Tag:shop=agrarian" text="Products" /> 8391 8391 </optional> 8392 8392 <reference ref="link_contact_address_payment" /> -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r19170 r19172 417 417 } else if (i instanceof CheckGroup) { 418 418 for (Check c : ((CheckGroup) i).checks) { 419 if (!"none".equals(c.match)) 420 minData.add(c); 419 421 addPresetValue(c); 420 422 } … … 422 424 } 423 425 if (!minData.isEmpty()) { 424 presetIndex 426 presetIndex.put(p, minData); 425 427 } 426 428 } … … 855 857 private static boolean primitiveInRegions(IPrimitive primitive, Collection<String> regions, boolean excludeRegions) { 856 858 if (primitive instanceof INode) { 857 return latLonInRegions((INode) primitive, regions) == excludeRegions; 859 // 4 options: 860 // In Region | excluding region | expected 861 // true | false | true 862 // true | true | false 863 // false | false | false 864 // false | true | true 865 return latLonInRegions((INode) primitive, regions) != excludeRegions; 858 866 } else if (primitive instanceof IWay) { 859 867 return ((IWay<?>) primitive).getNodes().stream().anyMatch(n -> primitiveInRegions(n, regions, excludeRegions)); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
r19025 r19172 233 233 @Test 234 234 void testRegionKey() throws IOException { 235 final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=crossing crossing_ref=zebra"));235 final List<TestError> errors = test(OsmUtils.createPrimitive("node payment:ep_avant=yes")); 236 236 assertEquals(1, errors.size()); 237 237 assertEquals("Key from a preset is invalid in this region", errors.get(0).getMessage()); 238 assertEquals("Preset P edestrian Crossing should not have the key crossing_ref", errors.get(0).getDescription());238 assertEquals("Preset Payment Methods should not have the key payment:ep_avant", errors.get(0).getDescription()); 239 239 assertEquals(Severity.WARNING, errors.get(0).getSeverity()); 240 240 assertFalse(errors.get(0).isFixable());
Note:
See TracChangeset
for help on using the changeset viewer.