We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d758bb8 commit a7a81cdCopy full SHA for a7a81cd
tests/pixie/tests/test-ffi.pxi
@@ -1,6 +1,7 @@
1
(ns pixie.tests.test-ffi
2
(require pixie.test :as t)
3
- (require pixie.math :as m))
+ (require pixie.math :as m)
4
+ (require pixie.ffi-infer :as i))
5
6
7
@@ -36,6 +37,17 @@
36
37
(t/deftest test-ffi-infer
38
(t/assert= 0.5 (m/asin (m/sin 0.5))))
39
40
+(t/deftest test-cdouble
41
+ (i/with-config {:library "m"
42
+ :cxx-flags ["-lm"]
43
+ :includes ["math.h"]}
44
+ (i/defcfn sinf)
45
+ (i/defcfn asinf)
46
+ (i/defcfn cosf)
47
+ (i/defcfn powf))
48
+ (t/assert= 0.5 (asinf (sinf 0.5)))
49
+ (t/assert= 1.0 (+ (powf (sinf 0.5) 2.0) (powf (cosf 0.5) 2.0))))
50
+
51
52
(t/deftest test-ffi-callbacks
53
(let [MAX 255
0 commit comments