s3:winbindd: Remove unused set_routing_domain()
[samba.git] / pidl / tests / tdr.pl
blob41a560c842bd8afb3730119d0e7bc4de6d5bf1ad
1 #!/usr/bin/perl
2 # (C) 2007 Jelmer Vernooij <jelmer@samba.org>
3 # Published under the GNU General Public License
4 use strict;
5 use warnings;
7 use Test::More tests => 6;
8 use FindBin qw($RealBin);
9 use lib "$RealBin";
10 use Util;
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->{res}, "NTSTATUS tdr_pull_foo (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct foo *v)
18 return NT_STATUS_OK;
21 ");
22 is($tdr->{res_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->{res}, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
29 switch (level) {
31 return NT_STATUS_OK;
35 ");
36 is($tdr->{res_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->{res}, "static NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
42 switch (level) {
44 return NT_STATUS_OK;
48 ");
49 is($tdr->{res_hdr}, "");