aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-01-30 23:15:14 +0000
committerHarry Jeffery <harry@exec64.co.uk>2019-01-30 23:15:14 +0000
commitc181e7ee9bf236b24cdf8bf4c413885366e713a3 (patch)
tree6751dbdc622ae18262ba24f6b306401729598b92 /test
parentcfcf77f1ed76c66c9b1e9d4d213651749a6034ec (diff)
downloadimv-c181e7ee9bf236b24cdf8bf4c413885366e713a3.tar.gz
Update tests for new backend approach
Diffstat (limited to 'test')
-rw-r--r--test/loader.c52
-rw-r--r--test/orientation.jpgbin212 -> 0 bytes
2 files changed, 0 insertions, 52 deletions
diff --git a/test/loader.c b/test/loader.c
deleted file mode 100644
index 3456abc..0000000
--- a/test/loader.c
+++ /dev/null
@@ -1,52 +0,0 @@
-#include <stdarg.h>
-#include <stddef.h>
-#include <setjmp.h>
-#include <cmocka.h>
-#include <unistd.h>
-#include <SDL2/SDL.h>
-#include <pthread.h>
-#include "loader.h"
-#include "bitmap.h"
-
-static void test_jpeg_rotation(void **state)
-{
- (void)state;
- struct imv_loader *ldr = imv_loader_create();
-
- assert_false(SDL_Init(SDL_INIT_VIDEO));
- unsigned int NEW_IMAGE = SDL_RegisterEvents(1);
- unsigned int BAD_IMAGE = SDL_RegisterEvents(1);
- imv_loader_set_event_types(ldr, NEW_IMAGE, BAD_IMAGE);
-
- imv_loader_load(ldr, "test/orientation.jpg", NULL, 0);
-
- struct imv_bitmap *bmp = NULL;
- SDL_Event event;
- while(SDL_WaitEvent(&event)) {
- assert_false(event.type == BAD_IMAGE);
-
- if(event.type == NEW_IMAGE) {
- bmp = event.user.data1;
- break;
- }
- }
-
- assert_false(bmp == NULL);
- unsigned int width = bmp->width;
- assert_true(width == 1);
-
- imv_bitmap_free(bmp);
- imv_loader_free(ldr);
-}
-
-int main(void)
-{
- const struct CMUnitTest tests[] = {
- cmocka_unit_test(test_jpeg_rotation),
- };
-
- return cmocka_run_group_tests(tests, NULL, NULL);
-}
-
-
-/* vim:set ts=2 sts=2 sw=2 et: */
diff --git a/test/orientation.jpg b/test/orientation.jpg
deleted file mode 100644
index c74189b..0000000
--- a/test/orientation.jpg
+++ /dev/null
Binary files differ