2 # (C) 2007 Jelmer Vernooij <jelmer@samba.org>
3 # Published under the GNU General Public License
7 use Test
::More tests
=> 13;
8 use FindBin
qw($RealBin);
11 use Parse::Pidl::Util qw(MyDumper);
12 use Parse
::Pidl
::Samba4
::EJS
qw(get_pointer_to get_value_of check_null_pointer
13 $res $res_hdr fn_declare);
15 is("&foo", get_pointer_to("foo"));
16 is("&(&foo)", get_pointer_to(get_pointer_to("foo")));
17 is("*foo", get_pointer_to("**foo"));
18 is("foo", get_pointer_to("*foo"));
20 is("foo", get_value_of("&foo"));
21 is("*foo", get_value_of("foo"));
22 is("**foo", get_value_of("*foo"));
25 check_null_pointer("bla");
29 check_null_pointer("*bla");
30 is($res, "if (bla == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;\n");
34 fn_declare({ PROPERTIES => { public => 1 } }, "myproto(int x)");
35 is($res, "_PUBLIC_ myproto(int x)\n");
36 is($res_hdr, "myproto(int x);\n");
40 fn_declare({ PROPERTIES => {} }, "mybla(int foo)");
41 is($res, "static mybla(int foo)\n");