diff options
Diffstat (limited to 'test/test_save.cpp')
-rw-r--r-- | test/test_save.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/test_save.cpp b/test/test_save.cpp index 96c19c2..eed94b1 100644 --- a/test/test_save.cpp +++ b/test/test_save.cpp @@ -2,6 +2,9 @@ #include <Imlib2.h> +#include "config.h" +#include "test_common.h" + int debug = 0; #define D(...) if (debug) printf(__VA_ARGS__) @@ -9,8 +12,6 @@ int debug = 0; #define EXPECT_OK(x) EXPECT_FALSE(x) #define EXPECT_ERR(x) EXPECT_TRUE(x) -#define TOPDIR SRC_DIR -#define FILE_DIR "test/images" #define FILE_REF1 "icon-64" // RGB #define FILE_REF2 "xeyes" // ARGB (shaped) @@ -58,7 +59,7 @@ test_save(const char *file, int prog) imlib_context_set_progress_granularity(10); } - snprintf(filei, sizeof(filei), "%s/%s/%s.png", TOPDIR, FILE_DIR, file); + snprintf(filei, sizeof(filei), "%s/%s.png", IMG_SRC, file); D("Load '%s'\n", filei); im = imlib_load_image(filei); ASSERT_TRUE(im); @@ -86,7 +87,7 @@ test_save(const char *file, int prog) w = imlib_image_get_width(); h = imlib_image_get_height(); snprintf(fileo, sizeof(fileo), "%s/save-%s-%dx%d.%s", - ".", file, w, h, pfxs[i]); + IMG_GEN, file, w, h, pfxs[i]); D("Save '%s'\n", fileo); imlib_save_image_with_error_return(fileo, &lerr); EXPECT_EQ(lerr, 0); @@ -98,7 +99,7 @@ test_save(const char *file, int prog) w = imlib_image_get_width(); h = imlib_image_get_height(); snprintf(fileo, sizeof(fileo), "%s/save-%s-%dx%d.%s", - ".", file, w, h, pfxs[i]); + IMG_GEN, file, w, h, pfxs[i]); D("Save '%s'\n", fileo); imlib_save_image_with_error_return(fileo, &lerr); EXPECT_EQ(lerr, 0); @@ -110,7 +111,7 @@ test_save(const char *file, int prog) w = imlib_image_get_width(); h = imlib_image_get_height(); snprintf(fileo, sizeof(fileo), "%s/save-%s-%dx%d.%s", - ".", file, w, h, pfxs[i]); + IMG_GEN, file, w, h, pfxs[i]); D("Save '%s'\n", fileo); imlib_save_image_with_error_return(fileo, &lerr); EXPECT_EQ(lerr, 0); @@ -122,7 +123,7 @@ test_save(const char *file, int prog) w = imlib_image_get_width(); h = imlib_image_get_height(); snprintf(fileo, sizeof(fileo), "%s/save-%s-%dx%d.%s", - ".", file, w, h, pfxs[i]); + IMG_GEN, file, w, h, pfxs[i]); D("Save '%s'\n", fileo); imlib_save_image_with_error_return(fileo, &lerr); EXPECT_EQ(lerr, 0); @@ -184,5 +185,7 @@ main(int argc, char **argv) } } + mkdir(IMG_GEN, 0755); + return RUN_ALL_TESTS(); } |