diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/data/parse/makefixed.pl | 12 | ||||
-rw-r--r-- | test/data/parse/properties.dat | 8 |
2 files changed, 19 insertions, 1 deletions
diff --git a/test/data/parse/makefixed.pl b/test/data/parse/makefixed.pl index 712784f..1a9306f 100755 --- a/test/data/parse/makefixed.pl +++ b/test/data/parse/makefixed.pl @@ -7,5 +7,15 @@ die "Usage: makefixed.pl <value>\n" if (@ARGV != 1); my $val = shift @ARGV; -printf("0x%.8x\n", $val * (1 << 10)); +$val *= (1 << 10); + +# Round away from zero +if ($val < 0) { + $val -= 0.5; +} else { + $val += 0.5; +} + +# Truncates back towards zero +printf("0x%.8x\n", $val); diff --git a/test/data/parse/properties.dat b/test/data/parse/properties.dat index c2f4f48..bc09a04 100644 --- a/test/data/parse/properties.dat +++ b/test/data/parse/properties.dat @@ -122,6 +122,14 @@ | 0x02000000 0x00000324 0x00000202 #reset +#data +* { azimuth: -0.785rad; } +#errors +#expected +| 1 * +| 0x02000000 0xfffffcdc 0x00000202 +#reset + ## ## 01 - background-attachment ## |