2 # (C) 2007 Jelmer Vernooij <jelmer@samba.org>
3 # Published under the GNU General Public License
7 use Test
::More tests
=> 6;
8 use FindBin
qw($RealBin);
11 use Parse::Pidl::Samba4::TDR qw(ParserType);
13 my $tdr = new Parse
::Pidl
::Samba4
::TDR
();
15 $tdr->ParserType({TYPE
=> "STRUCT", NAME
=> "foo", PROPERTIES
=> {public
=> 1}}, "pull");
16 is
($tdr->{ret
}, "NTSTATUS tdr_pull_foo (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct foo *v)
22 is
($tdr->{ret_hdr
}, "NTSTATUS tdr_pull_foo (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct foo *v);\n");
25 $tdr = new Parse
::Pidl
::Samba4
::TDR
();
26 $tdr->ParserType({TYPE
=> "UNION", NAME
=> "bar", PROPERTIES
=> {public
=> 1}}, "pull");
27 is
($tdr->{ret
}, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
36 is
($tdr->{ret_hdr
}, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v);\n");
38 $tdr = new Parse
::Pidl
::Samba4
::TDR
();
39 $tdr->ParserType({TYPE
=> "UNION", NAME
=> "bar", PROPERTIES
=> {}}, "pull");
40 is
($tdr->{ret
}, "static NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
49 is
($tdr->{ret_hdr
}, "");