diff options
author | Russell Belfer <rb@github.com> | 2013-07-10 03:17:41 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-07-10 03:17:41 +0400 |
commit | 290e14798598922fbff7189f64f997bad35c4f84 (patch) | |
tree | f9f8c043bafd953f01885bf1efd51f5165b77e0f /tests-clar/core | |
parent | a4456929a8890a9ac1441db343c21040665ce253 (diff) |
Add GIT_CAP_SSH if library was built with SSH
This also adds a test that actually calls git_libgit2_capabilities
and git_libgit2_version.
Diffstat (limited to 'tests-clar/core')
-rw-r--r-- | tests-clar/core/caps.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests-clar/core/caps.c b/tests-clar/core/caps.c new file mode 100644 index 000000000..68a518ed7 --- /dev/null +++ b/tests-clar/core/caps.c @@ -0,0 +1,31 @@ +#include "clar_libgit2.h" + +void test_core_caps__0(void) +{ + 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); + + caps = git_libgit2_capabilities(); + +#ifdef GIT_THREADS + cl_assert((caps & GIT_CAP_THREADS) != 0); +#else + cl_assert((caps & GIT_CAP_THREADS) == 0); +#endif + +#if defined(GIT_SSL) || defined(GIT_WINHTTP) + cl_assert((caps & GIT_CAP_HTTPS) != 0); +#else + cl_assert((caps & GIT_CAP_HTTPS) == 0); +#endif + +#if defined(GIT_SSH) + cl_assert((caps & GIT_CAP_SSH) != 0); +#else + cl_assert((caps & GIT_CAP_SSH) == 0); +#endif +} |