[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Glob...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Glob... |
Date: |
Wed, 26 Mar 2008 14:15:18 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/03/26 14:15:18
Modified files:
. : ChangeLog
testsuite/actionscript.all: Global.as
Log message:
Tests for int().
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6026&r2=1.6027
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Global.as?cvsroot=gnash&r1=1.48&r2=1.49
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6026
retrieving revision 1.6027
diff -u -b -r1.6026 -r1.6027
--- ChangeLog 26 Mar 2008 12:36:11 -0000 1.6026
+++ ChangeLog 26 Mar 2008 14:15:17 -0000 1.6027
@@ -1,3 +1,7 @@
+2008-03-26 Benjamin Wolsey <address@hidden>
+
+ * testsuite/actionscript.all/Global.as: tests for int().
+
2008-03-26 Sandro Santilli <address@hidden>
* testsuite/misc-swfmill.all/: Makefile.am,
Index: testsuite/actionscript.all/Global.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Global.as,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- testsuite/actionscript.all/Global.as 25 Mar 2008 16:23:10 -0000
1.48
+++ testsuite/actionscript.all/Global.as 26 Mar 2008 14:15:18 -0000
1.49
@@ -22,7 +22,7 @@
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: Global.as,v 1.48 2008/03/25 16:23:10 bwy Exp $";
+rcsid="$Id: Global.as,v 1.49 2008/03/26 14:15:18 bwy Exp $";
#include "check.as"
#if OUTPUT_VERSION > 5
@@ -385,40 +385,88 @@
/// Tests for int
+/// non-numeric
+check_equals (int(undefined), 0);
+check_equals (int("string"), 0);
+check_equals (int("infinity"), 0);
+
+/// Floats
check_equals (int(1.5), 1);
-check_equals (int(0), 0);
-check_equals (int(s), 0);
check_equals (int(-1.e-15), 0);
check_equals (int(-0.99999999999999), 0);
check_equals (int(0.99999999999), 0);
check_equals (int(-7.8), -7);
check_equals (int(6.1), 6);
+check_equals (int("-7.8"), -7);
+check_equals (int("6.1"), 6);
+xcheck_equals (int(" -7.8"), -7);
+/// Integer values
+check_equals (int(0), 0);
check_equals (int(0xffffffff), -1);
-
check_equals (int(2147483648), -2147483648);
check_equals (int(-2147483648), -2147483648);
-
check_equals (int(2147483649), -2147483647);
check_equals (int(-2147483649), 2147483647);
check_equals (int(4294967296), 0);
check_equals (int(-4294967296), 0);
check_equals (int(infinity), 0);
+check_equals (int("2147483649"), -2147483647);
+check_equals (int("-2147483649"), 2147483647);
+check_equals (int("4294967296"), 0);
+check_equals (int("-4294967296"), 0);
+
+
+/// Octal (or not)
+#if OUTPUT_VERSION < 6
+check_equals(int("0123"), 123);
+check_equals(int("-0123"), -123);
+#else
+xcheck_equals(int("0123"), 83);
+xcheck_equals(int("-0123"), -83);
+#endif
+xcheck_equals(int(" 0123"), 123);
+check_equals(int("- 0123"), 0);
+check_equals(int(" 0-123"), 0);
+check_equals(int("01238"), 1238);
+check_equals (int("0123.6"), 123);
+
+/// Hex (or not)
+check_equals(int("-0x10"), 0);
+#if OUTPUT_VERSION < 6
+check_equals(int("0x-10"), 0);
+check_equals(int("0X+10"), 0);
+#else
+xcheck_equals(int("0x-10"), -16);
+xcheck_equals(int("0X+10"), 16);
+#endif
+/// Extraneous characters
+check_equals (int("0123r"), 0);
+check_equals (int("0123&"), 0);
+check_equals (int(" 0123r"), 0);
+check_equals (int("-6.1 "), 0);
+check_equals (int("6,1"), 0);
+check_equals (int("-7,8"), 0);
+check_equals (int("7 "), 0);
+check_equals (int("0x10 "), 0);
+check_equals (int("0x10.8"), 0);
+check_equals (int("0123.6 "), 0);
+check_equals (int("0x-7.8 "), 0);
//------------------------------------------------------------
// END OF TEST
//------------------------------------------------------------
#if OUTPUT_VERSION == 5
- check_totals(116); // SWF5
+ check_totals(146); // SWF5
#else
# if OUTPUT_VERSION == 6
- check_totals(150); // SWF6
+ check_totals(180); // SWF6
# else
# if OUTPUT_VERSION == 7
- check_totals(132); // SWF7
+ check_totals(162); // SWF7
# else
- check_totals(119); // SWF8+
+ check_totals(149); // SWF8+
# endif
# endif
#endif