From 3b39a0df0aa941c88a872f24279584cd86558b6c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 22 Apr 2007 10:42:33 +0000 Subject: r22453: Fix TDR testsuite without using our. (This used to be commit 2c82aea0d3cb43b6d653fa7d64d490eddef26903) --- source4/pidl/tests/tdr.pl | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'source4/pidl/tests') 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}, ""); -- cgit