]> gitweb.factorcode.org Git - factor.git/blob - basis/alien/prettyprint/prettyprint-tests.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / basis / alien / prettyprint / prettyprint-tests.factor
1 USING: alien.c-types alien.prettyprint alien.syntax
2 io.streams.string see tools.test prettyprint
3 io.encodings.ascii ;
4 IN: alien.prettyprint.tests
5
6 CONSTANT: FOO 10
7
8 FUNCTION: int function_test ( float x, int[4][FOO] y, char* z, ushort *w ) ;
9
10 [ "USING: alien.c-types alien.syntax ;
11 IN: alien.prettyprint.tests
12 FUNCTION: int function_test
13     ( float x, int[4][FOO] y, char* z, ushort* w ) ; inline
14 " ] [
15     [ \ function_test see ] with-string-writer
16 ] unit-test
17
18 FUNCTION-ALIAS: function-test int function_test
19     ( float x, int[4][FOO] y, char* z, ushort *w ) ;
20
21 [ "USING: alien.c-types alien.syntax ;
22 IN: alien.prettyprint.tests
23 FUNCTION-ALIAS: function-test int function_test
24     ( float x, int[4][FOO] y, char* z, ushort* w ) ; inline
25 " ] [
26     [ \ function-test see ] with-string-writer
27 ] unit-test
28
29 TYPEDEF: c-string[ascii] string-typedef
30 TYPEDEF: char[1][2][3] array-typedef
31
32 [ "USING: alien.c-types alien.syntax ;
33 IN: alien.prettyprint.tests
34 TYPEDEF: c-string[ascii] string-typedef
35 " ] [
36     [ \ string-typedef see ] with-string-writer
37 ] unit-test
38
39 [ "USING: alien.c-types alien.syntax ;
40 IN: alien.prettyprint.tests
41 TYPEDEF: char[1][2][3] array-typedef
42 " ] [
43     [ \ array-typedef see ] with-string-writer
44 ] unit-test
45
46 C-TYPE: opaque-c-type
47
48 [ "USING: alien.syntax ;
49 IN: alien.prettyprint.tests
50 C-TYPE: opaque-c-type
51 " ] [
52     [ \ opaque-c-type see ] with-string-writer
53 ] unit-test
54
55 TYPEDEF: pointer: int pint
56
57 [ "USING: alien.c-types alien.syntax ;
58 IN: alien.prettyprint.tests
59 TYPEDEF: int* pint
60 " ] [
61     [ \ pint see ] with-string-writer
62 ] unit-test
63
64 [ "pointer: int" ] [ pointer: int unparse ] unit-test
65
66 CALLBACK: void callback-test ( int x, float[4] y ) ;
67
68 [ "USING: alien.c-types alien.syntax ;
69 IN: alien.prettyprint.tests
70 CALLBACK: void callback-test ( int x, float[4] y ) ;
71 " ] [
72     [ \ callback-test see ] with-string-writer
73 ] unit-test