tests: blacklist sqlite3_str and sqlite3_win32 functions
[m6w6/ext-psi] / tests / parser / validate001.phpt
1 --TEST--
2 validate types
3 --SKIPIF--
4 <?php
5 extension_loaded("psi") or die("skip - need ext/psi");
6 ?>
7 --FILE--
8 ===TEST===
9 <?php
10
11 function validate($check, $psi) {
12 if ($check !== psi_validate_string($psi)) {
13 printf("Assertion failed!\nExpected: %s\n\n%s\n\n",
14 $check ? "true" : "false", $psi);
15 }
16 }
17
18 validate(true, "typedef void *bar;");
19 validate(true, "typedef long foo;");
20 validate(true, "typedef struct foo bar;");
21 validate(true, "typedef struct {int a;} foo;");
22 validate(true, "struct a::(8,8); \ntypedef struct a a_t;");
23 validate(true, "typedef struct a a_t; \nstruct a::(8,8);");
24
25 validate(true,
26 <<<PSI
27 enum {
28 A,
29 B,
30 C
31 }
32 PSI
33 );
34
35 validate(true, "typedef int foo(int bar);");
36 validate(true, "typedef int (foo)(int bar);");
37 validate(true, "typedef int (*foo)(int bar);");
38 validate(true, "typedef int *(*foo)(int bar);");
39 validate(true, "typedef int *(*bar)(int baz); \ntypedef int *(*foo)(bar bar);");
40 validate(true, "typedef int bar(int baz); \ntypedef int *(*foo)(bar bar);");
41
42 ?>
43 ===DONE===
44 --EXPECTF--
45 ===TEST===
46 ===DONE===