my $dt = getType($e);
- if ($dt->{TYPE} eq "TYPEDEF") {
+ if ($dt->{TYPE} eq "TYPEDEF" or $dt->{TYPE} eq "DECLARE") {
return align_type($dt->{DATA});
} elsif ($dt->{TYPE} eq "ENUM") {
return align_type(Parse::Pidl::Typelist::enum_type_fn($dt));
use strict;
use warnings;
-use Test::More tests => 22;
+use Test::More tests => 25;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
$ne = ParseElement($e, undef);
is($ne->{REPRESENTATION_TYPE}, "uint8");
+is(align_type("hyper"), 8);
is(align_type("uint32"), 4);
is(align_type("uint16"), 2);
is(align_type("uint8"), 1);
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 => {
+ TYPE => "STRUCT",
+ ELEMENTS => [ { TYPE => "hyper" } ] }}), 8);
is(align_type({ TYPE => "STRUCT", "NAME" => "bla",
ELEMENTS => [ { TYPE => "uint8" } ] }), 4);