forked from glix/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_sizes.py
More file actions
27 lines (20 loc) · 746 Bytes
/
test_sizes.py
File metadata and controls
27 lines (20 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Test specifically-sized containers.
import unittest
from ctypes import *
class SizesTestCase(unittest.TestCase):
def test_8(self):
self.failUnlessEqual(1, sizeof(c_int8))
self.failUnlessEqual(1, sizeof(c_uint8))
def test_16(self):
self.failUnlessEqual(2, sizeof(c_int16))
self.failUnlessEqual(2, sizeof(c_uint16))
def test_32(self):
self.failUnlessEqual(4, sizeof(c_int32))
self.failUnlessEqual(4, sizeof(c_uint32))
def test_64(self):
self.failUnlessEqual(8, sizeof(c_int64))
self.failUnlessEqual(8, sizeof(c_uint64))
def test_size_t(self):
self.failUnlessEqual(sizeof(c_void_p), sizeof(c_size_t))
if __name__ == "__main__":
unittest.main()