Skip to content

Commit 81c3733

Browse files
committed
Update tests.
1 parent 15d0097 commit 81c3733

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/TEST_init.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
@TEST_RegisterFunction
44
def TEST_SDL_Init():
5-
assert sdl3.SDL_Init(0), "SDL_Init failed."
6-
assert sdl3.SDL_GetError() == "".encode(), "SDL_GetError failed."
5+
assert sdl3.SDL_Init(0), sdl3.SDL_GetError().decode()
6+
assert (error := sdl3.SDL_GetError()) == "".encode(), error.decode()
77
sdl3.SDL_Quit()
88

99
@TEST_RegisterFunction
1010
def TEST_SDL_CreateWindow():
11-
assert sdl3.SDL_Init(sdl3.SDL_INIT_VIDEO), "SDL_Init failed."
12-
assert (window := sdl3.SDL_CreateWindow("Test".encode(), 1600, 900, sdl3.SDL_WINDOW_RESIZABLE)), "SDL_CreateWindow failed."
13-
assert sdl3.SDL_GetError() == "".encode(), "SDL_GetError failed."
11+
assert sdl3.SDL_Init(sdl3.SDL_INIT_VIDEO), sdl3.SDL_GetError().decode()
12+
assert (window := sdl3.SDL_CreateWindow("Test".encode(), 1600, 900, sdl3.SDL_WINDOW_RESIZABLE)), sdl3.SDL_GetError().decode()
13+
assert (error := sdl3.SDL_GetError()) == "".encode(), error.decode()
1414
sdl3.SDL_DestroyWindow(window)
1515
sdl3.SDL_Quit()

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ def TEST_RunAllTests():
2727
failed += 1
2828

2929
print("\33[35m", f"{successful} tests passed, {failed} tests failed.", "\33[0m", sep = "", flush = True)
30-
assert not failed, "There are some failed tests."
30+
if failed: os._exit(-1)

0 commit comments

Comments
 (0)