diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-12 21:37:46 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-12 21:37:46 +0100 |
commit | 0e4be859f2b681492d6f9556769afe256e9d0167 (patch) | |
tree | 6c0ab8c073f59eff149ce779501de74020d3ffa8 /source4 | |
parent | 79c4bd95b8ff249ad2e738c852a2fe4b6271fe12 (diff) | |
download | samba-0e4be859f2b681492d6f9556769afe256e9d0167.tar.gz samba-0e4be859f2b681492d6f9556769afe256e9d0167.tar.bz2 samba-0e4be859f2b681492d6f9556769afe256e9d0167.zip |
pidl: Add more parsing tests.
(This used to be commit e44ee3e60ac4eb56cca02b58fdecb171269daca4)
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/pidl/tests/parse_idl.pl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source4/pidl/tests/parse_idl.pl b/source4/pidl/tests/parse_idl.pl index 96c7b2adc8..d14c374740 100755 --- a/source4/pidl/tests/parse_idl.pl +++ b/source4/pidl/tests/parse_idl.pl @@ -4,7 +4,7 @@ # Published under the GNU General Public License use strict; -use Test::More tests => 65 * 2 + 3; +use Test::More tests => 65 * 2 + 5; use FindBin qw($RealBin); use lib "$RealBin"; use Util qw(test_errors); @@ -129,4 +129,20 @@ is_deeply($x, [ { 'FILE' => '<quote>', 'DATA' => '"foobar"', 'TYPE' => 'CPP_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 } ]); + +# 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 } ]); |