From e22c627ea1e700c30568399cf94df5b88b05f216 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 2 Feb 2008 11:13:03 +0100 Subject: pidl: revert changes it didn't want to push...sorry! 8ebf16c0741085fa769fcc2929f275ab49b1ea5d Works!!!...pidl/Samba4::NDR::Parser: fix support for embedded "ref" pointers 6fcf2456d0e81898b5779ef1650f38b4c5363a80 WORKS!!!...pidl/NDR: fix handling of multilevel pointers in function elements 0569139ca2960ec5478829c3e66f7ff69bdb55cd LOOKS OK... pidl: get the pointer types correct when an element has multiple pointe rs 13afc89a87716063180723f0e9cb4f76daca837e CHECKED... pidl/Samba4::NDR::Parser: correctly get the name of an array element 29c104944bcad30c6a2a3fa70d527bf0ee8969de CHECKED... TODO:MSG pidl/Samba4::NDR::Parser: fix ... 3369015f5d8c425e1a9f9d861471028f03f163bb CHECKED... pidl/Samba4::NDR::Parser: move logic for extra get_pointer_of() into a f unction metze (This used to be commit 0bcc8e53d1470ba9dfe93e5d6925b8f4c20c7c66) --- source4/pidl/tests/ndr.pl | 289 ++-------------------------------------------- 1 file changed, 7 insertions(+), 282 deletions(-) (limited to 'source4/pidl/tests') diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl index 504b7ec8de..7fcc7ef40e 100755 --- a/source4/pidl/tests/ndr.pl +++ b/source4/pidl/tests/ndr.pl @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 46; +use Test::More tests => 40; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -22,7 +22,7 @@ my $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e), [ { 'IS_DEFERRED' => 0, 'LEVEL_INDEX' => 0, @@ -33,7 +33,7 @@ is_deeply(GetElementLevelTable($e, "unique"), [ } ]); -my $ne = ParseElement($e, "unique"); +my $ne = ParseElement($e, undef); is($ne->{ORIGINAL}, $e); is($ne->{NAME}, "v"); is($ne->{ALIGN}, 1); @@ -60,7 +60,7 @@ $e = { 'TYPE' => 'uint8', 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -90,7 +90,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -128,7 +128,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -147,97 +147,6 @@ is_deeply(GetElementLevelTable($e, "unique"), [ } ]); -# Case 3 : ref pointers -# -$e = { - 'FILE' => 'foo.idl', - 'NAME' => 'v', - 'PROPERTIES' => {"ref" => 1}, - 'POINTERS' => 3, - 'TYPE' => 'uint8', - 'PARENT' => { TYPE => 'STRUCT' }, - 'LINE' => 42 }; - -is_deeply(GetElementLevelTable($e, "unique"), [ - { - LEVEL_INDEX => 0, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 0, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 1, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 1, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 2, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 2, - LEVEL => 'EMBEDDED' - }, - { - 'IS_DEFERRED' => 1, - 'LEVEL_INDEX' => 3, - 'DATA_TYPE' => 'uint8', - 'CONTAINS_DEFERRED' => 0, - 'TYPE' => 'DATA', - 'IS_SURROUNDING' => 0, - } -]); - -# Case 3 : ref pointers -# -$e = { - 'FILE' => 'foo.idl', - 'NAME' => 'v', - 'PROPERTIES' => {"ref" => 1}, - 'POINTERS' => 3, - 'TYPE' => 'uint8', - 'PARENT' => { TYPE => 'STRUCT' }, - 'LINE' => 42 }; - -is_deeply(GetElementLevelTable($e, "ref"), [ - { - LEVEL_INDEX => 0, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 0, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 1, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 1, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 2, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 2, - LEVEL => 'EMBEDDED' - }, - { - 'IS_DEFERRED' => 1, - 'LEVEL_INDEX' => 3, - 'DATA_TYPE' => 'uint8', - 'CONTAINS_DEFERRED' => 0, - 'TYPE' => 'DATA', - 'IS_SURROUNDING' => 0, - } -]); # Case 4 : top-level ref pointers # @@ -250,7 +159,7 @@ $e = { 'PARENT' => { TYPE => 'FUNCTION' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -269,190 +178,6 @@ is_deeply(GetElementLevelTable($e, "unique"), [ } ]); -# Case 4 : top-level ref pointers, triple with pointer_default("unique") -# -$e = { - 'FILE' => 'foo.idl', - 'NAME' => 'v', - 'PROPERTIES' => {"ref" => 1}, - 'POINTERS' => 3, - 'TYPE' => 'uint8', - 'PARENT' => { TYPE => 'FUNCTION' }, - 'LINE' => 42 }; - -is_deeply(GetElementLevelTable($e, "unique"), [ - { - LEVEL_INDEX => 0, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 0, - LEVEL => 'TOP' - }, - { - LEVEL_INDEX => 1, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 1, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 2, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 2, - LEVEL => 'EMBEDDED' - }, - { - 'IS_DEFERRED' => 1, - 'LEVEL_INDEX' => 3, - 'DATA_TYPE' => 'uint8', - 'CONTAINS_DEFERRED' => 0, - 'TYPE' => 'DATA', - 'IS_SURROUNDING' => 0, - } -]); - -# Case 4 : top-level unique pointers, triple with pointer_default("unique") -# -$e = { - 'FILE' => 'foo.idl', - 'NAME' => 'v', - 'PROPERTIES' => {"unique" => 1, "in" => 1}, - 'POINTERS' => 3, - 'TYPE' => 'uint8', - 'PARENT' => { TYPE => 'FUNCTION' }, - 'LINE' => 42 }; - -is_deeply(GetElementLevelTable($e, "unique"), [ - { - LEVEL_INDEX => 0, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 0, - LEVEL => 'TOP' - }, - { - LEVEL_INDEX => 1, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 1, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 2, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 2, - LEVEL => 'EMBEDDED' - }, - { - 'IS_DEFERRED' => 1, - 'LEVEL_INDEX' => 3, - 'DATA_TYPE' => 'uint8', - 'CONTAINS_DEFERRED' => 0, - 'TYPE' => 'DATA', - 'IS_SURROUNDING' => 0, - } -]); - -# Case 4 : top-level unique pointers, triple with pointer_default("ref") -# -$e = { - 'FILE' => 'foo.idl', - 'NAME' => 'v', - 'PROPERTIES' => {"unique" => 1, "in" => 1}, - 'POINTERS' => 3, - 'TYPE' => 'uint8', - 'PARENT' => { TYPE => 'FUNCTION' }, - 'LINE' => 42 }; - -is_deeply(GetElementLevelTable($e, "ref"), [ - { - LEVEL_INDEX => 0, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "unique", - POINTER_INDEX => 0, - LEVEL => 'TOP' - }, - { - LEVEL_INDEX => 1, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 1, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 2, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 2, - LEVEL => 'EMBEDDED' - }, - { - 'IS_DEFERRED' => 1, - 'LEVEL_INDEX' => 3, - 'DATA_TYPE' => 'uint8', - 'CONTAINS_DEFERRED' => 0, - 'TYPE' => 'DATA', - 'IS_SURROUNDING' => 0, - } -]); - -# Case 4 : top-level ref pointers, triple with pointer_default("ref") -# -$e = { - 'FILE' => 'foo.idl', - 'NAME' => 'v', - 'PROPERTIES' => {"ref" => 1}, - 'POINTERS' => 3, - 'TYPE' => 'uint8', - 'PARENT' => { TYPE => 'FUNCTION' }, - 'LINE' => 42 }; - -is_deeply(GetElementLevelTable($e, "ref"), [ - { - LEVEL_INDEX => 0, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 0, - LEVEL => 'TOP' - }, - { - LEVEL_INDEX => 1, - IS_DEFERRED => 0, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 1, - LEVEL => 'EMBEDDED' - }, - { - LEVEL_INDEX => 2, - IS_DEFERRED => 1, - TYPE => 'POINTER', - POINTER_TYPE => "ref", - POINTER_INDEX => 2, - LEVEL => 'EMBEDDED' - }, - { - 'IS_DEFERRED' => 1, - 'LEVEL_INDEX' => 3, - 'DATA_TYPE' => 'uint8', - 'CONTAINS_DEFERRED' => 0, - 'TYPE' => 'DATA', - 'IS_SURROUNDING' => 0, - } -]); - # representation_type $e = { 'FILE' => 'foo.idl', -- cgit