summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinquize <linquize@yahoo.com.hk>2013-10-01 09:46:56 +0800
committerLinquize <linquize@yahoo.com.hk>2013-10-01 09:56:59 +0800
commit8d741253849c5e377e50490818326adc56be9fce (patch)
tree3492cd23fc41e63b7d4ffe2587a3686431652c3b
parentd52a93fab330dbbe1271c10b527d333261638fe3 (diff)
downloadlibgit2-8d741253849c5e377e50490818326adc56be9fce.tar.gz
Add negative test cases for config header with invalid characters
-rw-r--r--tests-clar/config/read.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests-clar/config/read.c b/tests-clar/config/read.c
index ab068eaa7..abc088d59 100644
--- a/tests-clar/config/read.c
+++ b/tests-clar/config/read.c
@@ -531,6 +531,28 @@ void test_config_read__corrupt_header(void)
git_config_free(cfg);
}
+void test_config_read__corrupt_header2(void)
+{
+ git_config *cfg;
+
+ cl_set_cleanup(&clean_test_config, NULL);
+ cl_git_mkfile("./testconfig", "[unclosed \"bracket\"\n lib = git2\n");
+ cl_git_fail(git_config_open_ondisk(&cfg, "./testconfig"));
+
+ git_config_free(cfg);
+}
+
+void test_config_read__corrupt_header3(void)
+{
+ git_config *cfg;
+
+ cl_set_cleanup(&clean_test_config, NULL);
+ cl_git_mkfile("./testconfig", "[unclosed \"slash\\\"]\n lib = git2\n");
+ cl_git_fail(git_config_open_ondisk(&cfg, "./testconfig"));
+
+ git_config_free(cfg);
+}
+
void test_config_read__override_variable(void)
{
git_config *cfg;