summaryrefslogtreecommitdiff
path: root/tests/libgit2/core/features.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-11-16 23:29:22 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-02-22 22:07:45 -0500
commit3344fddc97bbdea9c1b6ebb6f7fb6dbd70b41dfb (patch)
treefd6368a72944571c51627b40c592e7d58e0036e1 /tests/libgit2/core/features.c
parent91ba089663f5efc3bd4ba14a5099372cf5ce57a6 (diff)
downloadlibgit2-3344fddc97bbdea9c1b6ebb6f7fb6dbd70b41dfb.tar.gz
refactor: `tests` is now `tests/libgit2`
Like we want to separate libgit2 and utility source code, we want to separate libgit2 and utility tests. Start by moving all the tests into libgit2.
Diffstat (limited to 'tests/libgit2/core/features.c')
-rw-r--r--tests/libgit2/core/features.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/libgit2/core/features.c b/tests/libgit2/core/features.c
new file mode 100644
index 000000000..7b28cc0cb
--- /dev/null
+++ b/tests/libgit2/core/features.c
@@ -0,0 +1,35 @@
+#include "clar_libgit2.h"
+
+void test_core_features__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_features();
+
+#ifdef GIT_THREADS
+ cl_assert((caps & GIT_FEATURE_THREADS) != 0);
+#else
+ cl_assert((caps & GIT_FEATURE_THREADS) == 0);
+#endif
+
+#ifdef GIT_HTTPS
+ cl_assert((caps & GIT_FEATURE_HTTPS) != 0);
+#endif
+
+#if defined(GIT_SSH)
+ cl_assert((caps & GIT_FEATURE_SSH) != 0);
+#else
+ cl_assert((caps & GIT_FEATURE_SSH) == 0);
+#endif
+
+#if defined(GIT_USE_NSEC)
+ cl_assert((caps & GIT_FEATURE_NSEC) != 0);
+#else
+ cl_assert((caps & GIT_FEATURE_NSEC) == 0);
+#endif
+}