[postgis-tickets] [PostGIS] #3426: Patch to fix test_wkb_out_point failure on hppa & mips.

PostGIS trac at osgeo.org
Wed Jan 13 09:19:48 PST 2016


#3426: Patch to fix test_wkb_out_point failure on hppa & mips.
-----------------------+---------------------------
  Reporter:  sebastic  |      Owner:  robe
      Type:  defect    |     Status:  reopened
  Priority:  medium    |  Milestone:  PostGIS 2.2.2
 Component:  postgis   |    Version:  2.2.x
Resolution:            |   Keywords:
-----------------------+---------------------------

Comment (by pramsey):

 Actually, reading up on NaN some more, the problem is actually with the
 tests. The WKB we are generating *should* in fact be portable between the
 systems. The basic problem is that IEE NaN specifies the first portion of
 the number (it's actually an identical pattern to Inf) and then says "for
 the rest of the payload, do something non-zero" (to distinguish it from
 Inf, which specifies a zeroed out payload). And look at our two NaN
 patterns in the test are:
 {{{
 cu_wkb("POINT EMPTY");
 CU_ASSERT_STRING_EQUAL(s, nan_val(
     "00000000017FF80000000000007FF8000000000000",
     "00000000017FF7FFFFFFFFFFFF7FF7FFFFFFFFFFFF"));
 }}}
 Strip out the first 10 chars (which are endian and type) and we get NaN
 of:
 {{{
     7FF800000000000 /* intel */
     7FF7FFFFFFFFFFFF /* mips */
 }}}
 They both have the *same* NaN pattern (7FF), and they both have a non-zero
 payload. So if you ask either system isnan() on those numbers, you'll get
 back true. So they are portable nan values. What they aren't is identical
 at a string level. So our problem is with the tests, not with the code
 underneath.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3426#comment:11>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list