Skip to content

Commit bf29a86

Browse files
committed
test: check if c_time_t is available
1 parent ef2ab33 commit bf29a86

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

test/scripts/ctypes_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
import unittest
88

9+
try:
10+
from ctypes import c_time_t
11+
except ImportError:
12+
from ctypes import c_long as c_time_t
13+
914
from ctypes import *
1015
from libdebug import debugger
1116
from libdestruct import inflater, struct

test/test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from enum import IntEnum
2+
3+
from ctypes import c_int
4+
from libdestruct import inflater, struct
5+
6+
class provola2(struct):
7+
a: c_int
8+
9+
memory = b"\x01\x00\x00\x00"
10+
11+
libdestruct = inflater(memory)
12+
13+
a = libdestruct.inflate(provola2, 0x0)
14+
15+
print(a.a)

0 commit comments

Comments
 (0)