From b3eb6d3f1cae3449c8f988fe0985c58d1e22a7f8 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Fri, 23 Oct 2015 23:39:59 -0200 Subject: error: added missing test for crlf --- tests/check_error.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/check_error.c b/tests/check_error.c index c7bc3c9..68f287a 100644 --- a/tests/check_error.c +++ b/tests/check_error.c @@ -53,6 +53,18 @@ test_error_parser(void **state) } +static void +test_error_parser_crlf(void **state) +{ + const char *a = "bola\r\nguda\r\nchunda\r\n"; + blogc_error_t *error = blogc_error_parser(1, a, strlen(a), 13, "asd %d", 10); + assert_non_null(error); + assert_int_equal(error->type, 1); + assert_string_equal(error->msg, "asd 10\nError occurred near to 'hunda'"); + blogc_error_free(error); +} + + int main(void) { @@ -60,6 +72,7 @@ main(void) unit_test(test_error_new), unit_test(test_error_new_printf), unit_test(test_error_parser), + unit_test(test_error_parser_crlf), }; return run_tests(tests); } -- cgit v1.2.3-18-g5258