test: 全仓同步 w32→win32 模块改名与窄化断言适配

This commit is contained in:
TermiNexus committed 2026-10-12 20:59:31 +08:00
1 parent 384fccd8b8
commit e5e4163167
30 files changed
+148 -147

No files matched your search

+5 -7
View File
@@ -2,7 +2,7 @@ import t
import stdio
import string
import testcheck
import w32.win32memory
import win32.win32memory
def test_strlen():
testcheck.section("Test 1: strlen")
@@ -12,7 +12,7 @@ def test_strlen():
def test_strcpy():
testcheck.section("Test 2: strcpy")
buf: char* = w32.win32memory.VirtualAlloc(None, 64, 12288, 4)
buf: char* = win32.win32memory.VirtualAlloc(None, 64, 12288, 4)
if uint64(buf) == 0:
stdio.printf("SKIP: VirtualAlloc returned NULL\n")
return
@@ -23,7 +23,7 @@ def test_strcpy():
def test_strcat():
testcheck.section("Test 3: strcat (via memcpy)")
buf: char* = w32.win32memory.VirtualAlloc(None, 64, 12288, 4)
buf: char* = win32.win32memory.VirtualAlloc(None, 64, 12288, 4)
if uint64(buf) == 0:
stdio.printf("SKIP: VirtualAlloc returned NULL\n")
return
@@ -45,7 +45,7 @@ def test_strcmp():
def test_strncpy():
testcheck.section("Test 5: strncpy")
buf: char* = w32.win32memory.VirtualAlloc(None, 64, 12288, 4)
buf: char* = win32.win32memory.VirtualAlloc(None, 64, 12288, 4)
if uint64(buf) == 0:
stdio.printf("SKIP: VirtualAlloc returned NULL\n")
return
@@ -62,7 +62,7 @@ def test_char_access():
def test_snprintf():
testcheck.section("Test 7: snprintf")
buf: char* = w32.win32memory.VirtualAlloc(None, 128, 12288, 4)
buf: char* = win32.win32memory.VirtualAlloc(None, 128, 12288, 4)
if uint64(buf) == 0:
stdio.printf("SKIP: VirtualAlloc returned NULL\n")
return
@@ -71,8 +71,6 @@ def test_snprintf():
cmp_result: int = string.strcmp(buf, "value=42 hex=0xff str=test")
testcheck.check(cmp_result == 0, "snprintf (result=value=42 hex=0xff str=test)", "snprintf (result mismatch)")
import w32.win32memory
def main() -> int:
testcheck.begin("StringTest: 字符串操作基准测试")
test_strlen()