diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2017-04-14 16:49:17 +0100 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2017-04-14 16:49:17 +0100 |
commit | 5a8932cb21f63af86dffa419ec5da5f4a5d29d70 (patch) | |
tree | 87a1832eec5ad21f993fe551c511fcf14ad5a125 /test | |
parent | 50759fb279b38c5db7cacf88206188b827f564b2 (diff) | |
download | imv-5a8932cb21f63af86dffa419ec5da5f4a5d29d70.tar.gz |
Refactor loader to new style
Diffstat (limited to 'test')
-rw-r--r-- | test/loader.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/loader.c b/test/loader.c index bbbb8d7..e8791c0 100644 --- a/test/loader.c +++ b/test/loader.c @@ -10,24 +10,25 @@ static void test_jpeg_rotation(void **state) { (void)state; - struct imv_loader ldr; + struct imv_loader *ldr = imv_loader_create(); void *retval; char *error; unsigned int width; - imv_init_loader(&ldr); - imv_loader_load(&ldr, "test/orientation.jpg", NULL, 0); - pthread_join(ldr.bg_thread, &retval); + imv_loader_load(ldr, "test/orientation.jpg", NULL, 0); + pthread_join(ldr->bg_thread, &retval); - error = imv_loader_get_error(&ldr); + error = imv_loader_get_error(ldr); assert_false(error); assert_false(retval == PTHREAD_CANCELED); - assert_false(ldr.out_bmp == NULL); + assert_false(ldr->out_bmp == NULL); - width = FreeImage_GetWidth(ldr.out_bmp); + width = FreeImage_GetWidth(ldr->out_bmp); assert_true(width == 1); + + imv_loader_free(ldr); } int main(void) |