Commit 0d52cb4aea2e0af1b8a4a8557e26c9edf85c96db

Vicent Marti 2013-01-24T00:09:55

opts: Some basic tests

diff --git a/tests-clar/core/opts.c b/tests-clar/core/opts.c
new file mode 100644
index 0000000..6468b35
--- /dev/null
+++ b/tests-clar/core/opts.c
@@ -0,0 +1,18 @@
+#include "clar_libgit2.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);
+}