1 USING: alien alien.data alien.syntax
2 classes.struct kernel sequences specialized-arrays
3 specialized-arrays.private tools.test compiler.units vocabs
5 QUALIFIED-WITH: alien.c-types c
8 { -1 } [ -1 c:char <ref> c:char deref ] unit-test
9 { -1 } [ -1 c:short <ref> c:short deref ] unit-test
10 { -1 } [ -1 c:int <ref> c:int deref ] unit-test
12 ! I don't care if this throws an error or works, but at least
13 ! it should be consistent between platforms
14 { -1 } [ -1.0 c:int <ref> c:int deref ] unit-test
15 { -1 } [ -1.0 c:long <ref> c:long deref ] unit-test
16 { -1 } [ -1.0 c:longlong <ref> c:longlong deref ] unit-test
17 { 1 } [ 1.0 c:uint <ref> c:uint deref ] unit-test
18 { 1 } [ 1.0 c:ulong <ref> c:ulong deref ] unit-test
19 { 1 } [ 1.0 c:ulonglong <ref> c:ulonglong deref ] unit-test
22 0 B{ 1 2 3 4 } <displaced-alien> c:void* <ref>
25 os windows? cpu x86.64? and [
26 [ -2147467259 ] [ 2147500037 c:long <ref> c:long deref ] unit-test
29 STRUCT: foo { a c:int } { b c:void* } { c c:bool } ;
31 SPECIALIZED-ARRAY: foo
33 { t } [ 0 binary-zero? ] unit-test
34 { f } [ 1 binary-zero? ] unit-test
35 { f } [ -1 binary-zero? ] unit-test
36 { t } [ 0.0 binary-zero? ] unit-test
37 { f } [ 1.0 binary-zero? ] unit-test
38 { f } [ -0.0 binary-zero? ] unit-test
39 { t } [ C{ 0.0 0.0 } binary-zero? ] unit-test
40 { f } [ C{ 1.0 0.0 } binary-zero? ] unit-test
41 { f } [ C{ -0.0 0.0 } binary-zero? ] unit-test
42 { f } [ C{ 0.0 1.0 } binary-zero? ] unit-test
43 { f } [ C{ 0.0 -0.0 } binary-zero? ] unit-test
44 { t } [ f binary-zero? ] unit-test
45 { t } [ 0 <alien> binary-zero? ] unit-test
46 { f } [ 1 <alien> binary-zero? ] unit-test
47 { f } [ B{ } binary-zero? ] unit-test
48 { t } [ S{ foo f 0 f f } binary-zero? ] unit-test
49 { f } [ S{ foo f 1 f f } binary-zero? ] unit-test
50 { f } [ S{ foo f 0 ALIEN: 8 f } binary-zero? ] unit-test
51 { f } [ S{ foo f 0 f t } binary-zero? ] unit-test
57 } [ first binary-zero? ] [ second binary-zero? ] [ third binary-zero? ] tri
62 foo specialized-array-vocab forget-vocab
63 ] with-compilation-unit