Add more tests

Signed-off-by: Pradana AUMARS <paumars@courrier.dev>
This commit is contained in:
Pradana AUMARS 2021-07-17 14:14:22 +02:00
parent 638af0080d
commit 99995d7b0f

View File

@ -62,6 +62,8 @@ START_TEST(test_easycsv_print_columns)
easycsv *csv = easycsv_init(SAMPLE1_PATH, EASYCSV_R);
ck_assert_int_eq(easycsv_print_columns(csv), 3);
easycsv_free(csv);
ck_assert_int_eq(easycsv_print_columns(NULL), -1);
}
START_TEST(test_easycsv_print_rows)
@ -69,6 +71,8 @@ START_TEST(test_easycsv_print_rows)
easycsv *csv = easycsv_init(SAMPLE1_PATH, EASYCSV_R);
ck_assert_int_eq(easycsv_print_rows(csv), 4);
easycsv_free(csv);
ck_assert_int_eq(easycsv_print_rows(NULL), -1);
}
START_TEST(test_easycsv_read_value)
@ -100,6 +104,9 @@ START_TEST(test_easycsv_read_value)
ck_assert_str_eq(str, "");
free(str);
str = easycsv_read_value(csv, 0, 0);
ck_assert_ptr_null(str);
str = easycsv_read_value(csv, 4, 1);
ck_assert_ptr_null(str);