]> git.proxmox.com Git - libgit2.git/blob - tests/core/features.c
7b28cc0cb41091c3e68673da0057c5cbae26519f
[libgit2.git] / tests / core / features.c
1 #include "clar_libgit2.h"
2
3 void test_core_features__0(void)
4 {
5 int major, minor, rev, caps;
6
7 git_libgit2_version(&major, &minor, &rev);
8 cl_assert_equal_i(LIBGIT2_VER_MAJOR, major);
9 cl_assert_equal_i(LIBGIT2_VER_MINOR, minor);
10 cl_assert_equal_i(LIBGIT2_VER_REVISION, rev);
11
12 caps = git_libgit2_features();
13
14 #ifdef GIT_THREADS
15 cl_assert((caps & GIT_FEATURE_THREADS) != 0);
16 #else
17 cl_assert((caps & GIT_FEATURE_THREADS) == 0);
18 #endif
19
20 #ifdef GIT_HTTPS
21 cl_assert((caps & GIT_FEATURE_HTTPS) != 0);
22 #endif
23
24 #if defined(GIT_SSH)
25 cl_assert((caps & GIT_FEATURE_SSH) != 0);
26 #else
27 cl_assert((caps & GIT_FEATURE_SSH) == 0);
28 #endif
29
30 #if defined(GIT_USE_NSEC)
31 cl_assert((caps & GIT_FEATURE_NSEC) != 0);
32 #else
33 cl_assert((caps & GIT_FEATURE_NSEC) == 0);
34 #endif
35 }