11import ctypes
2+ import platform
23import struct
34import sys
45import unittest
@@ -60,6 +61,7 @@ def test_set_and_get(self):
6061 self .assertEqual (result , 3 )
6162 unsafe .free (ptr )
6263
64+ @unittest .skipUnless (platform .system () == "Windows" , "ASM only support Windows now." )
6365 def test_callVoid (self ):
6466 with ASM () as asm , Unsafe () as unsafe :
6567 voidFunc = asm .makeFunction (self .ks .asm ("ret" , as_bytes = True )[0 ])
@@ -68,6 +70,7 @@ def test_callVoid(self):
6870
6971 asm .freeFunction (voidFunc )
7072
73+ @unittest .skipUnless (platform .system () == "Windows" , "ASM only support Windows now." )
7174 def test_callInt (self ):
7275 with ASM () as asm , Unsafe () as unsafe :
7376 func = asm .makeFunction (self .ks .asm ("mov eax, 123456; ret" , as_bytes = True )[0 ])
@@ -76,6 +79,7 @@ def test_callInt(self):
7679
7780 asm .freeFunction (func )
7881
82+ @unittest .skipUnless (platform .system () == "Windows" , "ASM only support Windows now." )
7983 def test_callLongLong (self ):
8084 with ASM () as asm , Unsafe () as unsafe :
8185 func = asm .makeFunction (self .ks .asm ("mov rax, 12345678910; ret" , as_bytes = True )[0 ])
@@ -84,6 +88,7 @@ def test_callLongLong(self):
8488
8589 asm .freeFunction (func )
8690
91+ @unittest .skipUnless (platform .system () == "Windows" , "ASM only support Windows now." )
8792 def test_callCall (self ):
8893 with ASM () as asm , Unsafe () as unsafe :
8994 func = asm .makeFunction (self .ks .asm ("mov rax, 12345678910; ret" , as_bytes = True )[0 ])
@@ -95,6 +100,7 @@ def test_callCall(self):
95100
96101 asm .freeFunction (func )
97102
103+ @unittest .skipUnless (platform .system () == "Windows" , "ASM only support Windows now." )
98104 def test_call_16bytes (self ):
99105 with ASM () as asm , Unsafe () as unsafe :
100106 funcRet16Bytes = asm .makeFunction (self .ks .asm ("""
@@ -116,6 +122,7 @@ def test_call_16bytes(self):
116122 asm .freeFunction (funcRet16Bytes )
117123 asm .freeFunction (funcProxy )
118124
125+ @unittest .skipUnless (platform .system () == "Windows" , "ASM only support Windows now." )
119126 def test_call_size_zero (self ):
120127 with ASM () as asm , Unsafe () as unsafe :
121128 voidFunc = asm .makeFunction (self .ks .asm ("ret" , as_bytes = True )[0 ])
0 commit comments