]>
Commit | Line | Data |
---|---|---|
69177621 | 1 | #include "clar_libgit2.h" |
83041c71 | 2 | #include "git2/sys/config.h" |
69177621 BS |
3 | |
4 | void test_config_backend__checks_version(void) | |
5 | { | |
6 | git_config *cfg; | |
7 | git_config_backend backend = GIT_CONFIG_BACKEND_INIT; | |
69177621 BS |
8 | const git_error *err; |
9 | ||
bf192cdb VM |
10 | backend.version = 1024; |
11 | ||
69177621 BS |
12 | cl_git_pass(git_config_new(&cfg)); |
13 | cl_git_fail(git_config_add_backend(cfg, &backend, 0, false)); | |
14 | err = giterr_last(); | |
15 | cl_assert_equal_i(GITERR_INVALID, err->klass); | |
16 | ||
17 | giterr_clear(); | |
18 | backend.version = 1024; | |
19 | cl_git_fail(git_config_add_backend(cfg, &backend, 0, false)); | |
20 | err = giterr_last(); | |
21 | cl_assert_equal_i(GITERR_INVALID, err->klass); | |
b97fabfa | 22 | |
23 | git_config_free(cfg); | |
69177621 | 24 | } |