summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-01-09 15:54:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:37:18 -0500
commita338d29bc1e7d902190cc5ddb370eebc2ea4929d (patch)
tree310b7ca5ead49e1935698f2db9a69389534af45f /source4
parentc5c8a33831f96640b975558766aadf59b0820043 (diff)
downloadsamba-a338d29bc1e7d902190cc5ddb370eebc2ea4929d.tar.gz
samba-a338d29bc1e7d902190cc5ddb370eebc2ea4929d.tar.bz2
samba-a338d29bc1e7d902190cc5ddb370eebc2ea4929d.zip
r20633: Add another test, fix warnings.
(This used to be commit 3ddc76772765db8009120ada820837737c49e409)
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/pidl/tests/ndr.pl51
1 files changed, 44 insertions, 7 deletions
diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl
index 97199a4120..da22949c6d 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 => 9;
+use Test::More tests => 10;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -19,6 +19,7 @@ my $e = {
'PROPERTIES' => {},
'POINTERS' => 0,
'TYPE' => 'uint8',
+ 'PARENT' => { TYPE => 'STRUCT' },
'LINE' => 42 };
is_deeply(GetElementLevelTable($e), [
@@ -57,8 +58,9 @@ is_deeply($ne->{LEVELS}, [
$e = {
'FILE' => 'foo.idl',
'NAME' => 'v',
- 'PROPERTIES' => {},
+ 'PROPERTIES' => {"unique" => 1},
'POINTERS' => 1,
+ 'PARENT' => { TYPE => 'STRUCT' },
'TYPE' => 'uint8',
'LINE' => 42 };
@@ -67,7 +69,7 @@ is_deeply(GetElementLevelTable($e), [
LEVEL_INDEX => 0,
IS_DEFERRED => 0,
TYPE => 'POINTER',
- POINTER_TYPE => undef,
+ POINTER_TYPE => "unique",
POINTER_INDEX => 0,
LEVEL => 'EMBEDDED'
},
@@ -88,9 +90,10 @@ is_deeply(GetElementLevelTable($e), [
$e = {
'FILE' => 'foo.idl',
'NAME' => 'v',
- 'PROPERTIES' => {},
+ 'PROPERTIES' => {"unique" => 1},
'POINTERS' => 2,
'TYPE' => 'uint8',
+ 'PARENT' => { TYPE => 'STRUCT' },
'LINE' => 42 };
is_deeply(GetElementLevelTable($e), [
@@ -98,7 +101,7 @@ is_deeply(GetElementLevelTable($e), [
LEVEL_INDEX => 0,
IS_DEFERRED => 0,
TYPE => 'POINTER',
- POINTER_TYPE => undef,
+ POINTER_TYPE => "unique",
POINTER_INDEX => 0,
LEVEL => 'EMBEDDED'
},
@@ -106,7 +109,7 @@ is_deeply(GetElementLevelTable($e), [
LEVEL_INDEX => 1,
IS_DEFERRED => 1,
TYPE => 'POINTER',
- POINTER_TYPE => undef,
+ POINTER_TYPE => "unique",
POINTER_INDEX => 1,
LEVEL => 'EMBEDDED'
},
@@ -122,7 +125,7 @@ is_deeply(GetElementLevelTable($e), [
}
]);
-# Case 2 : ref pointers
+# Case 3 : ref pointers
#
$e = {
'FILE' => 'foo.idl',
@@ -130,6 +133,7 @@ $e = {
'PROPERTIES' => {"ref" => 1},
'POINTERS' => 1,
'TYPE' => 'uint8',
+ 'PARENT' => { TYPE => 'STRUCT' },
'LINE' => 42 };
is_deeply(GetElementLevelTable($e), [
@@ -152,3 +156,36 @@ is_deeply(GetElementLevelTable($e), [
'CONVERT_TO' => undef
}
]);
+
+
+# Case 4 : top-level ref pointers
+#
+$e = {
+ 'FILE' => 'foo.idl',
+ 'NAME' => 'v',
+ 'PROPERTIES' => {"ref" => 1},
+ 'POINTERS' => 1,
+ 'TYPE' => 'uint8',
+ 'PARENT' => { TYPE => 'FUNCTION' },
+ 'LINE' => 42 };
+
+is_deeply(GetElementLevelTable($e), [
+ {
+ LEVEL_INDEX => 0,
+ IS_DEFERRED => 0,
+ TYPE => 'POINTER',
+ POINTER_TYPE => "ref",
+ POINTER_INDEX => 0,
+ LEVEL => 'TOP'
+ },
+ {
+ 'IS_DEFERRED' => 0,
+ 'LEVEL_INDEX' => 1,
+ 'DATA_TYPE' => 'uint8',
+ 'CONVERT_FROM' => undef,
+ 'CONTAINS_DEFERRED' => 0,
+ 'TYPE' => 'DATA',
+ 'IS_SURROUNDING' => 0,
+ 'CONVERT_TO' => undef
+ }
+]);