summaryrefslogtreecommitdiffstats
path: root/pidl/tests
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-08-12 10:24:01 +0200
committerStefan Metzmacher <metze@samba.org>2009-08-12 10:27:20 +0200
commit5796da6948379ffc101e813a4d68676e4a661c61 (patch)
treea37c0756085affc0b970d65725013c8cb9decc6a /pidl/tests
parent6392f14cd78d3f0585615ccf0a6b0a961187f68f (diff)
downloadsamba-5796da6948379ffc101e813a4d68676e4a661c61.tar.gz
samba-5796da6948379ffc101e813a4d68676e4a661c61.tar.xz
samba-5796da6948379ffc101e813a4d68676e4a661c61.zip
pidl: fix parse_idl test after idl.yp changes
We now generate 'FILE' and 'LINE' elements for each layer. This change makes the expected PIDL trees human readable:-) metze
Diffstat (limited to 'pidl/tests')
-rwxr-xr-xpidl/tests/parse_idl.pl131
1 files changed, 103 insertions, 28 deletions
diff --git a/pidl/tests/parse_idl.pl b/pidl/tests/parse_idl.pl
index 9d43ddccc7a..e06526dd1eb 100755
--- a/pidl/tests/parse_idl.pl
+++ b/pidl/tests/parse_idl.pl
@@ -113,52 +113,127 @@ testok "cpp-quote", "cpp_quote(\"bla\")";
my $x = Parse::Pidl::IDL::parse_string("interface foo { struct x {}; }", "<foo>");
-is_deeply($x,
- [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
- { 'NAME' => 'x', 'TYPE' => 'STRUCT', ELEMENTS => [] } ],
- 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+is_deeply($x, [ {
+ 'TYPE' => 'INTERFACE',
+ 'NAME' => 'foo',
+ 'DATA' => [ {
+ 'TYPE' => 'STRUCT',
+ 'NAME' => 'x',
+ 'ELEMENTS' => [],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ } ],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+}]);
$x = Parse::Pidl::IDL::parse_string("interface foo { struct x; }", "<foo>");
-is_deeply($x,
- [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
- { 'NAME' => 'x', 'TYPE' => 'STRUCT' } ],
- 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+is_deeply($x, [ {
+ 'TYPE' => 'INTERFACE',
+ 'NAME' => 'foo',
+ 'DATA' => [ {
+ 'TYPE' => 'STRUCT',
+ 'NAME' => 'x',
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ } ],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+}]);
$x = Parse::Pidl::IDL::parse_string("cpp_quote(\"foobar\")", "<quote>");
-is_deeply($x,
- [ { 'FILE' => '<quote>', 'DATA' => '"foobar"',
- 'TYPE' => 'CPP_QUOTE', 'LINE' => 0 } ]);
+is_deeply($x, [ {
+ 'TYPE' => 'CPP_QUOTE',
+ 'DATA' => '"foobar"',
+ 'FILE' => '<quote>',
+ 'LINE' => 0
+}]);
# A typedef of a struct without body
$x = Parse::Pidl::IDL::parse_string("interface foo { typedef struct x y; }", "<foo>");
-is_deeply($x,
- [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
- { 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => {
- TYPE => 'STRUCT', NAME => 'x' } } ],
- 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+is_deeply($x, [ {
+ 'TYPE' => 'INTERFACE',
+ 'NAME' => 'foo',
+ 'DATA' => [ {
+ 'TYPE' => 'TYPEDEF',
+ 'NAME' => 'y',
+ 'DATA' => {
+ 'TYPE' => 'STRUCT',
+ 'NAME' => 'x',
+ 'FILE' => '<foo>',
+ 'LINE' => 0,
+ },
+ 'FILE' => '<foo>',
+ 'LINE' => 0,
+ } ],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+}]);
# A typedef of a struct with empty body
$x = Parse::Pidl::IDL::parse_string("interface foo { typedef struct {} y; }", "<foo>");
-is_deeply($x,
- [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
- { 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => { TYPE => 'STRUCT', ELEMENTS => [] } } ],
- 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+is_deeply($x, [ {
+ 'TYPE' => 'INTERFACE',
+ 'NAME' => 'foo',
+ 'DATA' => [ {
+ 'TYPE' => 'TYPEDEF',
+ 'NAME' => 'y',
+ 'DATA' => {
+ 'TYPE' => 'STRUCT',
+ 'ELEMENTS' => [],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ },
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ } ],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+}]);
# A typedef of a bitmap with no body
$x = Parse::Pidl::IDL::parse_string("interface foo { typedef bitmap x y; }", "<foo>");
-is_deeply($x,
- [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
- { 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => { TYPE => 'BITMAP', NAME => 'x' } } ],
- 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+is_deeply($x, [ {
+ 'TYPE' => 'INTERFACE',
+ 'NAME' => 'foo',
+ 'DATA' => [ {
+ 'TYPE' => 'TYPEDEF',
+ 'NAME' => 'y',
+ 'DATA' => {
+ 'TYPE' => 'BITMAP',
+ 'NAME' => 'x',
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ },
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ } ],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+}]);
# A typedef of a union with no body
$x = Parse::Pidl::IDL::parse_string("interface foo { typedef union x y; }", "<foo>");
-is_deeply($x,
- [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
- { 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => { TYPE => 'UNION', NAME => 'x' } } ],
- 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+is_deeply($x, [ {
+ 'TYPE' => 'INTERFACE',
+ 'NAME' => 'foo',
+ 'DATA' => [ {
+ 'TYPE' => 'TYPEDEF',
+ 'NAME' => 'y',
+ 'DATA' => {
+ 'TYPE' => 'UNION',
+ 'NAME' => 'x',
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ },
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+ } ],
+ 'FILE' => '<foo>',
+ 'LINE' => 0
+}]);