Add testcase for NP check

This commit is contained in:
Moritz Lipp 2012-03-15 16:38:20 +01:00
parent ce2113bbee
commit 31aa53017a

View file

@ -23,6 +23,12 @@ START_TEST(test_file_get_extension_single) {
fail_unless(strcmp(extension, "pdf") == 0, NULL);
} END_TEST
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
Suite* suite_utils()
{
TCase* tcase = NULL;
@ -40,5 +46,10 @@ Suite* suite_utils()
tcase_add_test(tcase, test_file_get_extension_single);
suite_add_tcase(suite, tcase);
/* file valid extension */
tcase = tcase_create("file_valid_extension");
tcase_add_test(tcase, test_file_valid_extension_null);
suite_add_tcase(suite, tcase);
return suite;
}