'Tests out the GEOSBase class.'

def test00_base(self):

    class FakeGeom1(GEOSBase, ):
        pass
    c_float_p = ctypes.POINTER(ctypes.c_float)
    class FakeGeom2(GEOSBase, ):
        ptr_type = c_float_p
    fg1 = FakeGeom1()
    fg2 = FakeGeom2()
    fg1.ptr = ctypes.c_void_p()
    fg1.ptr = None
    fg2.ptr = c_float_p(ctypes.c_float(5.23))
    fg2.ptr = None
    for fg in (fg1, fg2):
        self.assertRaises(GEOSException, fg._get_ptr)
    bad_ptrs = (5, ctypes.c_char_p('foobar'))
    for bad_ptr in bad_ptrs:
        self.assertRaises(TypeError, fg1._set_ptr, bad_ptr)
        self.assertRaises(TypeError, fg2._set_ptr, bad_ptr)
