[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10974: More text test cases and fix
From: |
Bob Naugle |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10974: More text test cases and fixed error messages |
Date: |
Tue, 02 Jun 2009 15:47:29 -0600 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 10974
committer: Bob Naugle <address@hidden>
branch nick: trunk
timestamp: Tue 2009-06-02 15:47:29 -0600
message:
More text test cases and fixed error messages
modified:
testsuite/as3/classes.all/geom/ColorTransform_as.hx
testsuite/as3/classes.all/media/Microphone_as.hx
testsuite/as3/classes.all/net/SharedObjectFlushStatus_as.hx
testsuite/as3/classes.all/text/TextFormat_as.hx
testsuite/as3/classes.all/text/TextRenderer_as.hx
testsuite/as3/classes.all/text/TextSnapshot_as.hx
=== modified file 'testsuite/as3/classes.all/geom/ColorTransform_as.hx'
--- a/testsuite/as3/classes.all/geom/ColorTransform_as.hx 2009-06-02
02:08:31 +0000
+++ b/testsuite/as3/classes.all/geom/ColorTransform_as.hx 2009-06-02
21:47:29 +0000
@@ -1,6 +1,6 @@
// ColorTransform_as.hx: ActionScript 3 "ColorTransform" class, for Gnash.
//
-// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
+// Generated on: 20090602 by "bnaugle". Remove this
// after any hand editing loosing changes.
//
// Copyright (C) 2009 Free Software Foundation, Inc.
@@ -23,12 +23,9 @@
// This test case must be processed by CPP before compiling to include the
// DejaGnu.hx header file for the testing framework support.
-#if flash9
-import flash.display.MovieClip;
-#else
-import flash.MovieClip;
-#end
+#if (flash9 || flash8)
import flash.geom.ColorTransform;
+#end
import flash.Lib;
import Type;
import Std;
@@ -39,7 +36,7 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class ColorTransform_as {
static function main() {
- #if flash9
+#if !(flash6 || flash7)
var x1:ColorTransform = new ColorTransform();
// Make sure we actually get a valid class
@@ -116,7 +113,9 @@
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
+#else
+ DejaGnu.note("This class (ColorTransform) is only available in flash8
and flash9");
+#end
}
}
=== modified file 'testsuite/as3/classes.all/media/Microphone_as.hx'
--- a/testsuite/as3/classes.all/media/Microphone_as.hx 2009-06-01 20:56:27
+0000
+++ b/testsuite/as3/classes.all/media/Microphone_as.hx 2009-06-02 21:47:29
+0000
@@ -2,7 +2,7 @@
//
// This test is only valid for Flash v9 and higher.
//
-// Generated by gen-as3.sh on: 20090503 by "rob". Remove this
+// Generated on: 20090602 by "bnaugle". Remove this
// after any hand editing loosing changes.
//
// Copyright (C) 2009 Free Software Foundation, Inc.
@@ -29,10 +29,12 @@
import flash.media.Microphone;
import flash.media.SoundTransform;
import flash.display.MovieClip;
+#else
+import flash.Microphone;
+#end
import flash.Lib;
import Type;
import Std;
-#end
import DejaGnu;
@@ -40,24 +42,32 @@
// file passed to haxe will have after the preprocessing step
class Microphone_as {
static function main() {
- // MicroPhone doesn't have a constructor, instead it must be
- // accessed through a static method.
+#if flash9
var x1:Microphone = Microphone.getMicrophone();
+#else
+ var x1:Microphone = Microphone.get();
+#end
// Make sure we actually get a valid class
- if (x1 != null) {
+ if (Std.is(x1, Microphone)) {
DejaGnu.pass("Microphone class exists");
} else {
- DejaGnu.fail("Microphone lass doesn't exist");
+ DejaGnu.fail("Microphone 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 (Std.is(x1.activityLevel, Float)) {
- DejaGnu.pass("Microphone::activityLevel property exists");
- } else {
- DejaGnu.fail("Microphone::activityLevel property doesn't exist");
- }
+ if (Std.is(Microphone.names, Array)) {
+ DejaGnu.pass("Microphone.names property exists");
+ } else {
+ DejaGnu.fail("Microphone.names property doesn't exist");
+ }
+ if (Std.is(x1.activityLevel, Int)) {
+ DejaGnu.pass("Microphone.activityLevel property exists");
+ } else {
+ DejaGnu.fail("Microphone.activityLevel property doesn't exist");
+ }
+
//FIXME: this will need to be implemented if speex codec is supported
//FIXME: it would be nice if this analyzed the string to see if it is
@@ -79,17 +89,17 @@
//}
- if (Std.is(x1.gain, Float)) {
+ if (Std.is(x1.gain, Int)) {
DejaGnu.pass("Microphone::gain property exists");
} else {
DejaGnu.fail("Microphone::gain property doesn't exist");
}
- if (Type.typeof(x1.index) == ValueType.TInt) {
+ if (Std.is(x1.index, Int)) {
DejaGnu.pass("Microphone::index property exists");
} else {
DejaGnu.fail("Microphone::index property doesn't exist");
}
- if (Type.typeof(x1.muted) == ValueType.TBool) {
+ if (Std.is(x1.muted, Bool)) {
DejaGnu.pass("Microphone::muted property exists");
} else {
DejaGnu.fail("Microphone::muted property doesn't exist");
@@ -100,34 +110,35 @@
} else {
DejaGnu.fail("Microphone::name property doesn't exist");
}
- //FIXME: once implmented, put in some dummy entries here and test for
- // the proper names
- // if (Std.is(x1.names, Array)) {
- // DejaGnu.pass("Microphone::names property exists");
- // } else {
- // DejaGnu.fail("Microphone::names property doesn't exist");
- // }
- if (Type.typeof(x1.rate) == ValueType.TInt) {
+ if (Std.is(x1.rate, Int)) {
DejaGnu.pass("Microphone::rate property exists");
} else {
DejaGnu.fail("Microphone::rate property doesn't exist");
}
- if (Std.is(x1.silenceLevel, Float)) {
+ if (Std.is(x1.silenceLevel, Int)) {
DejaGnu.pass("Microphone::silenceLevel property exists");
} else {
DejaGnu.fail("Microphone::silenceLevel property doesn't exist");
}
- if (Type.typeof(x1.silenceTimeout) == ValueType.TInt) {
- DejaGnu.pass("Microphone::silenceTimeout property exists");
- } else {
- DejaGnu.fail("Microphone::silenceTimeout property doesn't exist");
- }
+#if flash9
if (Std.is(x1.soundTransform, SoundTransform)) {
DejaGnu.pass("Microphone::soundTransform property exists");
} else {
DejaGnu.fail("Microphone::soundTransform property doesn't exist");
}
- if (Type.typeof(x1.useEchoSuppression) == ValueType.TBool) {
+ if (Std.is(x1.silenceTimeout, Int)) {
+ DejaGnu.pass("Microphone::silenceTimeout property exists");
+ } else {
+ DejaGnu.fail("Microphone::silenceTimeout property doesn't exist");
+ }
+#else
+ if (Std.is(x1.silenceTimeOut, Int)) {
+ DejaGnu.pass("Microphone::silenceTimeOut property exists");
+ } else {
+ DejaGnu.fail("Microphone::silenceTimeOut property doesn't exist");
+ }
+#end
+ if (Std.is(x1.useEchoSuppression, Bool)) {
DejaGnu.pass("Microphone::useEchoSuppression property exists");
} else {
DejaGnu.fail("Microphone::useEchoSuppression property doesn't
exist");
@@ -136,11 +147,24 @@
// 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
if (Type.typeof(x1.setLoopBack) == ValueType.TFunction) {
DejaGnu.pass("Microphone::setLoopBack() method exists");
} else {
DejaGnu.fail("Microphone::setLoopBack() method doesn't exist");
}
+#else
+ if (Type.typeof(x1.setRate) == ValueType.TFunction) {
+ DejaGnu.pass("Microphone::setRate() method exists");
+ } else {
+ DejaGnu.fail("Microphone::setRate() method doesn't exist");
+ }
+ if (Type.typeof(x1.setGain) == ValueType.TFunction) {
+ DejaGnu.pass("Microphone::setGain() method exists");
+ } else {
+ DejaGnu.fail("Microphone::setGain() method doesn't exist");
+ }
+#end
if (Type.typeof(x1.setSilenceLevel) == ValueType.TFunction) {
DejaGnu.pass("Microphone::setSilenceLevel() method exists");
} else {
=== modified file 'testsuite/as3/classes.all/net/SharedObjectFlushStatus_as.hx'
--- a/testsuite/as3/classes.all/net/SharedObjectFlushStatus_as.hx
2009-05-21 00:17:43 +0000
+++ b/testsuite/as3/classes.all/net/SharedObjectFlushStatus_as.hx
2009-06-02 21:47:29 +0000
@@ -1,6 +1,6 @@
// SharedObjectFlushStatus_as.hx: ActionScript 3 "SharedObjectFlushStatus"
class, for Gnash.
//
-// Generated by gen-as3.sh on: 20090514 by "rob". Remove this
+// Generated on: 20090602 by "bnaugle". Remove this
// after any hand editing loosing changes.
//
// Copyright (C) 2009 Free Software Foundation, Inc.
@@ -26,9 +26,6 @@
#if flash9
import flash.net.SharedObjectFlushStatus;
import flash.display.MovieClip;
-#else
-import flash.SharedObjectFlushStatus;
-import flash.MovieClip;
#end
import flash.Lib;
import Type;
@@ -39,21 +36,48 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class SharedObjectFlushStatus_as {
static function main() {
+#if flash9
// Make sure we actually get a valid class
+
if (SharedObjectFlushStatus.FLUSHED != null) {
DejaGnu.pass("SharedObjectFlushStatus.FLUSHED constant exists");
+ if (Std.is(SharedObjectFlushStatus.FLUSHED, String)) {
+ DejaGnu.pass("SharedObjectFlushStatus.FLUSHED is a String");
+ if (Std.string(SharedObjectFlushStatus.FLUSHED) == "flushed") {
+ DejaGnu.pass("SharedObjectFlushStatus.FLUSHED is the
correct string (flushed)");
+ } else {
+ DejaGnu.fail(
+ "SharedObjectFlushStatus.FLUSHED is not the correct
string (Should be flushed, but is "+SharedObjectFlushStatus.FLUSHED+")");
+ }
+ } else {
+ DejaGnu.fail("SharedObjectFlushStatus.FLUSHED is not a string.
Instead, it is a "+Type.typeof(SharedObjectFlushStatus.FLUSHED));
+ }
} else {
DejaGnu.fail("SharedObjectFlushStatus.FLUSHED constant doesn't
exist");
}
if (SharedObjectFlushStatus.PENDING != null) {
DejaGnu.pass("SharedObjectFlushStatus.PENDING constant exists");
+ if (Std.is(SharedObjectFlushStatus.PENDING, String)) {
+ DejaGnu.pass("SharedObjectFlushStatus.PENDING is a String");
+ if (Std.string(SharedObjectFlushStatus.PENDING) == "pending") {
+ DejaGnu.pass("SharedObjectFlushStatus.PENDING is the
correct string (pending)");
+ } else {
+ DejaGnu.fail(
+ "SharedObjectFlushStatus.PENDING is not the correct
string (Should be pending, but is "+SharedObjectFlushStatus.PENDING+")");
+ }
+ } else {
+ DejaGnu.fail("SharedObjectFlushStatus.PENDING is not a string.
Instead, it is a "+Type.typeof(SharedObjectFlushStatus.PENDING));
+ }
} else {
DejaGnu.fail("SharedObjectFlushStatus.PENDING constant doesn't
exist");
}
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
+#else
+ DejaGnu.note("This class (SharedObjectFlushStatus) is only available in
flash9");
+#end
}
}
=== modified file 'testsuite/as3/classes.all/text/TextFormat_as.hx'
--- a/testsuite/as3/classes.all/text/TextFormat_as.hx 2009-05-21 00:17:43
+0000
+++ b/testsuite/as3/classes.all/text/TextFormat_as.hx 2009-06-02 21:47:29
+0000
@@ -1,6 +1,6 @@
// TextFormat_as.hx: ActionScript 3 "TextFormat" class, for Gnash.
//
-// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
+// Generated on: 20090602 by "bnaugle". Remove this
// after any hand editing loosing changes.
//
// Copyright (C) 2009 Free Software Foundation, Inc.
@@ -25,13 +25,14 @@
#if flash9
import flash.text.TextFormat;
-import flash.display.MovieClip;
+import flash.text.TextFormatAlign;
+import flash.text.TextFormatDisplay;
#else
import flash.TextFormat;
-import flash.MovieClip;
#end
import flash.Lib;
import Type;
+import Std;
// import our testing API
import DejaGnu;
@@ -39,10 +40,14 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class TextFormat_as {
static function main() {
- var x1:TextFormat = new TextFormat();
+#if flash9
+ var x1:TextFormat = new
TextFormat("font","size","color","bold","italic","underline","url","target","left","leftMargin","rightMargin","indent","leading");
+#else
+ var x1:TextFormat = new
TextFormat("font",12.0,8,false,false,false,"url","target","align",1.0,1.0,0.0,0.0);
+#end
// Make sure we actually get a valid class
- if (x1 != null) {
+ if (Std.is(x1, TextFormat)) {
DejaGnu.pass("TextFormat class exists");
} else {
DejaGnu.fail("TextFormat class doesn't exist");
@@ -50,106 +55,196 @@
// 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.align == null) {
- DejaGnu.pass("TextFormat.align property exists");
- } else {
- DejaGnu.fail("TextFormat.align property doesn't exist");
- }
- if (x1.blockIndent == Object) {
- DejaGnu.pass("TextFormat.blockIndent property exists");
- } else {
- DejaGnu.fail("TextFormat.blockIndent property doesn't exist");
- }
- if (x1.bold == Object) {
- DejaGnu.pass("TextFormat.bold property exists");
- } else {
- DejaGnu.fail("TextFormat.bold property doesn't exist");
- }
- if (x1.bullet == Object) {
- DejaGnu.pass("TextFormat.bullet property exists");
- } else {
- DejaGnu.fail("TextFormat.bullet property doesn't exist");
- }
- if (x1.color == Object) {
- DejaGnu.pass("TextFormat.color property exists");
- } else {
- DejaGnu.fail("TextFormat.color property doesn't exist");
- }
- if (x1.font == null) {
+#if flash9
+ if (Std.is(x1.blockIndent, Dynamic)) {
+ DejaGnu.pass("TextFormat.blockIndent property exists");
+ } else {
+ DejaGnu.fail("TextFormat.blockIndent property doesn't exist");
+ }
+ if (Std.is(x1.align, String)) {
+ DejaGnu.pass("TextFormat.align property exists");
+ } else {
+ DejaGnu.fail("TextFormat.align property doesn't exist");
+ }
+ if (Std.is(x1.bold, Dynamic)) {
+ DejaGnu.pass("TextFormat.bold property exists");
+ } else {
+ DejaGnu.fail("TextFormat.bold property doesn't exist");
+ }
+ if (Std.is(x1.bullet, Dynamic)) {
+ DejaGnu.pass("TextFormat.bullet property exists");
+ } else {
+ DejaGnu.fail("TextFormat.bullet property doesn't exist");
+ }
+ if (Std.is(x1.color, Dynamic)) {
+ DejaGnu.pass("TextFormat.color property exists");
+ } else {
+ DejaGnu.fail("TextFormat.color property doesn't exist");
+ }
+//FIXME: This only exists in haXe, not in the Adobe specs
+// if (Std.is(x1.display, TextFormatDisplay)) {
+// DejaGnu.pass("TextFormat.display property exists");
+// } else {
+// DejaGnu.fail("TextFormat.display property doesn't exist");
+// }
+ if (Std.is(x1.indent, Dynamic)) {
+ DejaGnu.pass("TextFormat.indent property exists");
+ } else {
+ DejaGnu.fail("TextFormat.indent property doesn't exist");
+ }
+ if (Std.is(x1.italic, Dynamic)) {
+ DejaGnu.pass("TextFormat.italic property exists");
+ } else {
+ DejaGnu.fail("TextFormat.italic property doesn't exist");
+ }
+ if (Std.is(x1.kerning, Dynamic)) {
+ DejaGnu.pass("TextFormat.kerning property exists");
+ } else {
+ DejaGnu.fail("TextFormat.kerning property doesn't exist");
+ }
+ if (Std.is(x1.leading, Dynamic)) {
+ DejaGnu.pass("TextFormat.leading property exists");
+ } else {
+ DejaGnu.fail("TextFormat.leading property doesn't exist");
+ }
+ if (Std.is(x1.leftMargin, Dynamic)) {
+ DejaGnu.pass("TextFormat.leftMargin property exists");
+ } else {
+ DejaGnu.fail("TextFormat.leftMargin property doesn't exist");
+ }
+ if (Std.is(x1.letterSpacing, Dynamic)) {
+ DejaGnu.pass("TextFormat.letterSpacing property exists");
+ } else {
+ DejaGnu.fail("TextFormat.letterSpacing property doesn't exist");
+ }
+ if (Std.is(x1.rightMargin, Dynamic)) {
+ DejaGnu.pass("TextFormat.rightMargin property exists");
+ } else {
+ DejaGnu.fail("TextFormat.rightMargin property doesn't exist");
+ }
+ if (Std.is(x1.size, Dynamic)) {
+ DejaGnu.pass("TextFormat.size property exists");
+ } else {
+ DejaGnu.fail("TextFormat.size property doesn't exist");
+ }
+ if (Std.is(x1.underline, Dynamic)) {
+ DejaGnu.pass("TextFormat.underline property exists");
+ } else {
+ DejaGnu.fail("TextFormat.underline property doesn't exist");
+ }
+#else
+ x1.blockIndent = 0.0;
+ if (Std.is(x1.blockIndent, Float)) {
+ DejaGnu.pass("TextFormat.blockIndent property exists");
+ } else {
+ DejaGnu.fail("TextFormat.blockIndent property doesn't exist");
+ }
+ if (Std.is(x1.align, String)) {
+ DejaGnu.pass("TextFormat.align property exists");
+ } else {
+ DejaGnu.fail("TextFormat.align property doesn't exist");
+ }
+ if (Std.is(x1.bold, Bool)) {
+ DejaGnu.pass("TextFormat.bold property exists");
+ } else {
+ DejaGnu.fail("TextFormat.bold property doesn't exist");
+ }
+ if (Std.is(x1.bullet, Bool)) {
+ DejaGnu.pass("TextFormat.bullet property exists");
+ } else {
+ DejaGnu.fail("TextFormat.bullet property doesn't exist");
+ }
+ if (Std.is(x1.color, Int)) {
+ DejaGnu.pass("TextFormat.color property exists");
+ } else {
+ DejaGnu.fail("TextFormat.color property doesn't exist");
+ }
+ if (Std.is(x1.indent, Float)) {
+ DejaGnu.pass("TextFormat.indent property exists");
+ } else {
+ DejaGnu.fail("TextFormat.indent property doesn't exist");
+ }
+ if (Std.is(x1.italic, Bool)) {
+ DejaGnu.pass("TextFormat.italic property exists");
+ } else {
+ DejaGnu.fail("TextFormat.italic property doesn't exist");
+ }
+ if (Std.is(x1.leading, Float)) {
+ DejaGnu.pass("TextFormat.leading property exists");
+ } else {
+ DejaGnu.fail("TextFormat.leading property doesn't exist");
+ }
+ if (Std.is(x1.leftMargin, Float)) {
+ DejaGnu.pass("TextFormat.leftMargin property exists");
+ } else {
+ DejaGnu.fail("TextFormat.leftMargin property doesn't exist");
+ }
+ if (Std.is(x1.rightMargin, Float)) {
+ DejaGnu.pass("TextFormat.rightMargin property exists");
+ } else {
+ DejaGnu.fail("TextFormat.rightMargin property doesn't exist");
+ }
+ if (Std.is(x1.size, Float)) {
+ DejaGnu.pass("TextFormat.size property exists");
+ } else {
+ DejaGnu.fail("TextFormat.size property doesn't exist");
+ }
+ if (Std.is(x1.underline, Bool)) {
+ DejaGnu.pass("TextFormat.underline property exists");
+ } else {
+ DejaGnu.fail("TextFormat.underline property doesn't exist");
+ }
+#if flash8
+ x1.kerning = false;
+ if (Std.is(x1.kerning, Bool)) {
+ DejaGnu.pass("TextFormat.kerning property exists");
+ } else {
+ DejaGnu.fail("TextFormat.kerning property doesn't exist");
+ }
+ x1.letterSpacing = 0;
+ if (Std.is(x1.letterSpacing, Float)) {
+ DejaGnu.pass("TextFormat.letterSpacing property exists");
+ } else {
+ DejaGnu.fail("TextFormat.letterSpacing property doesn't exist");
+ }
+ if (Std.is(x1.display, String)) {
+ DejaGnu.pass("TextFormat.display property exists");
+ } else {
+ DejaGnu.fail("TextFormat.display property doesn't exist");
+ }
+#end
+#end
+ if (Std.is(x1.font, String)) {
DejaGnu.pass("TextFormat.font property exists");
} else {
DejaGnu.fail("TextFormat.font property doesn't exist");
}
- if (x1.indent == Object) {
- DejaGnu.pass("TextFormat.indent property exists");
- } else {
- DejaGnu.fail("TextFormat.indent property doesn't exist");
- }
- if (x1.italic == Object) {
- DejaGnu.pass("TextFormat.italic property exists");
- } else {
- DejaGnu.fail("TextFormat.italic property doesn't exist");
- }
- if (x1.kerning == Object) {
- DejaGnu.pass("TextFormat.kerning property exists");
- } else {
- DejaGnu.fail("TextFormat.kerning property doesn't exist");
- }
- if (x1.leading == Object) {
- DejaGnu.pass("TextFormat.leading property exists");
- } else {
- DejaGnu.fail("TextFormat.leading property doesn't exist");
- }
- if (x1.leftMargin == Object) {
- DejaGnu.pass("TextFormat.leftMargin property exists");
- } else {
- DejaGnu.fail("TextFormat.leftMargin property doesn't exist");
- }
- if (x1.letterSpacing == Object) {
- DejaGnu.pass("TextFormat.letterSpacing property exists");
- } else {
- DejaGnu.fail("TextFormat.letterSpacing property doesn't exist");
- }
- if (x1.rightMargin == Object) {
- DejaGnu.pass("TextFormat.rightMargin property exists");
- } else {
- DejaGnu.fail("TextFormat.rightMargin property doesn't exist");
- }
- if (x1.size == Object) {
- DejaGnu.pass("TextFormat.size property exists");
- } else {
- DejaGnu.fail("TextFormat.size property doesn't exist");
- }
- if (x1.tabStops == 0) {
+ x1.tabStops = [0,1,2,3];
+ if (Std.is(x1.tabStops, Array)) {
DejaGnu.pass("TextFormat.tabStops property exists");
} else {
DejaGnu.fail("TextFormat.tabStops property doesn't exist");
}
- if (x1.target == null) {
+ if (Std.is(x1.target, String)) {
DejaGnu.pass("TextFormat.target property exists");
} else {
DejaGnu.fail("TextFormat.target property doesn't exist");
}
- if (x1.underline == Object) {
- DejaGnu.pass("TextFormat.underline property exists");
- } else {
- DejaGnu.fail("TextFormat.underline property doesn't exist");
- }
- if (x1.url == null) {
+ if (Std.is(x1.url, String)) {
DejaGnu.pass("TextFormat.url property exists");
} else {
DejaGnu.fail("TextFormat.url property 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 (x1.TextFormat == Object) {
- DejaGnu.pass("TextFormat::TextFormat() method exists");
+#if !flash9
+ if (Type.typeof(x1.getTextExtent) == ValueType.TFunction) {
+ DejaGnu.pass("TextFormat.getTextExtent method exists");
} else {
- DejaGnu.fail("TextFormat::TextFormat() method doesn't exist");
+ DejaGnu.fail("TextFormat.getTextExtent method doesn't exist");
}
-
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
}
=== modified file 'testsuite/as3/classes.all/text/TextRenderer_as.hx'
--- a/testsuite/as3/classes.all/text/TextRenderer_as.hx 2009-05-21 00:17:43
+0000
+++ b/testsuite/as3/classes.all/text/TextRenderer_as.hx 2009-06-02 21:47:29
+0000
@@ -1,6 +1,6 @@
// TextRenderer_as.hx: ActionScript 3 "TextRenderer" class, for Gnash.
//
-// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
+// Generated on: 20090602 by "bnaugle". Remove this
// after any hand editing loosing changes.
//
// Copyright (C) 2009 Free Software Foundation, Inc.
@@ -23,12 +23,12 @@
// This test case must be processed by CPP before compiling to include the
// DejaGnu.hx header file for the testing framework support.
-#if flash9
+#if (flash9 || flash8)
import flash.text.TextRenderer;
-import flash.display.MovieClip;
-#else
-import flash.TextRenderer;
-import flash.MovieClip;
+#end
+#if flash9
+import flash.text.TextDisplayMode;
+import flash.text.AntiAliasType;
#end
import flash.Lib;
import Type;
@@ -39,39 +39,57 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class TextRenderer_as {
static function main() {
- var x1:TextRenderer = new TextRenderer();
+#if (flash8 || flash9)
- // Make sure we actually get a valid class
- if (x1 != null) {
- DejaGnu.pass("TextRenderer class exists");
- } else {
- DejaGnu.fail("TextRenderer 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.displayMode == null) {
+#if flash9
+ if (Std.is(TextRenderer.displayMode, TextDisplayMode)) {
DejaGnu.pass("TextRenderer.displayMode property exists");
} else {
DejaGnu.fail("TextRenderer.displayMode property doesn't exist");
}
- if (x1.maxLevel == 0) {
- DejaGnu.pass("TextRenderer.maxLevel property exists");
- } else {
- DejaGnu.fail("TextRenderer.maxLevel property doesn't exist");
- }
+//FIXME: This property does not exist in the Adobe specs
+ if (Std.is(TextRenderer.antiAliasType, AntiAliasType)) {
+ DejaGnu.pass("TextRenderer.antiAliasType property exists");
+ } else {
+ DejaGnu.fail("TextRenderer.antiAliasType property doesn't exist");
+ }
+ if (Std.is(TextRenderer.maxLevel, Float)) {
+ DejaGnu.pass("TextRenderer.maxLevel property exists");
+ } else {
+ DejaGnu.fail("TextRenderer.maxLevel property doesn't exist");
+ }
+#else
+ if (Std.is(TextRenderer.maxLevel, Int)) {
+ DejaGnu.pass("TextRenderer.maxLevel property exists");
+ } else {
+ DejaGnu.fail("TextRenderer.maxLevel property doesn't exist");
+ }
+#end
// 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 (x1.setAdvancedAntiAliasingTable == null) {
+#if flash9
+ if (Type.typeof(TextRenderer.setAdvancedAntiAliasingTable) ==
ValueType.TFunction) {
DejaGnu.pass("TextRenderer::setAdvancedAntiAliasingTable() method
exists");
} else {
DejaGnu.fail("TextRenderer::setAdvancedAntiAliasingTable() method
doesn't exist");
}
-
+#else
+ if (Type.typeof(TextRenderer.setAdvancedAntialiasingTable) ==
ValueType.TFunction) {
+ DejaGnu.pass("TextRenderer::setAdvancedAntialiasingTable() method
exists");
+ } else {
+ DejaGnu.fail("TextRenderer::setAdvancedAntialiasingTable() method
doesn't exist");
+ }
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
+#else
+ DejaGnu.note("This class (TextRenderer) is only available in flash8 and
flash9");
+#end
}
}
=== modified file 'testsuite/as3/classes.all/text/TextSnapshot_as.hx'
--- a/testsuite/as3/classes.all/text/TextSnapshot_as.hx 2009-05-21 00:17:43
+0000
+++ b/testsuite/as3/classes.all/text/TextSnapshot_as.hx 2009-06-02 21:47:29
+0000
@@ -1,6 +1,6 @@
// TextSnapshot_as.hx: ActionScript 3 "TextSnapshot" class, for Gnash.
//
-// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
+// Generated on: 20090602 by "bnaugle". Remove this
// after any hand editing loosing changes.
//
// Copyright (C) 2009 Free Software Foundation, Inc.
@@ -26,12 +26,15 @@
#if flash9
import flash.text.TextSnapshot;
import flash.display.MovieClip;
-#else
+import flash.display.DisplayObjectContainer;
+import flash.display.Sprite;
+#elseif !flash6
import flash.TextSnapshot;
import flash.MovieClip;
#end
import flash.Lib;
import Type;
+import Std;
// import our testing API
import DejaGnu;
@@ -39,10 +42,17 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class TextSnapshot_as {
static function main() {
- var x1:TextSnapshot = new TextSnapshot();
+#if !flash6
+#if flash9
+ var d1:DisplayObjectContainer = new Sprite();
+ var x1:TextSnapshot = d1.textSnapshot;
+#else
+ var m1:MovieClip = flash.Lib._root;
+ var x1:TextSnapshot = m1.getTextSnapshot();
+#end
// Make sure we actually get a valid class
- if (x1 != null) {
+ if (Std.is(x1, TextSnapshot)) {
DejaGnu.pass("TextSnapshot class exists");
} else {
DejaGnu.fail("TextSnapshot class doesn't exist");
@@ -50,51 +60,61 @@
// 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.charCount == 0) {
+#if flash9
+ if (Std.is(x1.charCount, Int)) {
DejaGnu.pass("TextSnapshot.charCount property exists");
} else {
DejaGnu.fail("TextSnapshot.charCount property doesn't exist");
}
+#end
// 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 (x1.findText == 0) {
+#if !flash9
+ if (Type.typeof(x1.getCount) == ValueType.TFunction) {
+ DejaGnu.pass("TextSnapshot::getCount() method exists");
+ } else {
+ DejaGnu.fail("TextSnapshot::getCount() method doesn't exist");
+ }
+#else
+ if (Type.typeof(x1.getTextRunInfo) == ValueType.TFunction) {
+ DejaGnu.pass("TextSnapshot::getTextRunInfo() method exists");
+ } else {
+ DejaGnu.fail("TextSnapshot::getTextRunInfo() method doesn't exist");
+ }
+#end
+ if (Type.typeof(x1.findText) == ValueType.TFunction) {
DejaGnu.pass("TextSnapshot::findText() method exists");
} else {
DejaGnu.fail("TextSnapshot::findText() method doesn't exist");
}
- if (x1.getSelected == false) {
+ if (Type.typeof(x1.getSelected) == ValueType.TFunction) {
DejaGnu.pass("TextSnapshot::getSelected() method exists");
} else {
DejaGnu.fail("TextSnapshot::getSelected() method doesn't exist");
}
- if (x1.getSelectedText == null) {
+ if (Type.typeof(x1.getSelectedText) == ValueType.TFunction) {
DejaGnu.pass("TextSnapshot::getSelectedText() method exists");
} else {
DejaGnu.fail("TextSnapshot::getSelectedText() method doesn't
exist");
}
- if (x1.getText == null) {
+ if (Type.typeof(x1.getText) == ValueType.TFunction) {
DejaGnu.pass("TextSnapshot::getText() method exists");
} else {
DejaGnu.fail("TextSnapshot::getText() method doesn't exist");
}
- if (x1.getTextRunInfo == 0) {
- DejaGnu.pass("TextSnapshot::getTextRunInfo() method exists");
- } else {
- DejaGnu.fail("TextSnapshot::getTextRunInfo() method doesn't exist");
- }
- if (x1.hitTestTextNearPos == 0) {
+ if (Type.typeof(x1.hitTestTextNearPos) == ValueType.TFunction) {
DejaGnu.pass("TextSnapshot::hitTestTextNearPos() method exists");
} else {
DejaGnu.fail("TextSnapshot::hitTestTextNearPos() method doesn't
exist");
}
- if (x1.setSelectColor == null) {
+ if (Type.typeof(x1.setSelectColor) == ValueType.TFunction) {
DejaGnu.pass("TextSnapshot::setSelectColor() method exists");
} else {
DejaGnu.fail("TextSnapshot::setSelectColor() method doesn't exist");
}
- if (x1.setSelected == null) {
+ if (Type.typeof(x1.setSelected) == ValueType.TFunction) {
DejaGnu.pass("TextSnapshot::setSelected() method exists");
} else {
DejaGnu.fail("TextSnapshot::setSelected() method doesn't exist");
@@ -102,6 +122,9 @@
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
+#else
+ DejaGnu.note("This class (TextSnapshot) is only available in flash7,
flash8, and flash9");
+#end
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10974: More text test cases and fixed error messages,
Bob Naugle <=