From 0794691f5a310fa62507460b37dffc86699fd319 Mon Sep 17 00:00:00 2001 From: Pradana Aumars Date: Wed, 2 Jun 2021 12:05:00 +0200 Subject: [PATCH] Update check_file_t to correctly check exception --- tests/check_file_t.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/check_file_t.c b/tests/check_file_t.c index 6ecd970..20d7fa2 100644 --- a/tests/check_file_t.c +++ b/tests/check_file_t.c @@ -4,25 +4,27 @@ START_TEST(test_file_init) { file_t *f; - exception_t *e = NULL; + exception_t *e = exception_init(); f = file_init ("samples/1.txt", FILEPATH_RELATIVE, e); ck_assert_ptr_nonnull (f); - ck_assert_ptr_null (e); + ck_assert (exception_null(e)); file_close (f); + exception_free(e); } END_TEST START_TEST(test_file_md5) { file_t *f; - exception_t *e = NULL; + exception_t *e = exception_init(); f = file_init("samples/1.txt", FILEPATH_RELATIVE, e); file_md5_gen (f, e); - ck_assert_ptr_null (e); + ck_assert (exception_null(e)); file_md5_str (f, e); - ck_assert_ptr_null (e); + ck_assert (exception_null(e)); ck_assert_str_eq (f->hash_str, "492ff087b26577237c576e7ad409064e"); file_close (f); + exception_free(e); } Suite*