[postgis-tickets] r14593 - Patch from Sebastiaan Couwenberg to fix test_wkb_out_point failure on hppa & mips.

Regina Obe lr at pcorp.us
Tue Jan 12 16:37:25 PST 2016


Author: robe
Date: 2016-01-12 16:37:25 -0800 (Tue, 12 Jan 2016)
New Revision: 14593

Modified:
   trunk/liblwgeom/cunit/cu_out_wkb.c
Log:
Patch from Sebastiaan Couwenberg to fix test_wkb_out_point failure on hppa & mips.
closes #3426

Modified: trunk/liblwgeom/cunit/cu_out_wkb.c
===================================================================
--- trunk/liblwgeom/cunit/cu_out_wkb.c	2016-01-13 00:36:35 UTC (rev 14592)
+++ trunk/liblwgeom/cunit/cu_out_wkb.c	2016-01-13 00:37:25 UTC (rev 14593)
@@ -66,6 +66,13 @@
 }
 
 
+/* parisc and mips (at least some processors) have a different nan representation from other arches. */
+#if !defined(__hppa__) && !defined(__mips__)
+# define nan_val( v1, v2)  v1
+#else
+# define nan_val( v1, v2)  v2
+#endif
+
 static void test_wkb_out_point(void)
 {
 	cu_wkb("POINT(0 0 0 0)");
@@ -75,19 +82,24 @@
 	CU_ASSERT_STRING_EQUAL(s,"0060000001000000043FF00000000000003FF00000000000003FF0000000000000");
 	
 	cu_wkb("POINT EMPTY");
-	CU_ASSERT_STRING_EQUAL(s,"00000000017FF80000000000007FF8000000000000");
+	CU_ASSERT_STRING_EQUAL(s, nan_val("00000000017FF80000000000007FF8000000000000",
+					  "00000000017FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF"));
 
 	cu_wkb("SRID=4326;POINT EMPTY");
-	CU_ASSERT_STRING_EQUAL(s,"0020000001000010E67FF80000000000007FF8000000000000");
+	CU_ASSERT_STRING_EQUAL(s, nan_val("0020000001000010E67FF80000000000007FF8000000000000",
+					  "0020000001000010E67FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF"));
 
 	cu_wkb("POINT Z EMPTY");
-	CU_ASSERT_STRING_EQUAL(s,"00800000017FF80000000000007FF80000000000007FF8000000000000");
+	CU_ASSERT_STRING_EQUAL(s, nan_val("00800000017FF80000000000007FF80000000000007FF8000000000000",
+					  "00800000017FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF"));
 
 	cu_wkb("POINT M EMPTY");
-	CU_ASSERT_STRING_EQUAL(s,"00400000017FF80000000000007FF80000000000007FF8000000000000");
+	CU_ASSERT_STRING_EQUAL(s, nan_val("00400000017FF80000000000007FF80000000000007FF8000000000000",
+					  "00400000017FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF"));
 
 	cu_wkb("POINT ZM EMPTY");
-	CU_ASSERT_STRING_EQUAL(s,"00C00000017FF80000000000007FF80000000000007FF80000000000007FF8000000000000");
+	CU_ASSERT_STRING_EQUAL(s, nan_val("00C00000017FF80000000000007FF80000000000007FF80000000000007FF8000000000000",
+					  "00C00000017FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF"));
 }
 
 static void test_wkb_out_linestring(void)



More information about the postgis-tickets mailing list