diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-08-12 10:24:01 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-08-12 10:27:20 +0200 |
commit | 5796da6948379ffc101e813a4d68676e4a661c61 (patch) | |
tree | a37c0756085affc0b970d65725013c8cb9decc6a /pidl | |
parent | 6392f14cd78d3f0585615ccf0a6b0a961187f68f (diff) | |
download | samba-5796da6948379ffc101e813a4d68676e4a661c61.tar.gz samba-5796da6948379ffc101e813a4d68676e4a661c61.tar.bz2 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')
-rwxr-xr-x | pidl/tests/parse_idl.pl | 131 |
1 files changed, 103 insertions, 28 deletions
diff --git a/pidl/tests/parse_idl.pl b/pidl/tests/parse_idl.pl index 9d43ddccc7..e06526dd1e 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 +}]); |