MODULE test_version ; (* m2SDL smoke test: SDL_GetVersion returns 2.x.y and the SDLVersion RECORD mapping reads the same bytes C wrote. *) FROM SDLVersion IMPORT SDLVersion, SDL_GetVersion; FROM libc IMPORT printf; VAR v: SDLVersion; BEGIN v.major := 0; v.minor := 0; v.patch := 0; SDL_GetVersion(v); printf("version %d.%d.%d\n", VAL(INTEGER, v.major), VAL(INTEGER, v.minor), VAL(INTEGER, v.patch)); IF v.major # 2 THEN printf("FAIL test_version: expected major 2\n"); HALT(1) END; printf("PASS test_version\n") END test_version.