diff --git a/test/c/ffi_test.c b/test/c/ffi_test.c index 8235c1b..c689e87 100644 --- a/test/c/ffi_test.c +++ b/test/c/ffi_test.c @@ -26,7 +26,7 @@ CString upcall_test(StringFactory fun) { return fun(); } -static int counter = 0; +int counter = 0; static char* responses[] = { "Hello, world!", "Goodbye friend.", "co'oi prenu" }; diff --git a/test/clj/coffi/ffi_test.clj b/test/clj/coffi/ffi_test.clj index d7be985..15cc4b6 100644 --- a/test/clj/coffi/ffi_test.clj +++ b/test/clj/coffi/ffi_test.clj @@ -44,3 +44,8 @@ {:a \x :x 3.14 :y 42.0}))) + +(t/deftest static-variables-are-mutable + (ffi/freset! (ffi/static-variable "counter" ::mem/int) 1) + (t/is (= ((ffi/cfn "get_string1" [] ::mem/c-string)) + "Goodbye friend.")))