Beispiel #1
0
 def testNewReadGetDouble3D(self):
     vgd0ptr = self._newReadBcmk()
     ## print vgd0ptr[0].nl_m, vgd0ptr[0].nl_t
     ## print vgd0ptr[0].a_m_8[0]
     v1 = ct.POINTER(ct.c_double)()
     ni = ct.c_int(0)
     nj = ct.c_int(0)
     nk = ct.c_int(0)
     quiet = ct.c_int(0)
     ok = vgd.c_vgd_get_double_3d(vgd0ptr, 'VTBL', ct.byref(v1), ct.byref(ni), ct.byref(nj), ct.byref(nk), quiet)
     self.assertEqual(ok,vgd.VGD_OK)
     self.assertEqual([int(x*100.) for x in v1[0:9]],
                      [500, 100, 300, 1000, 8000000, 160, 0, 0, 0])
Beispiel #2
0
 def testNewReadGetDouble3D(self):
     vgd0ptr = self._newReadBcmk()
     ## print vgd0ptr[0].nl_m, vgd0ptr[0].nl_t
     ## print vgd0ptr[0].a_m_8[0]
     v1 = ct.POINTER(ct.c_double)()
     ni = ct.c_int(0)
     nj = ct.c_int(0)
     nk = ct.c_int(0)
     quiet = ct.c_int(0)
     ok = vgd.c_vgd_get_double_3d(vgd0ptr, _C_WCHAR2CHAR('VTBL'), ct.byref(v1), ct.byref(ni), ct.byref(nj), ct.byref(nk), quiet)
     self.assertEqual(ok,vgd.VGD_OK)
     self.assertEqual([int(x*100.) for x in v1[0:9]],
                      [500, 100, 300, 1000, 8000000, 160, 0, 0, 0])
Beispiel #3
0
    def testNewFromTable(self):
        vgd0ptr = self._newReadBcmk()
        v1 = ct.POINTER(ct.c_double)()
        ni = ct.c_int(0)
        nj = ct.c_int(0)
        nk = ct.c_int(0)
        quiet = ct.c_int(0)
        ok = vgd.c_vgd_get_double_3d(vgd0ptr, 'VTBL', ct.byref(v1), ct.byref(ni), ct.byref(nj), ct.byref(nk), quiet)

        vgd1ptr = vgd.c_vgd_construct()
        ok = vgd.c_vgd_new_from_table(vgd1ptr, v1, ni, nj, nk)
        self.assertEqual(ok,vgd.VGD_OK)
        ok = vgd.c_vgd_vgdcmp(vgd0ptr,vgd1ptr)
        self.assertEqual(ok,vgd.VGD_OK)
Beispiel #4
0
    def testNewFromTable(self):
        vgd0ptr = self._newReadBcmk()
        v1 = ct.POINTER(ct.c_double)()
        ni = ct.c_int(0)
        nj = ct.c_int(0)
        nk = ct.c_int(0)
        quiet = ct.c_int(0)
        ok = vgd.c_vgd_get_double_3d(vgd0ptr, _C_WCHAR2CHAR('VTBL'), ct.byref(v1), ct.byref(ni), ct.byref(nj), ct.byref(nk), quiet)

        vgd1ptr = vgd.c_vgd_construct()
        ok = vgd.c_vgd_new_from_table(vgd1ptr, v1, ni, nj, nk)
        self.assertEqual(ok,vgd.VGD_OK)
        ok = vgd.c_vgd_vgdcmp(vgd0ptr,vgd1ptr)
        self.assertEqual(ok,vgd.VGD_OK)