aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-10-23 23:39:59 -0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-10-23 23:39:59 -0200
commitb3eb6d3f1cae3449c8f988fe0985c58d1e22a7f8 (patch)
tree233797632f8cbc593ec4e3554725c51862bc0e38
parent4dc8df302b19d3694fa80c759641389a2336203a (diff)
downloadblogc-b3eb6d3f1cae3449c8f988fe0985c58d1e22a7f8.tar.gz
blogc-b3eb6d3f1cae3449c8f988fe0985c58d1e22a7f8.tar.bz2
blogc-b3eb6d3f1cae3449c8f988fe0985c58d1e22a7f8.zip
error: added missing test for crlf
-rw-r--r--tests/check_error.c13
1 files changed, 13 insertions, 0 deletions
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);
}