1 /*****************************************************************************
2 * This file is part of gfxprim library. *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
19 * Copyright (C) 2009-2014 Cyril Hrubis <metan@ucw.cz> *
21 *****************************************************************************/
27 #include <loaders/GP_Exif.h>
35 static int test_load_Exif(struct testcase
*test
)
37 GP_DataStorage
*data
= GP_DataStorageCreate();
39 int ret
= TST_SUCCESS
;
42 tst_msg("Failed to create DataStorage");
46 io
= GP_IOFile(test
->path
, GP_IO_RDONLY
);
49 tst_msg("Failed to open IO %s", test
->path
);
50 GP_DataStorageDestroy(data
);
54 if (GP_ReadExif(io
, data
)) {
55 tst_msg("Failed to load Exif");
61 GP_DataStorageDestroy(data
);
66 static struct testcase sample001
= {
67 .path
= "sample001.exif",
70 static struct testcase sample002
= {
71 .path
= "sample002.exif",
74 const struct tst_suite tst_suite
= {
77 {.name
= "Exif sample001",
78 .tst_fn
= test_load_Exif
,
79 .res_path
= "data/exif/sample001.exif",
81 .flags
= TST_TMPDIR
| TST_CHECK_MALLOC
},
83 {.name
= "Exif sample002",
84 .tst_fn
= test_load_Exif
,
85 .res_path
= "data/exif/sample002.exif",
87 .flags
= TST_TMPDIR
| TST_CHECK_MALLOC
},