diff options
author | Brad Hards <bradh@frogmouth.net> | 2009-06-01 16:26:43 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-06-02 18:05:42 +0200 |
commit | 00bfe9c286b7156f30a5cad4ee6d42557f3c7835 (patch) | |
tree | 23da334a49e7e1a5bfc2937a34cc37c7e3dbcb01 /pidl | |
parent | 688efbbc687bf96c6801afe55deb55a7002a9bf3 (diff) | |
download | samba-00bfe9c286b7156f30a5cad4ee6d42557f3c7835.tar.gz samba-00bfe9c286b7156f30a5cad4ee6d42557f3c7835.tar.bz2 samba-00bfe9c286b7156f30a5cad4ee6d42557f3c7835.zip |
Add support for double type in pidl.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/NDR.pm | 1 | ||||
-rw-r--r-- | pidl/lib/Parse/Pidl/Typelist.pm | 1 | ||||
-rwxr-xr-x | pidl/tests/ndr.pl | 3 | ||||
-rwxr-xr-x | pidl/tests/typelist.pl | 8 |
4 files changed, 11 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm index 5ee26d16b6..95cd4b9dc3 100644 --- a/pidl/lib/Parse/Pidl/NDR.pm +++ b/pidl/lib/Parse/Pidl/NDR.pm @@ -53,6 +53,7 @@ my $scalar_alignment = { 'int32' => 4, 'uint32' => 4, 'hyper' => 8, + 'double' => 8, 'pointer' => 8, 'dlong' => 4, 'udlong' => 4, diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm index 4f9d982c21..e63b3c990f 100644 --- a/pidl/lib/Parse/Pidl/Typelist.pm +++ b/pidl/lib/Parse/Pidl/Typelist.pm @@ -38,6 +38,7 @@ my %scalars = ( "dlong" => "int64_t", "udlong" => "uint64_t", "udlongr" => "uint64_t", + "double" => "double", "pointer" => "void*", "DATA_BLOB" => "DATA_BLOB", "string" => "const char *", diff --git a/pidl/tests/ndr.pl b/pidl/tests/ndr.pl index 504b7ec8de..53b8cb89e3 100755 --- a/pidl/tests/ndr.pl +++ b/pidl/tests/ndr.pl @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 46; +use Test::More tests => 47; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -480,6 +480,7 @@ $ne = ParseElement($e, undef); is($ne->{REPRESENTATION_TYPE}, "uint8"); is(align_type("hyper"), 8); +is(align_type("double"), 8); is(align_type("uint32"), 4); is(align_type("uint16"), 2); is(align_type("uint8"), 1); diff --git a/pidl/tests/typelist.pl b/pidl/tests/typelist.pl index 80ee868f9d..28bf394275 100755 --- a/pidl/tests/typelist.pl +++ b/pidl/tests/typelist.pl @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 54; +use Test::More tests => 56; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -21,6 +21,7 @@ is("int32", expandAlias("int32")); is("uint32_t", mapScalarType("uint32")); is("void", mapScalarType("void")); is("uint64_t", mapScalarType("hyper")); +is("double", mapScalarType("double")); my $x = { TYPE => "ENUM", NAME => "foo", EXTRADATA => 1 }; addType($x); @@ -34,6 +35,11 @@ is_deeply(getType("uint16"), { TYPE => "TYPEDEF", DATA => { NAME => "uint16", TYPE => "SCALAR" }}); +is_deeply(getType("double"), { + NAME => "double", + TYPE => "TYPEDEF", + DATA => { NAME => "double", TYPE => "SCALAR" }}); + is(0, typeIs("someUnknownType", "ENUM")); is(0, typeIs("foo", "ENUM")); addType({NAME => "mytypedef", TYPE => "TYPEDEF", DATA => { TYPE => "ENUM" }}); |