[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10980: migrated some test cases, no
From: |
Jon Crider |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10980: migrated some test cases, not sure how to test StaticText and Array |
Date: |
Wed, 03 Jun 2009 09:44:33 -0600 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 10980
committer: Jon Crider <address@hidden>
branch nick: trunk
timestamp: Wed 2009-06-03 09:44:33 -0600
message:
migrated some test cases, not sure how to test StaticText and Array
modified:
testsuite/as3/classes.all/Array_as.hx
testsuite/as3/classes.all/text/GridFitType_as.hx
testsuite/as3/classes.all/text/StaticText_as.hx
------------------------------------------------------------
revno: 10973.1.1
committer: Jon Crider <address@hidden>
branch nick: testdev
timestamp: Wed 2009-06-03 09:24:53 -0600
message:
Modified some test cases, still working on Array and StaticText
modified:
testsuite/as3/classes.all/Array_as.hx
testsuite/as3/classes.all/text/GridFitType_as.hx
testsuite/as3/classes.all/text/StaticText_as.hx
=== modified file 'testsuite/as3/classes.all/Array_as.hx'
--- a/testsuite/as3/classes.all/Array_as.hx 2009-06-01 20:39:59 +0000
+++ b/testsuite/as3/classes.all/Array_as.hx 2009-06-03 15:24:53 +0000
@@ -44,21 +44,25 @@
// in array in versions earlier than 6. Since Haxe does not support flash
// versions prior to 6, these will be commented out until a later date
+ //array does not yet have any constants in haxe
+ //DejaGnu.note("value of CASEINSENSITIVE" + Array.CASEINSENSITIVE);
+
+
+ //test for existance of common methods
+ var x1:Array<String> = new Array();
+ x1[0] = "one";
+ x1[1] = "two";
+ x1[2] = "three";
+
DejaGnu.note("typeof: Array = " + Type.typeof(Array));
DejaGnu.note("class fields: " + Type.getClassFields(Array));
DejaGnu.note("Instance fields: " + Type.getInstanceFields(Array));
- //array does not yet have any constants in haxe
- //DejaGnu.note("value of CASEINSENSITIVE" + Array.CASEINSENSITIVE);
-
-
- //test for existance of common methods
- var x1 = new Array<String>();
-
//not working as expected
DejaGnu.note("Object Fields = " + Reflect.fields(x1));
//check_equals ( Array.CASEINSENSITIVE , 1 );
- if (untyped x1.CASEINSENSITIVE == 1) {
+ DejaGnu.note("const: " + Std.string(untyped x1.CASEINSENSITIVE));
+ if ( untyped x1.CASEINSENSITIVE == 1 ) {
DejaGnu.pass("");
} else {
DejaGnu.fail("");
@@ -131,12 +135,6 @@
DejaGnu.fail("Array::splice method does not exist");
}
- if (Type.typeof(x1.toString) == ValueType.TFunction) {
- DejaGnu.pass("Array::toString method exists");
- } else {
- DejaGnu.fail("Array::toString method does not exist");
- }
-
if (Type.typeof(x1.unshift) == ValueType.TFunction) {
DejaGnu.pass("Array::unshift method exists");
} else {
@@ -227,9 +225,16 @@
DejaGnu.fail("Array::toLocaleString method does not exist");
}
+ // Need to test for toString function
+ // so far haven't figured out how to do this in flash9
#else
+ if (Type.typeof(x1.toString) == ValueType.TFunction) {
+ DejaGnu.pass("Array::toString method exists");
+ } else {
+ DejaGnu.fail("Array::toString method does not exist");
+ }
#end
//Note: All these (to end of file) will need to be migrated to Haxe
=== modified file 'testsuite/as3/classes.all/text/GridFitType_as.hx'
--- a/testsuite/as3/classes.all/text/GridFitType_as.hx 2009-05-21 00:17:43
+0000
+++ b/testsuite/as3/classes.all/text/GridFitType_as.hx 2009-06-03 15:24:53
+0000
@@ -27,11 +27,12 @@
import flash.text.GridFitType;
import flash.display.MovieClip;
#else
-import flash.GridFitType;
-import flash.MovieClip;
+//import flash.GridFitType;
+//import flash.MovieClip;
#end
import flash.Lib;
import Type;
+import Std;
// import our testing API
import DejaGnu;
@@ -39,19 +40,27 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class GridFitType_as {
static function main() {
- var x1:GridFitType = new GridFitType();
-
- // Make sure we actually get a valid class
- if (x1 != null) {
- DejaGnu.pass("GridFitType class exists");
- } else {
- DejaGnu.fail("GridFitType class doesn't exist");
- }
-
-// Tests to see if all the methods exist. All these do is test for
-// existance of a method, and don't test the functionality at all. This
-// is primarily useful only to test completeness of the API implementation.
-
+
+#if !flash9
+ DejaGnu.note("The GridFitType class does not exist in versions
prior to flash9");
+#else
+
+ if (Std.is(GridFitType.NONE, String) &&
Std.string(GridFitType.NONE) == "none") {
+ DejaGnu.pass("GridFitType.NONE property exists");
+ } else {
+ DejaGnu.fail("GridFitType.NONE property does not
exist");
+ }
+ if (Std.is(GridFitType.PIXEL, String) &&
Std.string(GridFitType.PIXEL) == "pixel") {
+ DejaGnu.pass("GridFitType.PIXEL property exists");
+ } else {
+ DejaGnu.fail("GridFitType.PIXEL property does not
exist");
+ }
+ if (Std.is(GridFitType.SUBPIXEL, String) &&
Std.string(GridFitType.SUBPIXEL) == "subpixel") {
+ DejaGnu.pass("GridFitType.SUBPIXEL property exists");
+ } else {
+ DejaGnu.fail("GridFitType.SUBPIXEL property does not
exist");
+ }
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
}
=== modified file 'testsuite/as3/classes.all/text/StaticText_as.hx'
--- a/testsuite/as3/classes.all/text/StaticText_as.hx 2009-06-03 13:33:25
+0000
+++ b/testsuite/as3/classes.all/text/StaticText_as.hx 2009-06-03 15:44:33
+0000
@@ -27,11 +27,12 @@
import flash.text.StaticText;
import flash.display.MovieClip;
#else
-import flash.StaticText;
-import flash.MovieClip;
+//import flash.StaticText;
+//import flash.MovieClip;
#end
import flash.Lib;
import Type;
+import Std;
// import our testing API
import DejaGnu;
@@ -39,24 +40,20 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class StaticText_as {
static function main() {
- var x1:StaticText = new StaticText();
-
- // Make sure we actually get a valid class
- if (x1 != null) {
- DejaGnu.pass("StaticText class exists");
- } else {
- DejaGnu.fail("StaticText class doesn't exist");
- }
-// Tests to see if all the properties exist. All these do is test for
-// existance of a property, and don't test the functionality at all. This
-// is primarily useful only to test completeness of the API implementation.
- if (x1.text == null) {
- DejaGnu.pass("StaticText.text property exists");
- } else {
- DejaGnu.fail("StaticText.text property doesn't exist");
- }
-
- if (x1.text == null) {
+
+#if !flash9
+ DejaGnu.note("The StaticText class does not exist in versions prior to
flash9");
+#else
+
+ var x1:StaticText = new StaticText();
+
+ if (Std.is(x1.text, String) ) {
+ DejaGnu.pass("StaticText.text property exists");
+ } else {
+ DejaGnu.fail("StaticText.text property does not exist");
+ }
+
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10980: migrated some test cases, not sure how to test StaticText and Array,
Jon Crider <=