mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-12 06:56:01 +00:00
Add negative test cases for config header with invalid characters
This commit is contained in:
parent
d52a93fab3
commit
8d74125384
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user