From d222c5e7ae8b9b422ad551d379636f62e3d2041f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 14 Sep 2007 18:06:51 +0000 Subject: r25166: Simplify can_contain_deferred and add tests for it. (This used to be commit 1afc7dd4d33f05d58121defed88faf8fcee3df8f) --- source4/pidl/tests/ndr.pl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'source4/pidl/tests') diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl index 043d2b9905..6e91ad2a6a 100755 --- a/source4/pidl/tests/ndr.pl +++ b/source4/pidl/tests/ndr.pl @@ -4,12 +4,12 @@ use strict; use warnings; -use Test::More tests => 27; +use Test::More tests => 33; use FindBin qw($RealBin); use lib "$RealBin"; use Util; use Parse::Pidl::Util qw(MyDumper); -use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement align_type mapToScalar ParseType); +use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement align_type mapToScalar ParseType can_contain_deferred); # Case 1 @@ -253,3 +253,16 @@ $t = { } }; is_deeply(ParseType($t->{ORIGINAL}, "ref"), $t); + +ok(not can_contain_deferred("uint32")); +ok(can_contain_deferred("some_unknown_type")); +ok(can_contain_deferred({ TYPE => "STRUCT", + ELEMENTS => [ { TYPE => "uint32", POINTERS => 40 } ]})); +ok(can_contain_deferred({ TYPE => "TYPEDEF", + DATA => { TYPE => "STRUCT", + ELEMENTS => [ { TYPE => "uint32", POINTERS => 40 } ]}})); +ok(not can_contain_deferred({ TYPE => "STRUCT", + ELEMENTS => [ { TYPE => "uint32" } ]})); +ok(not can_contain_deferred({ TYPE => "TYPEDEF", + DATA => { TYPE => "STRUCT", + ELEMENTS => [ { TYPE => "uint32" } ]}})); -- cgit