pidl: Remove declare tests, add more tests for typedef.
[ira/wip.git] / source / pidl / tests / ndr.pl
index 1512f19d525d981bd8b188a36f2c3234770da206..09f1d4969babe44430f2c1fbdffd2d08200cf3e6 100755 (executable)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 34;
+use Test::More tests => 37;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util;
@@ -212,9 +212,16 @@ is(align_type({ TYPE => "STRUCT", "NAME" => "bla",
                            ELEMENTS => [ { TYPE => "uint16" } ] }), 4);
 is(align_type({ TYPE => "STRUCT", 
                            ELEMENTS => [ { TYPE => "hyper" } ] }), 8);
-is(align_type({ TYPE => "DECLARE", DATA => { 
+is(align_type({ TYPE => "TYPEDEF", DATA => { 
                                TYPE => "STRUCT", 
                            ELEMENTS => [ { TYPE => "hyper" } ] }}), 8);
+# typedef of struct without body
+is(align_type({ TYPE => "TYPEDEF", DATA => { 
+                               TYPE => "STRUCT", ELEMENTS => undef }}), 4);
+# struct without body
+is(align_type({ TYPE => "STRUCT", ELEMENTS => undef }), 4);
+# empty struct
+is(align_type({ TYPE => "STRUCT", ELEMENTS => [] }), 1);
 is(align_type({ TYPE => "STRUCT", "NAME" => "bla", 
                            ELEMENTS => [ { TYPE => "uint8" } ] }), 4);