Author: jmb
Date: Sat Jan 17 01:27:25 2009
New Revision: 6110
URL: http://source.netsurf-browser.org?rev=6110&view=rev
Log:
Make makefixed.pl round to nearest integer, rather than truncating towards zero.
Add a test for negative fractions to properties.dat
Modified:
trunk/libcss/test/data/parse/makefixed.pl
trunk/libcss/test/data/parse/properties.dat
Modified: trunk/libcss/test/data/parse/makefixed.pl
URL:
http://source.netsurf-browser.org/trunk/libcss/test/data/parse/makefixed.pl?rev=6110&r1=6109&r2=6110&view=diff
==============================================================================
--- trunk/libcss/test/data/parse/makefixed.pl (original)
+++ trunk/libcss/test/data/parse/makefixed.pl Sat Jan 17 01:27:25 2009
@@ -7,5 +7,15 @@
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);
+
Modified: trunk/libcss/test/data/parse/properties.dat
URL:
http://source.netsurf-browser.org/trunk/libcss/test/data/parse/properties.dat?rev=6110&r1=6109&r2=6110&view=diff
==============================================================================
--- trunk/libcss/test/data/parse/properties.dat (original)
+++ trunk/libcss/test/data/parse/properties.dat Sat Jan 17 01:27:25 2009
@@ -120,6 +120,14 @@
#expected
| 1 *
| 0x02000000 0x00000324 0x00000202
+#reset
+
+#data
+* { azimuth: -0.785rad; }
+#errors
+#expected
+| 1 *
+| 0x02000000 0xfffffcdc 0x00000202
#reset
##
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org