Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-10 03:17:41 +0400
committerRussell Belfer <rb@github.com>2013-07-10 03:17:41 +0400
commit290e14798598922fbff7189f64f997bad35c4f84 (patch)
treef9f8c043bafd953f01885bf1efd51f5165b77e0f /tests-clar/core
parenta4456929a8890a9ac1441db343c21040665ce253 (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.c31
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
+}