[geos-devel] Re: [GEOS] #299: geos::geom::CoordinateArraySequenceFactory unit test failing

GEOS geos-trac at osgeo.org
Tue Oct 4 16:05:41 EDT 2011


#299: geos::geom::CoordinateArraySequenceFactory unit test failing
----------------------------+-----------------------------------------------
 Reporter:  pramsey         |        Owner:  geos-devel@…              
     Type:  defect          |       Status:  new                       
 Priority:  major           |    Milestone:  GEOS Future               
Component:  Unit Tests      |      Version:  svn-trunk                 
 Severity:  Unassigned      |   Resolution:                            
 Keywords:  mac,macosx,osx  |  
----------------------------+-----------------------------------------------

Old description:

> {{{
> ---> group: geos::geom::CoordinateArraySequenceFactory, test: test<1>
>      problem: assertion failed
> }}}
>
> The problem goes away when I comment out lines 55 and 56 of the test.
>
> http://trac.osgeo.org/geos/browser/trunk/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp#L55
>
> Problem seen on OS/X 10.6, i686-apple-darwin10-gcc-4.2.1

New description:

 {{{
 ---> group: geos::geom::CoordinateArraySequenceFactory, test: test<1>
      problem: assertion failed
 }}}

 The problem goes away when I comment out lines 55 and 56 of the test.

 :trac:browser/trunk/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp#L55

 Problem seen on OS/X 10.6, i686-apple-darwin10-gcc-4.2.1

--

Comment(by hobu):

 {{{
 #!rst

 After spending an afternoon on this, I think the problem is related to the
 fact that geos::geom::CoordinateSequenceFactory has virtual methods, and
 the instance is not complete, and the dynamic_cast at
 :trac:`source:/trunk/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp at 3496#L53`
 is not valid.

 From http://www.cplusplus.com/doc/tutorial/typecasting/ in the
 dynamic_cast section

     When dynamic_cast cannot cast a pointer because it is not a complete
 object of the required class -as in the second conversion in the previous
 example- it returns a null pointer to indicate the failure.


 This test fails for me on OSX using both clang and gcc 4.2.1. That it
 fails on two recent compilers makes me think the problem is that the test
 is bad, and that it succeeded before was just luck.

 }}}

-- 
Ticket URL: <http://trac.osgeo.org/geos/ticket/299#comment:25>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list