Exemplo n.º 1
0
    def testWriteUInt(self):
        data = Marshal.AllocHGlobal(CPyMarshal.IntSize)

        CPyMarshal.WriteUInt(data, 0)
        self.assertEquals(Marshal.ReadInt32(data), 0, "wrong")

        CPyMarshal.WriteUInt(data, 0xFFFFFFFF)
        self.assertEquals(Marshal.ReadInt32(data), -1, "wrong")

        Marshal.FreeHGlobal(data)
Exemplo n.º 2
0
 def TestWroteBytes(address):
     for a in range(intCount):
         ptr = OffsetPtr(address, a * CPyMarshal.IntSize)
         data = Marshal.ReadInt32(ptr)
         if data != TEST_NUMBER:
             raise AssertionError("write failed")