]> git.proxmox.com Git - libgit2.git/blame - tests/config/backend.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / tests / config / backend.c
CommitLineData
69177621 1#include "clar_libgit2.h"
83041c71 2#include "git2/sys/config.h"
69177621
BS
3
4void 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 12 cl_git_pass(git_config_new(&cfg));
eae0bfdc 13 cl_git_fail(git_config_add_backend(cfg, &backend, 0, NULL, false));
ac3d33df
JK
14 err = git_error_last();
15 cl_assert_equal_i(GIT_ERROR_INVALID, err->klass);
69177621 16
ac3d33df 17 git_error_clear();
69177621 18 backend.version = 1024;
eae0bfdc 19 cl_git_fail(git_config_add_backend(cfg, &backend, 0, NULL, false));
ac3d33df
JK
20 err = git_error_last();
21 cl_assert_equal_i(GIT_ERROR_INVALID, err->klass);
b97fabfa 22
23 git_config_free(cfg);
69177621 24}