diff options
author | Ben Straub <bs@github.com> | 2012-11-29 14:07:50 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-30 13:12:14 -0800 |
commit | 691776213947e59a3928aab09e97a64b65e990ab (patch) | |
tree | bd35b8ff4af040b6350fe83f802d988c954525e9 /tests-clar/config | |
parent | b81aa2f1deb98eb7f9e60ac96696e69a9a49d8f8 (diff) | |
download | libgit2-691776213947e59a3928aab09e97a64b65e990ab.tar.gz |
Deploy git_config_backend version
Diffstat (limited to 'tests-clar/config')
-rw-r--r-- | tests-clar/config/backend.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests-clar/config/backend.c b/tests-clar/config/backend.c new file mode 100644 index 000000000..1cf770263 --- /dev/null +++ b/tests-clar/config/backend.c @@ -0,0 +1,20 @@ +#include "clar_libgit2.h" + +void test_config_backend__checks_version(void) +{ + git_config *cfg; + git_config_backend backend = GIT_CONFIG_BACKEND_INIT; + backend.version = 1024; + const git_error *err; + + cl_git_pass(git_config_new(&cfg)); + cl_git_fail(git_config_add_backend(cfg, &backend, 0, false)); + err = giterr_last(); + cl_assert_equal_i(GITERR_INVALID, err->klass); + + giterr_clear(); + backend.version = 1024; + cl_git_fail(git_config_add_backend(cfg, &backend, 0, false)); + err = giterr_last(); + cl_assert_equal_i(GITERR_INVALID, err->klass); +} |