perl: add tests for unpacking 'float'

This commit is contained in:
Fuji, Goro 2010-10-13 10:03:56 +09:00
parent 0ced3ec2d2
commit 233f13aac5
2 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,7 @@ sub pis ($$) {
or diag( explain(unpackit($_[0])) );
}
my @dat = do 't/data.pl';
my @dat = do 't/data.pl' or die $@;
plan tests => 1*(scalar(@dat)/2);

View File

@ -26,6 +26,9 @@ no warnings; # i need this, i need this.
'aa 34 32 39 34 39 36 37 32 39 35' => ''.0xFFFFFFFF,
'ab 36 38 37 31 39 34 37 36 37 33 35' => ''.0xFFFFFFFFF,
'ca 00 00 00 00' => 0.0, # float
'ca 40 2c cc cd' => unpack('f', pack 'f', 2.7),
'd2 80 00 00 01' => '-2147483647', # int32_t
'ce 80 00 00 01' => '2147483649', # uint32_t