aboutsummaryrefslogtreecommitdiff
path: root/tests/sdl_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sdl_image.c')
-rw-r--r--tests/sdl_image.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/sdl_image.c b/tests/sdl_image.c
index 9d8c36f2..523f8903 100644
--- a/tests/sdl_image.c
+++ b/tests/sdl_image.c
@@ -3,6 +3,7 @@
#include <SDL/SDL_image.h>
#include <assert.h>
#include <emscripten.h>
+#include <unistd.h>
int testImage(SDL_Surface* screen, const char* fileName) {
SDL_Surface *image = IMG_Load(fileName);
@@ -27,9 +28,12 @@ int main() {
SDL_Surface *screen = SDL_SetVideoMode(600, 450, 32, SDL_SWSURFACE);
int result = 0;
- result = testImage(screen, "screenshot.jpg"); // relative path
+
+ result |= testImage(screen, SCREENSHOT_DIRNAME "/" SCREENSHOT_BASENAME); // absolute path
assert(result != 0);
- result |= testImage(screen, "/screenshot.jpg"); // absolute path
+
+ chdir(SCREENSHOT_DIRNAME);
+ result = testImage(screen, "./" SCREENSHOT_BASENAME); // relative path
assert(result != 0);
SDL_Flip(screen);