r21690: Test use of typedef /and/ struct name
authorJelmer Vernooij <jelmer@samba.org>
Mon, 5 Mar 2007 00:03:44 +0000 (00:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:49:12 +0000 (14:49 -0500)
source/pidl/tests/header.pl
source/pidl/tests/parse_idl.pl

index bb09969d0f9aa4dd09b27b371b48b7ee28f6fc32..331f4dd9fb55d83641997ef940445a1226ebda05 100755 (executable)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 14;
+use Test::More tests => 15;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util;
@@ -48,3 +48,6 @@ like(parse_idl("interface p { struct x { }; };"),
 
 like(parse_idl("interface p { struct x; };"),
      qr/struct x;/sm, "struct declaration");
+
+like(parse_idl("interface p { typedef struct x { int p; } x; };"),
+     qr/struct x.*{.*int32_t p;.*};/sm, "double struct declaration");
index 727f41a293d82eb0f35269c575ec5d86407f4bcc..b82bd80e54412bd356225eab4bbb1d148511d553 100755 (executable)
@@ -4,7 +4,7 @@
 # Published under the GNU General Public License
 use strict;
 
-use Test::More tests => 63 * 2 + 2;
+use Test::More tests => 64 * 2 + 2;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util qw(test_errors);
@@ -108,6 +108,7 @@ testfail "import-nosemicolon", "import \"foo.idl\"",
 testok "import-multiple", "import \"foo.idl\", \"bar.idl\";";
 testok "include-multiple", "include \"foo.idl\", \"bar.idl\";";
 testok "empty-struct", "interface test { struct foo { }; }";
+testok "typedef-double", "interface test { typedef struct foo { } foo; }";
 
 my $x = Parse::Pidl::IDL::parse_string("interface foo { struct x {}; }", "<foo>");