features.c 708 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 20
#endif

#if defined(GIT_SSL) || defined(GIT_WINHTTP)
21
	cl_assert((caps & GIT_FEATURE_HTTPS) != 0);
22
#else
23
	cl_assert((caps & GIT_FEATURE_HTTPS) == 0);
24 25 26
#endif

#if defined(GIT_SSH)
27
	cl_assert((caps & GIT_FEATURE_SSH) != 0);
28
#else
29
	cl_assert((caps & GIT_FEATURE_SSH) == 0);
30 31
#endif
}