Skip to content

Commit

Permalink
update test file
Browse files Browse the repository at this point in the history
  • Loading branch information
gbdngb12 committed Oct 1, 2023
1 parent 96c8b91 commit e7a23a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
File renamed without changes.
19 changes: 19 additions & 0 deletions windows_shared_lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import ctypes

# 라이브러리 로드
csmith_function = ctypes.WinDLL('.\\csmith.dll')

# 함수 프로토타입 정의
csmith_function.gen_csmith.argtypes = (ctypes.c_int, ctypes.POINTER(ctypes.c_char_p))

def make_param(str_list):
c_string_array = (ctypes.c_char_p * len(str_list))()
for i, string in enumerate(str_list):
c_string_array[i] = bytes(string, 'utf-8')
return len(str_list), c_string_array

# 테스트
if __name__ == "__main__":
test_strings = ["csmith", "--max-array-dim","3", "-o", "32132.c"]
ret = csmith_function.gen_csmith(*make_param(test_strings))
print(ret)

0 comments on commit e7a23a9

Please sign in to comment.