aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/sdl_image.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/sdl_image.c b/tests/sdl_image.c
index 523f8903..9639ea37 100644
--- a/tests/sdl_image.c
+++ b/tests/sdl_image.c
@@ -4,6 +4,7 @@
#include <assert.h>
#include <emscripten.h>
#include <unistd.h>
+#include <stdlib.h>
int testImage(SDL_Surface* screen, const char* fileName) {
SDL_Surface *image = IMG_Load(fileName);
@@ -18,7 +19,16 @@ int testImage(SDL_Surface* screen, const char* fileName) {
int result = image->w;
SDL_BlitSurface (image, NULL, screen, NULL);
+
+ int w, h;
+ char *data = emscripten_get_preloaded_image_data(fileName, &w, &h);
+
+ assert(data);
+ assert(w == image->w);
+ assert(h == image->h);
+
SDL_FreeSurface (image);
+ free(data);
return result;
}