提交 2ef109c3 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not test NaNs with WKTWriter

上级 a4066c7b
...@@ -14,7 +14,6 @@ import static org.h2.util.geometry.GeometryUtils.X; ...@@ -14,7 +14,6 @@ import static org.h2.util.geometry.GeometryUtils.X;
import static org.h2.util.geometry.GeometryUtils.Y; import static org.h2.util.geometry.GeometryUtils.Y;
import static org.h2.util.geometry.GeometryUtils.Z; import static org.h2.util.geometry.GeometryUtils.Z;
import java.util.Locale;
import java.util.Random; import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
...@@ -145,11 +144,10 @@ public class TestGeometryUtils extends TestBase { ...@@ -145,11 +144,10 @@ public class TestGeometryUtils extends TestBase {
// Test WKB->Geometry conversion // Test WKB->Geometry conversion
Geometry geometryFromH2 = JTSUtils.ewkb2geometry(wkbFromJTS); Geometry geometryFromH2 = JTSUtils.ewkb2geometry(wkbFromJTS);
// JTS has a bug with NaN on non-English locales // JTS has locale-specific bugs with NaNs, also such geometries are not fully valid
Locale l = Locale.getDefault(); if (!wkt.contains("NaN")) {
Locale.setDefault(Locale.ENGLISH);
assertEquals(jtsWkt.replaceAll(" Z", ""), new WKTWriter(numOfDimensions).write(geometryFromH2)); assertEquals(jtsWkt.replaceAll(" Z", ""), new WKTWriter(numOfDimensions).write(geometryFromH2));
Locale.setDefault(l); }
// Test Geometry->WKB conversion // Test Geometry->WKB conversion
assertEquals(wkbFromJTS, JTSUtils.geometry2ewkb(geometryFromJTS)); assertEquals(wkbFromJTS, JTSUtils.geometry2ewkb(geometryFromJTS));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论