| 1234567891011121314151617181920212223242526272829303132 |
- MODULE test_version ;
- (*
- m2SDL3 smoke test: SDL_GetVersion returns 3.x.y as an int
- version number (major*1000000+minor*1000+micro); the
- SDL3Utils decode helpers must agree with DIV/MOD arithmetic.
- *)
- FROM SDL3Version IMPORT SDL_GetVersion, SDL_GetRevision,
- SDLCompiledMajor, SDLCompiledMinor, SDLCompiledMicro;
- FROM SDL3Utils IMPORT VersionMajor, VersionMinor, VersionMicro;
- FROM libc IMPORT printf;
- VAR v: INTEGER;
- BEGIN
- v := SDL_GetVersion();
- printf("version %d.%d.%d (%d)\n",
- VersionMajor(v), VersionMinor(v), VersionMicro(v), v);
- printf("revision %s\n", SDL_GetRevision());
- IF VersionMajor(v) # 3 THEN
- printf("FAIL test_version: expected major 3\n");
- HALT(1)
- END;
- IF (VersionMajor(v) # SDLCompiledMajor)
- OR (VersionMinor(v) # SDLCompiledMinor)
- OR (VersionMicro(v) # SDLCompiledMicro) THEN
- printf("FAIL test_version: linked != compiled headers\n");
- HALT(1)
- END;
- printf("PASS test_version\n")
- END test_version.
|