test_types.c 794 Bytes
Newer Older
1
/* SPDX-License-Identifier: Zlib */
Sebastian Ramacher's avatar
Sebastian Ramacher committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

#include <check.h>
#include <limits.h>

#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());
}