test_init.mod 648 B

123456789101112131415161718192021222324252627
  1. MODULE test_init ;
  2. (*
  3. m2SDL smoke test: SDL_Init(SDLInitTimer) / SDL_Quit round-trip
  4. plus SDL_WasInit mask check. Exit code 0 = pass, 1 = fail.
  5. *)
  6. FROM SDL2 IMPORT SDL_Init, SDL_Quit, SDL_WasInit, SDLInitTimer;
  7. FROM libc IMPORT printf;
  8. VAR rc: INTEGER; mask: CARDINAL;
  9. BEGIN
  10. rc := SDL_Init(SDLInitTimer);
  11. IF rc # 0 THEN
  12. printf("FAIL test_init: SDL_Init returned %d\n", rc);
  13. HALT(1)
  14. END;
  15. mask := SDL_WasInit(SDLInitTimer);
  16. IF mask = 0 THEN
  17. printf("FAIL test_init: SDL_WasInit mask is 0\n");
  18. SDL_Quit;
  19. HALT(1)
  20. END;
  21. SDL_Quit;
  22. printf("PASS test_init (wasInit=%u)\n", mask)
  23. END test_init.