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:
Diffstat (limited to 'tests-clar/core/opts.c')
-rw-r--r--tests-clar/core/opts.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests-clar/core/opts.c b/tests-clar/core/opts.c
new file mode 100644
index 000000000..907339d51
--- /dev/null
+++ b/tests-clar/core/opts.c
@@ -0,0 +1,30 @@
+#include "clar_libgit2.h"
+#include "cache.h"
+
+void test_core_opts__readwrite(void)
+{
+ size_t old_val = 0;
+ size_t new_val = 0;
+
+ git_libgit2_opts(GIT_OPT_GET_MWINDOW_SIZE, &old_val);
+ git_libgit2_opts(GIT_OPT_SET_MWINDOW_SIZE, (size_t)1234);
+ git_libgit2_opts(GIT_OPT_GET_MWINDOW_SIZE, &new_val);
+
+ cl_assert(new_val == 1234);
+
+ git_libgit2_opts(GIT_OPT_SET_MWINDOW_SIZE, old_val);
+ git_libgit2_opts(GIT_OPT_GET_MWINDOW_SIZE, &new_val);
+
+ cl_assert(new_val == old_val);
+
+ git_libgit2_opts(GIT_OPT_GET_ODB_CACHE_SIZE, &old_val);
+
+ cl_assert(old_val == GIT_DEFAULT_CACHE_SIZE);
+
+ git_libgit2_opts(GIT_OPT_SET_ODB_CACHE_SIZE, (size_t)GIT_DEFAULT_CACHE_SIZE*2);
+ git_libgit2_opts(GIT_OPT_GET_ODB_CACHE_SIZE, &new_val);
+
+ cl_assert(new_val == (GIT_DEFAULT_CACHE_SIZE*2));
+
+ git_libgit2_opts(GIT_OPT_GET_ODB_CACHE_SIZE, &old_val);
+}