CVSROOT: /sources/gnash Module name: gnash Changes by: Zou Lunkai <zoulunkai> 07/08/02 03:48:32
Modified files: . : ChangeLog testsuite/actionscript.all: ops.as Log message: * testsuite/actionscript.all/ops.as: more tests and more failures. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3906&r2=1.3907 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/ops.as?cvsroot=gnash&r1=1.1&r2=1.2 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.3906 retrieving revision 1.3907 diff -u -b -r1.3906 -r1.3907 --- ChangeLog 1 Aug 2007 21:36:57 -0000 1.3906 +++ ChangeLog 2 Aug 2007 03:48:32 -0000 1.3907 @@ -1,3 +1,8 @@ +2007-08-02 Zou Lunkai <[EMAIL PROTECTED]> + + * testsuite/actionscript.all/ops.as: more tests and more failures. still + need more, we don't want fail on those basic logical operations. + 2007-08-01 Sandro Santilli <[EMAIL PROTECTED]> * server/swf/tag_loaders.cpp (define_sound_loader): fix a bug Index: testsuite/actionscript.all/ops.as =================================================================== RCS file: /sources/gnash/gnash/testsuite/actionscript.all/ops.as,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- testsuite/actionscript.all/ops.as 31 Jul 2007 15:30:29 -0000 1.1 +++ testsuite/actionscript.all/ops.as 2 Aug 2007 03:48:32 -0000 1.2 @@ -20,7 +20,7 @@ * Test binary predicates (equal, less_then, greater_then, logical and bitwise ops) */ -rcsid="$Id: ops.as,v 1.1 2007/07/31 15:30:29 strk Exp $"; +rcsid="$Id: ops.as,v 1.2 2007/08/02 03:48:32 zoulunkai Exp $"; #include "check.as" @@ -71,30 +71,229 @@ // Less then operator (ACTION_LESSTHAN : 0x0F) //--------------------------------------------- -// TODO ... +x = 0.999; +y = 1.0; +check(x<y); + +x=String("0.999"); +y=String("1.0"); +xcheck(x<y); + +x=String("A"); +y=String("a"); +xcheck(x<y); + +x=String("abc"); +y=String("abcd"); +xcheck(x<y); + +x=0.999; +y=String("1.000"); +xcheck(x<y); + +x=String("0.999"); +y=1.0; +xcheck(x<y); //------------------------------------------------ // Logical AND operator (ACTION_LOGICALAND : 0x10) //------------------------------------------------ - -// TODO ... +x = true; +y = true; +z = x && y; +check_equals(z, y); + +x = true; +y = false; +z = x && y; +check_equals(z, y); + +x = true; +y = 0; +z=x && y; +check_equals(z, y); + +x = true; +y = 1; +z=x && y; +check_equals(z, y); + +x = true; +y = String("1.999"); +z=x && y; +check_equals(z, x); + +x=String("1.999"); +y=true; +z=x && y; +check_equals(z, y); + +x=String("adcd"); +y=true; +z=x && y; +#if OUTPUT_VERSION < 7 + xcheck_equals(z, false); +#else + check_equals(z, true); +#endif + +x=true; +y=String("adcd"); +z=x && y; +#if OUTPUT_VERSION < 7 + xcheck_equals(z, false); +#else + check_equals(z, true); +#endif + +x=0; +y=true; +z=x && y; +check_equals(z, x); + +x=1; +y=false; +z=x && y; +check_equals(z, y); + +x = new Number(9); +y=false; +z=x && y; +check_equals(z, y); + +x = new Object(); +y = false; +check_equals(z, y); + +x=String("adcd"); +y=false; +z=x && y; +check_equals(z, y); //------------------------------------------------ // Logical OR operator (ACTION_LOGICALOR : 0x11) //------------------------------------------------ -// TODO ... +x = 0; +y = 0; +z = x || y; +check_equals(z, y); + +x = 0; +y = 1; +z = x || y; +check_equals(z, y); + +x = 0; +y = 0.0001; +z = x || y; +xcheck(z!=y); +check_equals(z, true); + +x = 0; +y = "abcd"; +z = x || y; +#if OUTPUT_VERSION == 4 + check_equals(z, 1); +#elseif < 7 + check_equals(z, false); +#esle + check_equals(z, true); +#endif + +x = 0; +y = String("abcd"); +z = x || y; +#if OUTPUT_VERSION < 7 + xcheck_equals(z, false); +#else + check_equals(z, true); +#endif + +x = 0; +y = new String("abcd"); +z = x || y; +check_equals(z, true); + +x = 0; +y = Object(); +z = x || y; +check_equals(z, true); + +x = 0; +y = new Object(); +z = x || y; +check_equals(z, true); + +x = 0; +y = "0"; +z = x || y; +#if OUTPUT_VERSION < 7 + check_equals(z, false); +#else + check_equals(z, true); +#endif + +x = 0; +y = String("0"); +z = x || y; +#if OUTPUT_VERSION < 7 + xcheck_equals(z, false); +#else + check_equals(z, true); +#endif + +x = 0; +y = new String("0"); +z = x || y; +xcheck(z!=y); +check_equals(z, true); -//------------------------------------------------ -// Logical OR operator (ACTION_LOGICALOR : 0x11) -//------------------------------------------------ - -// TODO ... //------------------------------------------------ // Bitwise AND operator (ACTION_BITWISEAND : 0x60) //------------------------------------------------ +x=1; +y=1; +check_equals(x&y, 1); + +x=1; +y=2; +check_equals(x&y, 0); + +x = 1.0; +y = 3.0; +check_equals(x&y, 1); + +x = 1.9999; +y = 3.0; +check_equals(x&y, 1); + +x = 1.9999; +y = 3.9999; +check_equals(x&y, 1); + +x = new String("1"); +y = new String("3"); +check_equals(x&y, 1); + +x = new String("1.0"); +y = new String("3.0"); +check_equals(x&y, 1); + +x = new String("1.999"); +y = new String("3.999"); +check_equals(x&y, 1); + +x = new String("3.999"); +y = 7; +check_equals(x&y, 3); + +x = Number("7.999"); +y = 3; +check_equals(x&y, 3); + check_equals( (undefined&1), 0 ); check_equals( (1&undefined), 0 ); check_equals( (1&null), 0 ); @@ -107,6 +306,30 @@ // Bitwise OR operator (ACTION_BITWISEOR : 0x61) //------------------------------------------------ +x = 1; +y = 8; +check_equals(x|y, 9); + +x = 1.1; +y = 8.1; +check_equals(x|y, 9); + +x = 1.999; +y = 8.999; +check_equals(x|y, 9); + +x = new String("1.999"); +y = 8.999; +check_equals(x|y, 9); + +x = String("1.999"); +y = String("8.999"); +check_equals(x|y, 9); + +x = 9; +y = String("1.5"); +check_equals(x|y, 9); + check_equals( (undefined|1), 1 ); check_equals( (1|undefined), 1 ); check_equals( (undefined|undefined), 0 ); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit