diff --git a/tests/meson.build b/tests/meson.build index 44d57f8..9e752f4 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -7,13 +7,6 @@ if check.found() include_directories += [ include_directories('../zathura') ] - test_sources = [ - 'tests.c', - 'test_document.c', - 'test_session.c', - 'test_utils.c' - ] - document = executable('test_document', ['test_document.c', 'tests.c'], dependencies: build_dependencies + test_dependencies, include_directories: include_directories, @@ -40,4 +33,13 @@ if check.found() test('utils', utils, timeout: 60*60 ) + + types = executable('test_types', ['test_types.c', 'tests.c'], + dependencies: build_dependencies + test_dependencies, + include_directories: include_directories, + c_args: defines + flags + ) + test('types', types, + timeout: 60*60 + ) endif diff --git a/tests/test_types.c b/tests/test_types.c new file mode 100644 index 0000000..0d97db0 --- /dev/null +++ b/tests/test_types.c @@ -0,0 +1,36 @@ +/* See LICENSE file for license and copyright information */ + +#include +#include + +#include "types.h" +#include "tests.h" + +START_TEST(test_image_buffer_fail) { + fail_unless(zathura_image_buffer_create(UINT_MAX, UINT_MAX) == NULL, NULL); +} END_TEST + +START_TEST(test_image_buffer) { + zathura_image_buffer_t* buffer = zathura_image_buffer_create(1, 1); + fail_unless(buffer != NULL, NULL); + zathura_image_buffer_free(buffer); +} END_TEST + +static Suite* suite_types(void) +{ + TCase* tcase = NULL; + Suite* suite = suite_create("Types"); + + /* file valid extension */ + tcase = tcase_create("Image buffer"); + tcase_add_test(tcase, test_image_buffer_fail); + tcase_add_test(tcase, test_image_buffer); + suite_add_tcase(suite, tcase); + + return suite; +} + +int main() +{ + return run_suite(suite_types()); +}