]> git.proxmox.com Git - libgit2.git/blob - tests/core/features.c
Merge pull request #3170 from CmdrMoozy/nsec_fix
[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 #if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
21 cl_assert((caps & GIT_FEATURE_HTTPS) != 0);
22 #else
23 cl_assert((caps & GIT_FEATURE_HTTPS) == 0);
24 #endif
25
26 #if defined(GIT_SSH)
27 cl_assert((caps & GIT_FEATURE_SSH) != 0);
28 #else
29 cl_assert((caps & GIT_FEATURE_SSH) == 0);
30 #endif
31
32 #if defined(GIT_USE_NSEC)
33 cl_assert((caps & GIT_FEATURE_NSEC) != 0);
34 #else
35 cl_assert((caps & GIT_FEATURE_NSEC) == 0);
36 #endif
37 }