From c5e4f4c2d29831151bdce1802787b9cf012c3e5e Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 27 Apr 2016 01:30:49 +0200 Subject: Revert "error: removed uneeded tests" This reverts commit 37592b57b31987519e59117d49bccd0207e67f15. --- tests/check_error.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/check_error.c b/tests/check_error.c index c990b45..7fc3c3e 100644 --- a/tests/check_error.c +++ b/tests/check_error.c @@ -19,6 +19,28 @@ #include +static void +test_error_new(void **state) +{ + sb_error_t *error = sb_error_new(1, "bola %s"); + assert_non_null(error); + assert_int_equal(error->code, 1); + assert_string_equal(error->msg, "bola %s"); + sb_error_free(error); +} + + +static void +test_error_new_printf(void **state) +{ + sb_error_t *error = sb_error_new_printf(2, "bola %s", "guda"); + assert_non_null(error); + assert_int_equal(error->code, 2); + assert_string_equal(error->msg, "bola guda"); + sb_error_free(error); +} + + static void test_error_parser(void **state) { @@ -83,6 +105,8 @@ int main(void) { const UnitTest tests[] = { + unit_test(test_error_new), + unit_test(test_error_new_printf), unit_test(test_error_parser), unit_test(test_error_parser_crlf), }; -- cgit v1.2.3-18-g5258