summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/tdr.pl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests/tdr.pl')
-rwxr-xr-xsource4/pidl/tests/tdr.pl27
1 files changed, 14 insertions, 13 deletions
diff --git a/source4/pidl/tests/tdr.pl b/source4/pidl/tests/tdr.pl
index 35e54f53fc..d6cd7a03d4 100755
--- a/source4/pidl/tests/tdr.pl
+++ b/source4/pidl/tests/tdr.pl
@@ -8,21 +8,23 @@ use Test::More tests => 6;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
-use Parse::Pidl::Samba4::TDR qw($ret $ret_hdr ParserType);
+use Parse::Pidl::Samba4::TDR qw(ParserType);
-ParserType({TYPE => "STRUCT", NAME => "foo", PROPERTIES => {public => 1}}, "pull");
-is($ret, "NTSTATUS tdr_pull_foo (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct foo *v)
+my $tdr = new Parse::Pidl::Samba4::TDR();
+
+$tdr->ParserType({TYPE => "STRUCT", NAME => "foo", PROPERTIES => {public => 1}}, "pull");
+is($tdr->{ret}, "NTSTATUS tdr_pull_foo (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct foo *v)
{
return NT_STATUS_OK;
}
");
-is($ret_hdr, "NTSTATUS tdr_pull_foo (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct foo *v);\n");
+is($tdr->{ret_hdr}, "NTSTATUS tdr_pull_foo (struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, struct foo *v);\n");
-$ret = ""; $ret_hdr = "";
-ParserType({TYPE => "UNION", NAME => "bar", PROPERTIES => {public => 1}}, "pull");
-is($ret, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
+$tdr = new Parse::Pidl::Samba4::TDR();
+$tdr->ParserType({TYPE => "UNION", NAME => "bar", PROPERTIES => {public => 1}}, "pull");
+is($tdr->{ret}, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
{
switch (level) {
}
@@ -31,12 +33,11 @@ is($ret, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int l
}
");
-is($ret_hdr, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v);\n");
-
-$ret = ""; $ret_hdr = "";
+is($tdr->{ret_hdr}, "NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v);\n");
-ParserType({TYPE => "UNION", NAME => "bar", PROPERTIES => {}}, "pull");
-is($ret, "static NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
+$tdr = new Parse::Pidl::Samba4::TDR();
+$tdr->ParserType({TYPE => "UNION", NAME => "bar", PROPERTIES => {}}, "pull");
+is($tdr->{ret}, "static NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx, int level, union bar *v)
{
switch (level) {
}
@@ -45,4 +46,4 @@ is($ret, "static NTSTATUS tdr_pull_bar(struct tdr_pull *tdr, TALLOC_CTX *mem_ctx
}
");
-is($ret_hdr, "");
+is($tdr->{ret_hdr}, "");