features.c 757 Bytes
Newer Older
1 2
#include "clar_libgit2.h"

3
void test_core_features__0(void)
4 5 6 7 8 9 10 11
{
	int major, minor, rev, caps;

	git_libgit2_version(&major, &minor, &rev);
	cl_assert_equal_i(LIBGIT2_VER_MAJOR, major);
	cl_assert_equal_i(LIBGIT2_VER_MINOR, minor);
	cl_assert_equal_i(LIBGIT2_VER_REVISION, rev);

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 19
#endif

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 31 32 33 34

#if defined(GIT_USE_NSEC)
	cl_assert((caps & GIT_FEATURE_NSEC) != 0);
#else
	cl_assert((caps & GIT_FEATURE_NSEC) == 0);
#endif
35
}