test_utils.c 691 Bytes
Newer Older
1
/* SPDX-License-Identifier: Zlib */
2 3 4

#include <check.h>

Moritz Lipp's avatar
Moritz Lipp committed
5
#include "utils.h"
6
#include "tests.h"
7

Moritz Lipp's avatar
Moritz Lipp committed
8 9 10 11 12 13
START_TEST(test_file_valid_extension_null) {
  fail_unless(file_valid_extension(NULL, NULL) == false, NULL);
  fail_unless(file_valid_extension((void*) 0xDEAD, NULL) == false, NULL);
  fail_unless(file_valid_extension(NULL, "pdf") == false, NULL);
} END_TEST

14
static Suite* suite_utils(void)
15 16 17 18
{
  TCase* tcase = NULL;
  Suite* suite = suite_create("Utils");

Moritz Lipp's avatar
Moritz Lipp committed
19 20 21 22 23
  /* file valid extension */
  tcase = tcase_create("file_valid_extension");
  tcase_add_test(tcase, test_file_valid_extension_null);
  suite_add_tcase(suite, tcase);

24 25
  return suite;
}
26 27 28 29 30

int main()
{
  return run_suite(suite_utils());
}