Skip to content

Commit 7c8f4ee

Browse files
committed
Fix compat issue
1 parent 3ee9070 commit 7c8f4ee

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

tests/test_asm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from tests.benchmark import benchmark_ASM
88

99

10-
@unittest.skipUnless(platform.win32_edition() is not None, "ASM only support Windows now.")
10+
@unittest.skipUnless(platform.system() == "Windows", "ASM only support Windows now.")
1111
class TestASM(unittest.TestCase):
1212
@classmethod
1313
def setUpClass(cls):

tests/test_unsafe.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ctypes
2+
import platform
23
import struct
34
import sys
45
import 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

Comments
 (0)