[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11420: Minor changes to output of m
From: |
Jon Crider |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11420: Minor changes to output of many test cases for clarity. Major changes to haxe test case display/BitmapData_as.hx. Added much imporved tests for the pp. Will test again in light of recent changes to BitmapData.cpp |
Date: |
Thu, 13 Aug 2009 15:02:02 -0600 |
User-agent: |
Bazaar (1.16.1) |
------------------------------------------------------------
revno: 11420 [merge]
committer: Jon Crider <address@hidden>
branch nick: trunk
timestamp: Thu 2009-08-13 15:02:02 -0600
message:
Minor changes to output of many test cases for clarity. Major changes to haxe
test case display/BitmapData_as.hx. Added much imporved tests for the pp. Will
test again in light of recent changes to BitmapData.cpp
modified:
testsuite/actionscript.all/enumerate.as
testsuite/misc-haxe.all/classes.all/Boolean_as.hx
testsuite/misc-haxe.all/classes.all/accessibility/AccessibilityProperties_as.hx
testsuite/misc-haxe.all/classes.all/accessibility/Accessibility_as.hx
testsuite/misc-haxe.all/classes.all/display/BitmapData_as.hx
testsuite/misc-haxe.all/classes.all/display/Bitmap_as.hx
testsuite/misc-haxe.all/classes.all/display/DisplayObject_as.hx
testsuite/misc-haxe.all/classes.all/display/JointStyle_as.hx
testsuite/misc-haxe.all/classes.all/display/LineScaleMode_as.hx
testsuite/misc-haxe.all/classes.all/display/LoaderInfo_as.hx
testsuite/misc-haxe.all/classes.all/display/Loader_as.hx
testsuite/misc-haxe.all/classes.all/display/PixelSnapping_as.hx
testsuite/misc-haxe.all/classes.all/display/Shape_as.hx
testsuite/misc-haxe.all/classes.all/display/SimpleButton_as.hx
testsuite/misc-haxe.all/classes.all/display/SpreadMethod_as.hx
testsuite/misc-haxe.all/classes.all/display/Sprite_as.hx
testsuite/misc-haxe.all/classes.all/display/StageAlign_as.hx
testsuite/misc-haxe.all/classes.all/display/StageDisplayState_as.hx
testsuite/misc-haxe.all/classes.all/display/StageQuality_as.hx
testsuite/misc-haxe.all/classes.all/display/StageScaleMode_as.hx
testsuite/misc-haxe.all/classes.all/net/Responder_as.hx
testsuite/misc-haxe.all/classes.all/net/URLVariables_as.hx
testsuite/misc-haxe.all/classes.all/system/ApplicationDomain_as.hx
testsuite/misc-haxe.all/classes.all/system/IMEConversionMode_as.hx
testsuite/misc-haxe.all/classes.all/system/IME_as.hx
testsuite/misc-haxe.all/classes.all/system/LoaderContext_as.hx
testsuite/misc-haxe.all/classes.all/system/SecurityDomain_as.hx
testsuite/misc-haxe.all/classes.all/system/SecurityPanel_as.hx
testsuite/misc-haxe.all/classes.all/text/StyleSheet_as.hx
testsuite/misc-haxe.all/classes.all/text/TextColorType_as.hx
testsuite/misc-haxe.all/classes.all/text/TextDisplayMode_as.hx
testsuite/misc-haxe.all/classes.all/text/TextFieldAutoSize_as.hx
testsuite/misc-haxe.all/classes.all/text/TextFieldType_as.hx
testsuite/misc-haxe.all/classes.all/text/TextFormatAlign_as.hx
testsuite/misc-haxe.all/classes.all/text/TextFormat_as.hx
testsuite/misc-haxe.all/classes.all/utils/Proxy_as.hx
=== modified file 'testsuite/actionscript.all/enumerate.as'
--- a/testsuite/actionscript.all/enumerate.as 2009-05-20 10:37:32 +0000
+++ b/testsuite/actionscript.all/enumerate.as 2009-08-13 20:51:30 +0000
@@ -218,7 +218,7 @@
push 'stackfirst'
push 'a'
getvariable
- enumerate2
+ enumerate
setregister r:0
push 'r0', r:0
setvariable
=== modified file 'testsuite/misc-haxe.all/classes.all/Boolean_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/Boolean_as.hx 2009-07-08 18:19:35
+0000
+++ b/testsuite/misc-haxe.all/classes.all/Boolean_as.hx 2009-08-13 20:51:30
+0000
@@ -43,15 +43,16 @@
// So far I have been unable to find a workaround for this. For now
we
// will be unable to compile these test for flash9.
#if flash9
- DejaGnu.note("These tests do not currently compile in flash version 9");
+ DejaGnu.note("These tests do not currently compile in flash version 9:
see comments in Boolean_as.hx");
+
#else
//check_equals(typeof(Boolean), 'function');
if ( untyped __typeof__(Boolean) == 'function') {
DejaGnu.pass("Boolean class exists");
- } else {
+ } else {
DejaGnu.fail("Boolean class does not exist");
- }
+ }
//check_equals(typeof(Boolean()), 'undefined');
if ( untyped __typeof__(Boolean()) == 'undefined') {
DejaGnu.pass("Call to Boolean() returns null");
=== modified file
'testsuite/misc-haxe.all/classes.all/accessibility/AccessibilityProperties_as.hx'
---
a/testsuite/misc-haxe.all/classes.all/accessibility/AccessibilityProperties_as.hx
2009-05-29 22:35:14 +0000
+++
b/testsuite/misc-haxe.all/classes.all/accessibility/AccessibilityProperties_as.hx
2009-08-13 20:51:30 +0000
@@ -48,41 +48,76 @@
if (x1 != null) {
DejaGnu.pass("AccessibilityProperties class exists");
} else {
- DejaGnu.fail("AccessibilityProperties lass doesn't exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties
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.description, String)) {
+ // 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 ( untyped x1.hasOwnProperty('description') ) {
DejaGnu.pass("AccessibilityProperties::description property
exists");
} else {
- DejaGnu.fail("AccessibilityProperties::description property doesn't
exist");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties::description
property doesn't exist");
}
- if (Type.typeof(x1.forceSimple) == ValueType.TBool) {
+ if ( untyped __typeof__(x1.description) == 'string') {
+ DejaGnu.pass("AccessibilityProperties.description is a string");
+ } else {
+
DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties.description is
not a string");
+ }
+
+ if ( untyped x1.hasOwnProperty('forceSimple')) {
DejaGnu.pass("AccessibilityProperties::forceSimple property
exists");
} else {
- DejaGnu.fail("AccessibilityProperties::forceSimple property doesn't
exist");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties::forceSimple
property doesn't exist");
}
- if (Std.is(x1.name, String)) {
+ if ( untyped __typeof__(x1.forceSimple) == 'boolean') {
+ DejaGnu.pass("AccessibilityProperties.forceSimple is a boolean");
+ } else {
+
DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties.forceSimple is
not a boolean");
+ }
+
+ if ( untyped x1.hasOwnProperty('name')) {
DejaGnu.pass("AccessibilityProperties::name property exists");
} else {
- DejaGnu.fail("AccessibilityProperties::name property doesn't
exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties::name
property doesn't exist");
}
- if (Type.typeof(x1.noAutoLabeling) == ValueType.TBool) {
+ if ( untyped __typeof__(x1.name) == 'string') {
+ DejaGnu.pass("AccessibilityProperties.name is a string");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties.name is
not a string");
+ }
+
+ if (untyped x1.hasOwnProperty('noAutoLabeling')) {
DejaGnu.pass("AccessibilityProperties::noAutoLabeling property
exists");
} else {
- DejaGnu.fail("AccessibilityProperties::noAutoLabeling property
doesn't exist");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties::noAutoLabeling
property doesn't exist");
}
- if (Std.is(x1.shortcut, String)) {
+ if ( untyped __typeof__(x1.noAutoLabeling) == 'boolean') {
+ DejaGnu.pass("AccessibilityProperties.noAutoLabeling is a boolean");
+ } else {
+
DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties.noAutoLabeling is
not a boolean");
+ }
+
+ if (untyped x1.hasOwnProperty('shortcut')) {
DejaGnu.pass("AccessibilityProperties::shortcut property exists");
} else {
- DejaGnu.fail("AccessibilityProperties::shortcut property doesn't
exist");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties::shortcut
property doesn't exist");
}
- if (Std.is(x1.silent, String)) {
+ if (untyped __typeof__(x1.shortcut) == 'string') {
+ DejaGnu.pass("AccessibilityProperties.shortcut is a string");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties.shortcut
is not a string");
+ }
+
+ if (untyped x1.hasOwnProperty('silent')) {
DejaGnu.pass("AccessibilityProperties::silent property exists");
} else {
- DejaGnu.fail("AccessibilityProperties::silent property doesn't
exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties::silent
property doesn't exist");
}
+ if (untyped __typeof__(x1.silent) == 'boolean') {
+ DejaGnu.pass("AccessibilityProperties.silent is a boolean");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]AccessibilityProperties.silent
is not a boolean");
+ }
#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
=== modified file
'testsuite/misc-haxe.all/classes.all/accessibility/Accessibility_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/accessibility/Accessibility_as.hx
2009-06-19 21:10:38 +0000
+++ b/testsuite/misc-haxe.all/classes.all/accessibility/Accessibility_as.hx
2009-08-13 20:51:30 +0000
@@ -42,6 +42,7 @@
import flash.Lib;
import Type;
import Reflect;
+import haxe.PosInfos;
// import our testing API
import DejaGnu;
@@ -61,43 +62,29 @@
// false
// flash.accessibility.Accessibility
// sendEvent
-
- DejaGnu.note("ME1 " + Type.typeof(Accessibility.active));
- DejaGnu.note("ME2 " + Type.getClass(Accessibility.active));
- DejaGnu.note("ME3 " + Std.string(Accessibility.active));
- DejaGnu.note("ME4 " + Std.is(Accessibility.active,ValueType.TObject));
- DejaGnu.note("ME5 " + Type.getClassName(Accessibility));
- DejaGnu.note("ME6 " + Type.getClassFields(Accessibility)[0]);
if (Type.typeof(Accessibility.active) == ValueType.TBool) {
- DejaGnu.pass("Accessibility::active property exists");
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility::active
property exists");
} else {
- DejaGnu.fail("Accessibility::active property doesn't exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility::active
property doesn't exist");
}
// Test for existence of updateProperties method
// updateProperties throws error if Capabilities.hasAccessability ==
false
if ( flash.system.Capabilities.hasAccessibility != false ) {
if (Accessibility.updateProperties() != null) {
- DejaGnu.pass("Accessibility::updateProperties() method
exists");
+
DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility::updateProperties() method
exists");
} else {
- DejaGnu.fail("Accessibility::updateProperties() method
doesn't exist");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility::updateProperties() method
doesn't exist");
}
}
#else
- DejaGnu.note("ME1 " + Type.typeof(Accessibility.isActive()));
- DejaGnu.note("ME2 " + Type.getClass(Accessibility.isActive));
- DejaGnu.note("ME3 " + Std.string(Accessibility.isActive));
- DejaGnu.note("ME4 " +
Std.is(Accessibility.isActive,ValueType.TFunction));
- DejaGnu.note("ME5 " +
Type.getClassName(Type.getClass(Accessibility)));
-// DejaGnu.note("ME6 " + Type.getClassFields(Accessibility.isActive));
- DejaGnu.note("ME7 " + Reflect.isFunction(Accessibility.isActive));
- DejaGnu.note("ME8 " + Reflect.isObject(Accessibility.isActive));
+
if (Type.typeof(Accessibility.isActive) == ValueType.TFunction) {
- DejaGnu.pass("Accessibility::isActive method exists");
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility::isActive
method exists");
} else {
- DejaGnu.fail("Accessibility::isActive method doesn't exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility::isActive
method doesn't exist");
}
// Tests to see if all the methods exist. All these do is test for
@@ -106,9 +93,9 @@
DejaGnu.note("ME1A " + Type.typeof(Accessibility.updateProperties()));
if (Type.typeof(Accessibility.updateProperties) == ValueType.TFunction)
{
- DejaGnu.pass("Accessibility::updateProperties() method exists");
+
DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility::updateProperties() method
exists");
} else {
- DejaGnu.fail("Accessibility::updateProperties() method doesn't
exist");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility::updateProperties() method
doesn't exist");
}
#end
//Si
@@ -122,104 +109,122 @@
#else
var accobj = untyped __new__(Accessibility);
if (Std.string(untyped __typeof__(accobj)) == 'undefined') {
- DejaGnu.pass("Type of accobj is undefined");
-} else {
- DejaGnu.fail("Type of accObj is not undefined");
-}
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Type of accobj is
undefined");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Type of accObj is not
undefined");
+ }
#end
//Check the prototype.
#if flash9
//Do Nothing!
#else
- DejaGnu.note("__proto__: " + Type.typeof(untyped
Accessibility.__proto__));
if ( Reflect.isObject(untyped Accessibility.__proto__)) {
- DejaGnu.pass("Accessibility.prototype.__proto_ field exists");
+
DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility.prototype.__proto_ field
exists");
} else {
- DejaGnu.fail("Accessibility.prototype.__proto__ field does not
exist");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility.prototype.__proto__ field
does not exist");
}
if ( untyped Accessibility.__proto__ == untyped Object.prototype) {
- DejaGnu.pass("Accessibility.prototype.__proto__ references
Object.prototype");
+
DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility.prototype.__proto__
references Object.prototype");
} else {
- DejaGnu.fail("Accessibility.prototype.__proto__ does not
reference Object.prototype");
+
DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility.prototype.__proto__ does
not reference Object.prototype");
}
#end
-#if (flash6 || flash7 || flash8)
+#if flash9
+ if (untyped Accessibility.hasOwnProperty("active")) {
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility. 'active'
property exists");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility. 'active'
property does not exist");
+ }
+ if (Std.is(untyped Accessibility.active, Bool) ){
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility.active is a
bool");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility.active is not a
bool");
+ }
+#else
if (untyped Accessibility.hasOwnProperty("isActive")) {
- DejaGnu.pass("Accessibility.prototype. 'isActive' property
exists");
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility.prototype.
'isActive' property exists");
} else {
- DejaGnu.fail("Accessibility.prototype. 'isActive' property does
not exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility.prototype.
'isActive' property does not exist");
}
if (Type.typeof(untyped Accessibility.isActive)== TFunction){
- DejaGnu.pass("System.security 'isActive' is a function");
- } else {
- DejaGnu.fail("System.security 'isActive' is not a function");
- }
- if (Std.is(untyped Accessibility.isActive, Bool) ){
- DejaGnu.xpass("Accessibility.isActive should be a Bool!!!!
WARNING!!!");
- } else {
- DejaGnu.xfail("Accessibility.isActive is not a Bool.");
- }
-#end
-#if flash9
- if (untyped Accessibility.hasOwnProperty("active")) {
- DejaGnu.pass("Accessibility. 'active' property exists");
- } else {
- DejaGnu.fail("Accessibility. 'active' property does not exist");
- }
- if (Std.is(untyped Accessibility.active, Bool) ){
- DejaGnu.pass("Accessibility.active is a bool");
- } else {
- DejaGnu.fail("Accessibility.active is not a bool");
- }
-#end
+ DejaGnu.pass("[ln:"+here.lineNumber+"]System.security
'isActive' is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]System.security 'isActive' is
not a function");
+ }
+
+ // This was set to xfail in the ming, but seems to pass now in both the pp
+ // and gnash
+ //xcheck_equals ( typeof(Accessibility.isActive()), 'boolean' );
+ if ( untyped __typeof__(Reflect.callMethod(Accessibility,
+ Reflect.field(Accessibility, 'isActive'),
+ []) == 'boolean') ){
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility.isActive should be
a Bool!!!! WARNING!!!");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility.isActive is not
a Bool.");
+ }
+#end
+
if (untyped Accessibility.hasOwnProperty("updateProperties")) {
- DejaGnu.pass("Accessibility.prototype. 'updateProperties' property
exists");
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility.prototype.
'updateProperties' property exists");
} else {
- DejaGnu.fail("Accessibility.prototype. 'updateProperties'
property does not exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility.prototype.
'updateProperties' property does not exist");
}
if (untyped Accessibility.hasOwnProperty("sendEvent")) {
- DejaGnu.pass("Accessibility.prototype. 'sendEvent' property exists");
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Accessibility.prototype.
'sendEvent' property exists");
} else {
- DejaGnu.fail("Accessibility.prototype. 'sendEvent' property
does not exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Accessibility.prototype.
'sendEvent' property does not exist");
}
if (Type.typeof(untyped Accessibility.updateProperties)== TFunction){
- DejaGnu.pass("System.security 'updateProperties' is a
function");
+ DejaGnu.pass("[ln:"+here.lineNumber+"]System.security
'updateProperties' is a function");
} else {
- DejaGnu.fail("System.security 'updateProperties' is not a
function");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]System.security
'updateProperties' is not a function");
}
if (Type.typeof(untyped Accessibility.sendEvent)== TFunction){
- DejaGnu.pass("System.security 'sendEvent' is a function");
+ DejaGnu.pass("[ln:"+here.lineNumber+"]System.security
'sendEvent' is a function");
} else {
- DejaGnu.fail("System.security 'sendEvent' is not a function");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]System.security 'sendEvent'
is not a function");
}
- //These two methods are only defined in SWF 5. Ignored!
+ //These two methods are only defined in SWF 5. haxe does not compile
SWF5!
// Methods return void (just undefined in SWF 5).
-// Si
-// Make sure the return type is reight.
-// DejaGnu.note(""+untyped __typeof__(Accessibility.updateProperties()) );
-// DejaGnu.note(""+untyped __typeof__(Accessibility.sendEvent()) );
+ // Make sure the return type is reight.
+ // DejaGnu.note(""+untyped __typeof__(Accessibility.updateProperties()) );
+ // DejaGnu.note(""+untyped __typeof__(Accessibility.sendEvent()) );
#if flash9
#else
- if (Std.string(untyped __typeof__(Accessibility.updateProperties() ))==
'undefined'){
- DejaGnu.pass("The return type of Accessibility.updateProperties
is void (good).");
- } else {
- DejaGnu.fail("The rerurn type of Accessibility.updateProperties is
somewhat defined (wrong).");
- }
-/*
- if (Std.string(untyped __typeof__(Accessibility.sendEvent() ) )==
'undefined'){
- DejaGnu.pass("The return type of Accessibility.sendEvent is
void (good).");
- } else {
- DejaGnu.fail("The rerurn type of Accessibility.sendEvent() is
somewhat defined (wrong).");
- }
-*/
-#end
-/*
-// Accessibility object can't be instantiated !
-var accObj = new Accessibility;
-check_equals(accObj, undefined);
-*/
+ if (untyped __typeof__(Reflect.callmethod(Accessibility,
+ Reflect.field(Accessibility,
'updateProperties'),
+ [] )) == 'undefined'){
+ DejaGnu.pass("[ln:"+here.lineNumber+"]The return type of
Accessibility.updateProperties is void (good).");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]The rerurn type of
Accessibility.updateProperties is somewhat defined (wrong).");
+ }
+
+ if (untyped __typeof__(Reflect.callmethod(Accessibility,
+ Reflect.field(Accessibility, 'sendEvent'),
+ [] )) == 'undefined'){
+ DejaGnu.pass("[ln:"+here.lineNumber+"]The return type of
Accessibility.sendEvent is void (good).");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]The rerurn type of
Accessibility.sendEvent() is somewhat defined (wrong).");
+ }
+
+#end
+
+#if !flash9
+ // This test crashes the pp in SWF 9 because Accessibility cannot be
+ // instantiated
+
+ // Accessibility object can't be instantiated !
+ var accObj = untyped __new__(Accessibility);
+ //check_equals(accObj, undefined);
+ if (untyped __typeof__(accObj == 'undefined')) {
+ DejaGnu.pass("[ln:"+here.lineNumber+"]Correctly did not instantiate an
Accesibility object");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Unexpected return with call to
new on Accessibility");
+ }
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/BitmapData_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/BitmapData_as.hx
2009-06-15 22:28:03 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/BitmapData_as.hx
2009-08-13 20:51:30 +0000
@@ -28,18 +28,21 @@
import flash.utils.ByteArray;
import flash.display.DisplayObject;
import flash.display.MovieClip;
+import flash.display.BitmapData;
import flash.display.Bitmap;
+import flash.Error;
#end
#if flash8
import flash.MovieClip;
+import flash.display.BitmapData;
#end
#if (flash8 || flash9)
import flash.geom.Rectangle;
-import flash.display.BitmapData;
#end
import flash.Lib;
import Type;
import Std;
+import haxe.PosInfos;
// import our testing API
import DejaGnu;
@@ -47,283 +50,715 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class BitmapData_as {
static function main() {
+
#if !(flash6 || flash7)
- if(Type.typeof(untyped BitmapData) == ValueType.TFunction) {
+
+ #if flash8
+ DejaGnu.note("*** Class/Method/Property existence tests
[ln:"+here.lineNumber+"]");
+ //check_equals(typeof(Bitmap), 'function');
+ if(untyped __typeof__(BitmapData) == 'function') {
DejaGnu.pass("BitmapData is a function");
} else {
- DejaGnu.fail("BitmapData is not a function");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData is not a
function");
}
- if(Type.typeof(untyped BitmapData.prototype) ==
ValueType.TObject) {
+ //check_equals(typeof(Bitmap.prototype), 'object');
+ if(untyped __typeof__(BitmapData.prototype) == 'object') {
DejaGnu.pass("BitmapData prototype is an object");
} else {
- DejaGnu.fail("BitmapData prototype is not an object");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData prototype is not
an object");
}
if(untyped BitmapData.prototype.hasOwnProperty('applyFilter')) {
DejaGnu.pass("BitmapData prototype has 'applyFilter'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'applyFilter' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData prototype does
not have 'applyFilter' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('clone')) {
DejaGnu.pass("BitmapData prototype has 'clone'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'clone' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData prototype does
not have 'clone' property");
}
if(untyped
BitmapData.prototype.hasOwnProperty('colorTransform')) {
DejaGnu.pass("BitmapData prototype has 'colorTransform'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'colorTransform' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData prototype does
not have 'colorTransform' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('copyChannel')) {
DejaGnu.pass("BitmapData prototype has 'copyChannel'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'copyChannel' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'copyChannel' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('copyPixels')) {
DejaGnu.pass("BitmapData prototype has 'copyPixels'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'copyPixels' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'copyPixels' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('dispose')) {
DejaGnu.pass("BitmapData prototype has 'dispose'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'dispose' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'dispose' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('draw')) {
DejaGnu.pass("BitmapData prototype has 'draw'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have 'draw'
property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'draw' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('fillRect')) {
DejaGnu.pass("BitmapData prototype has 'fillRect'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'fillRect' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'fillRect' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('floodFill')) {
DejaGnu.pass("BitmapData prototype has 'floodFill'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'floodFill' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'floodFill' property");
}
if(untyped
BitmapData.prototype.hasOwnProperty('generateFilterRect')) {
DejaGnu.pass("BitmapData prototype has
'generateFilterRect' property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'generateFilterRect' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'generateFilterRect' property");
}
if(untyped
BitmapData.prototype.hasOwnProperty('getColorBoundsRect')) {
DejaGnu.pass("BitmapData prototype has
'getColorBoundsRect' property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'getColorBoundsRect' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'getColorBoundsRect' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('getPixel')) {
DejaGnu.pass("BitmapData prototype has 'getPixel'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'getPixel' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'getPixel' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('getPixel32')) {
DejaGnu.pass("BitmapData prototype has 'getPixel32'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'getPixel32' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'getPixel32' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('hitTest')) {
DejaGnu.pass("BitmapData prototype has 'hitTest'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'hitTest' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'hitTest' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('merge')) {
DejaGnu.pass("BitmapData prototype has 'merge'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'merge' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'merge' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('noise')) {
DejaGnu.pass("BitmapData prototype has 'noise'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'noise' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"] BitmapData
prototype does not have 'noise' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('paletteMap')) {
DejaGnu.pass("BitmapData prototype has 'paletteMap'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'paletteMap' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'paletteMap' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('perlinNoise')) {
DejaGnu.pass("BitmapData prototype has 'perlinNoise'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'perlinNoise' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'perlinNoise' property");
}
if(untyped
BitmapData.prototype.hasOwnProperty('pixelDissolve')) {
DejaGnu.pass("BitmapData prototype has 'pixelDissolve'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'pixelDissolve' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'pixelDissolve' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('scroll')) {
DejaGnu.pass("BitmapData prototype has 'scroll'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'scroll' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'scroll' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('setPixel')) {
DejaGnu.pass("BitmapData prototype has 'setPixel'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'setPixel' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'setPixel' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('setPixel32')) {
DejaGnu.pass("BitmapData prototype has 'setPixel32'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'setPixel32' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'setPixel32' property");
}
if(untyped BitmapData.prototype.hasOwnProperty('threshold')) {
DejaGnu.pass("BitmapData prototype has 'threshold'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'threshold' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'threshold' property");
}
- if(untyped BitmapData.prototype.hasOwnProperty("height")) {
+ if(untyped BitmapData.prototype.hasOwnProperty('height')) {
DejaGnu.pass("BitmapData prototype has 'height'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'height' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'height' property");
}
- if(untyped BitmapData.prototype.hasOwnProperty("width")) {
+ if(untyped BitmapData.prototype.hasOwnProperty('width')) {
DejaGnu.pass("BitmapData prototype has 'width'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'width' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'width' property");
}
- if(untyped BitmapData.prototype.hasOwnProperty("rectangle")) {
+ if(untyped BitmapData.prototype.hasOwnProperty('rectangle')) {
DejaGnu.pass("BitmapData prototype has 'rectangle'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'rectangle' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'rectangle' property");
}
- if(untyped BitmapData.prototype.hasOwnProperty("transparent")) {
+ if(untyped BitmapData.prototype.hasOwnProperty('transparent')) {
DejaGnu.pass("BitmapData prototype has 'transparent'
property");
} else {
- DejaGnu.fail("BitmapData prototype does not have
'transparent' property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'transparent' property");
}
if(!(untyped
BitmapData.prototype.hasOwnProperty('loadBitmap'))) {
DejaGnu.pass("BitmapData prototype does not have
'loadBitmap' property");
} else {
- DejaGnu.fail("BitmapData prototype has 'loadBitmap'
property");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype has 'loadBitmapData' property");
}
- if(untyped BitmapData.hasOwnProperty("loadBitmap")) {
+ if(untyped BitmapData.hasOwnProperty('loadBitmap')) {
DejaGnu.pass("BitmapData has 'loadBitmap' property");
} else {
- DejaGnu.fail("BitmapData does not have 'loadBitmap'
property");
- }
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'loadBitmap' property");
+ }
+
+ #else
+
+ DejaGnu.note("*** Class/Method/Property existence tests
[ln:"+here.lineNumber+"]");
+ // In flash 9 we seem to need an instance of the object to test these.
+ // This is probably because of the difference in the way inheritance
+ // and class objects work
+ var bdata = new BitmapData(200, 300);
+ //check_equals(typeof(Bitmap), 'function');
+ if(untyped __typeof__(BitmapData) == 'object') {
+ DejaGnu.pass("BitmapData is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData is not
a function");
+ }
+ //check_equals(typeof(Bitmap.prototype), 'object');
+ if(untyped __typeof__(BitmapData.prototype) == 'object') {
+ DejaGnu.pass("BitmapData is an object");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData is not
an object");
+ }
+
+ if(untyped bdata.hasOwnProperty('applyFilter')) {
+ DejaGnu.pass("BitmapData has 'applyFilter' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'applyFilter' property");
+ }
+ if(untyped bdata.hasOwnProperty('clone')) {
+ DejaGnu.pass("BitmapData has 'clone' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'clone' property");
+ }
+ if(untyped bdata.hasOwnProperty('colorTransform')) {
+ DejaGnu.pass("BitmapData has 'colorTransform'
property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'colorTransform' property");
+ }
+ if(untyped bdata.hasOwnProperty('copyChannel')) {
+ DejaGnu.pass("BitmapData has 'copyChannel' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'copyChannel' property");
+ }
+ if(untyped bdata.hasOwnProperty('copyPixels')) {
+ DejaGnu.pass("BitmapData has 'copyPixels' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'copyPixels' property");
+ }
+ if(untyped bdata.hasOwnProperty('dispose')) {
+ DejaGnu.pass("BitmapData has 'dispose' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'dispose' property");
+ }
+ if(untyped bdata.hasOwnProperty('draw')) {
+ DejaGnu.pass("BitmapData has 'draw' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'draw' property");
+ }
+ if(untyped bdata.hasOwnProperty('fillRect')) {
+ DejaGnu.pass("BitmapData has 'fillRect' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'fillRect' property");
+ }
+ if(untyped bdata.hasOwnProperty('floodFill')) {
+ DejaGnu.pass("BitmapData has 'floodFill' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'floodFill' property");
+ }
+ if(untyped bdata.hasOwnProperty('generateFilterRect')) {
+ DejaGnu.pass("BitmapData has 'generateFilterRect'
property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'generateFilterRect' property");
+ }
+ if(untyped bdata.hasOwnProperty('getColorBoundsRect')) {
+ DejaGnu.pass("BitmapData has 'getColorBoundsRect'
property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData
prototype does not have 'getColorBoundsRect' property");
+ }
+ if(untyped bdata.hasOwnProperty('getPixel')) {
+ DejaGnu.pass("BitmapData has 'getPixel' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'getPixel' property");
+ }
+ if(untyped bdata.hasOwnProperty('getPixel32')) {
+ DejaGnu.pass("BitmapData has 'getPixel32' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'getPixel32' property");
+ }
+ if(untyped bdata.hasOwnProperty('hitTest')) {
+ DejaGnu.pass("BitmapData has 'hitTest' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'hitTest' property");
+ }
+ if(untyped bdata.hasOwnProperty('merge')) {
+ DejaGnu.pass("BitmapData has 'merge' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'merge' property");
+ }
+ if(untyped bdata.hasOwnProperty('noise')) {
+ DejaGnu.pass("BitmapData has 'noise' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'noise' property");
+ }
+ if(untyped bdata.hasOwnProperty('paletteMap')) {
+ DejaGnu.pass("BitmapData has 'paletteMap' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'paletteMap' property");
+ }
+ if(untyped bdata.hasOwnProperty('perlinNoise')) {
+ DejaGnu.pass("BitmapData has 'perlinNoise' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'perlinNoise' property");
+ }
+ if(untyped bdata.hasOwnProperty('pixelDissolve')) {
+ DejaGnu.pass("BitmapData has 'pixelDissolve' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'pixelDissolve' property");
+ }
+ if(untyped bdata.hasOwnProperty('scroll')) {
+ DejaGnu.pass("BitmapData has 'scroll' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'scroll' property");
+ }
+ if(untyped bdata.hasOwnProperty('setPixel')) {
+ DejaGnu.pass("BitmapData has 'setPixel' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'setPixel' property");
+ }
+ if(untyped bdata.hasOwnProperty('setPixel32')) {
+ DejaGnu.pass("BitmapData has 'setPixel32' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'setPixel32' property");
+ }
+ if(untyped bdata.hasOwnProperty('threshold')) {
+ DejaGnu.pass("BitmapData has 'threshold' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'threshold' property");
+ }
+ if(untyped bdata.hasOwnProperty('height')) {
+ DejaGnu.pass("BitmapData has 'height' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'height' property");
+ }
+ if(untyped bdata.hasOwnProperty('width')) {
+ DejaGnu.pass("BitmapData has 'width' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'width' property");
+ }
+ if(untyped bdata.hasOwnProperty('rect')) {
+ DejaGnu.pass("BitmapData has 'rectangle' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'rectangle' property");
+ }
+ if(untyped bdata.hasOwnProperty('transparent')) {
+ DejaGnu.pass("BitmapData has 'transparent' property");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'transparent' property");
+ }
+ //NOTE: This property supposedly does not exist in flash9 (according to
+ // the Adobe livedocs but this test seems to pass anyway
+ if( !(untyped bdata.hasOwnProperty('loadBitmap')) ) {
+ DejaGnu.pass("BitmapData 'loadBitmap' property exists
even though livedocs claim it doesn't");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData does
not have 'loadBitmap' property");
+ }
+
+ #end
+
+ //Testing that functions are actually functions
+ var x1 = new BitmapData(20, 30, false, 0xeeddee);
+ // Change these, but keep them
+ if (Type.typeof(x1.applyFilter) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::applyFilter() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::applyFilter() is not a function");
+ }
+ if (Type.typeof(x1.clone) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::clone() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"] BitmapData::clone()
is not a function");
+ }
+ if (Type.typeof(x1.colorTransform) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::colorTransform() is a
function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::colorTransform() is not a function");
+ }
+ #if flash9
+ if (Type.typeof(x1.compare) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::compare() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::compare() is not a function");
+ }
+ #end
+ if (Type.typeof(x1.copyChannel) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::copyChannel() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::copyChannel() is not a function");
+ }
+ if (Type.typeof(x1.copyPixels) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::copyPixels() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::copyPixels() is not a function");
+ }
+ if (Type.typeof(x1.dispose) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::dispose() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::dispose() is not a function");
+ }
+ if (Type.typeof(x1.draw) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::draw() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::draw() is not a function");
+ }
+ if (Type.typeof(x1.generateFilterRect) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::generateFilterRect() is a
function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::generateFilterRect() is not a function");
+ }
+ if (Type.typeof(x1.getColorBoundsRect) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::getColorBoundsRect() is a
function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::getColorBoundsRect() is not a function");
+ }
+ #if flash9
+ if (Type.typeof(x1.getPixels) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::getPixels() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::getPixels() is not a function");
+ }
+ //FIXME: These method exists in HaXe API Documentation, but is not
supported, and does not exist in Adobe documentation
+ // if (Type.typeof(x1.getVector) == ValueType.TFunction) {
+ // DejaGnu.pass("BitmapData::getVector() method exists");
+ // } else {
+ // DejaGnu.fail("BitmapData::getVector() is not a function");
+ // }
+ // if (Type.typeof(x1.histogram) == ValueType.TFunction) {
+ // DejaGnu.pass("BitmapData::histogram() method exists");
+ // } else {
+ // DejaGnu.fail("BitmapData::histogram() is not a function");
+ // }
+ #end
+ if (Type.typeof(x1.hitTest) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::hitTest() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::hitTest() is not a function");
+ }
+ #if flash9
+ if (Type.typeof(x1.lock) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::lock() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::lock() is not a function");
+ }
+ #end
+ if (Type.typeof(x1.merge) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::merge() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::merge() is not a function");
+ }
+ if (Type.typeof(x1.noise) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::noise() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::noise() is not a function");
+ }
+ if (Type.typeof(x1.paletteMap) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::paletteMap() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::paletteMap() is not a function");
+ }
+ if (Type.typeof(x1.perlinNoise) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::perlinNoise() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::perlinNoise() is not a function");
+ }
+ if (Type.typeof(x1.pixelDissolve) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::pixelDissolve() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::pixelDissolve() is not a function");
+ }
+ if (Type.typeof(x1.scroll) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::scroll() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::scroll() is not a function");
+ }
+ #if flash9
+ if (Type.typeof(x1.setPixels) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::setPixels() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::setPixels() is not a function");
+ }
+ //FIXME: This method exists in HaXe API Documentation, but is not
supported, and does not exist in Adobe documentation
+ // if (Type.typeof(x1.setVector) == ValueType.TFunction) {
+ // DejaGnu.pass("BitmapData::setVector() method exists");
+ // } else {
+ // DejaGnu.fail("BitmapData::setVector() is not a function");
+ // }
+ #end
+ if (Type.typeof(x1.threshold) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::threshold() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::threshold() is not a function");
+ }
+ #if flash9
+ if (Type.typeof(x1.unlock) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::unlock() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::unlock() is not a function");
+ }
+ #else
+ if (Type.typeof(BitmapData.loadBitmap) == ValueType.TFunction) {
+ DejaGnu.pass("BitmapData::loadBitmap() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::loadBitmap() is not a function");
+ }
+ #end
//-------------------------------------------------------------
// Test constructor
//-------------------------------------------------------------
+ DejaGnu.note("*** BitmapData Constructor Tests ***");
+
+ #if flash8
+ DejaGnu.note("** Ctor BitmapData()[ln:"+here.lineNumber+"]");
+ var bmpNoArg:BitmapData = untyped __new__(BitmapData);
- var x1:BitmapData = Reflect.callMethod(BitmapData,
Reflect.field(BitmapData, 'new'), []);
- if(Type.typeof(x1) == ValueType.TNull) {
- DejaGnu.pass("Type of x1 is undefined");
+ //FIXME: This test illustrates a problem in gnash that nobody has fixed
+ if(untyped __typeof__(bmpNoArg) == 'undefined') {
+ DejaGnu.pass("Bitmap constructor with no args returned
undefined");
} else {
- DejaGnu.fail("Type of x1 should be undefined, is
"+Type.typeof(x1));
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Bitmap
constructor did not return undefined");
}
-
- //FIXME: I simply don't understand this test series. If someone
would enlighten me
- //as to the function of the hasOwnProperty method, I would
gladly listen.
-
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [10, 10]);
- //if(Type.typeof(x1) == ValueType.TObject) {
- //DejaGnu.pass("x1 is an object");
- //} else {
- //DejaGnu.fail("x1 should be an object, is
"+Type.typeof(x1));
- //}
- //if(Std.is(x1, BitmapData)) {
- //DejaGnu.pass("x1 is a BitmapData");
- //} else {
- //DejaGnu.fail("x1 should be a BitmapData, is
"+Type.getClassName(Type.getClass(x1)));
- //}
- //if(!untyped x1.hasOwnProperty("height")) {
- //DejaGnu.pass("x1 does not have property 'height'");
- //} else {
- //DejaGnu.fail("x1 has property 'height'");
- //}
- //if(!untyped x1.hasOwnProperty("width")) {
- //DejaGnu.pass("x1 does not have property 'width'");
- //} else {
- //DejaGnu.fail("x1 has property 'width'");
- //}
- //if(!untyped x1.hasOwnProperty("rectangle")) {
- //DejaGnu.pass("x1 does not have property 'rectangle'");
- //} else {
- //DejaGnu.fail("x1 has property 'rectangle'");
- //}
- //if(!untyped x1.hasOwnProperty("transparent")) {
- //DejaGnu.pass("x1 does not have property
'transparent'");
- //} else {
- //DejaGnu.fail("x1 has property 'transparent'");
- //}
- //if(x1.height == 10) {
- //DejaGnu.pass("x1.height == 10");
- //} else {
- //DejaGnu.fail("x1.height != 10");
- //}
- //if(x1.width == 10) {
- //DejaGnu.pass("x1.width == 10");
- //} else {
- //DejaGnu.fail("x1.width != 10");
- //}
- //if(x1.transparent) {
- //DejaGnu.pass("x1.transparent is true");
- //} else {
- //DejaGnu.fail("x1.transparent is false");
- //}
-//#if flash9
- //if(x1.rect.toString() == "(x=0, y=0, w=10, h=10)") {
- //DejaGnu.pass("x1.rectangle is correct rectangle (x=0,
y=0, w=10, h=10)");
- //} else {
- //DejaGnu.fail("x1.rectangle should be (x=0, y=0, w=10,
h=10), is "+x1.rect.toString());
- //}
- //if(Std.is(x1.rect, Rectangle)) {
- //DejaGnu.pass("x1.rectangle is a Rectangle");
- //} else {
- //DejaGnu.fail("x1.rectangle is not a Rectangle, it is
a "+Type.typeof(x1.rect));
- //}
-//#else
- //if(x1.rectangle.toString() == "(x=0, y=0, w=10, h=10)") {
- //DejaGnu.pass("x1.rectangle is correct rectangle (x=0,
y=0, w=10, h=10)");
- //} else {
- //DejaGnu.fail("x1.rectangle should be (x=0, y=0, w=10,
h=10), is "+x1.rectangle.toString());
- //}
- //if(Std.is(x1.rectangle, Rectangle)) {
- //DejaGnu.pass("x1.rectangle is a Rectangle");
- //} else {
- //DejaGnu.fail("x1.rectangle is not a Rectangle, it is
a "+Type.typeof(x1.rectangle));
- //}
-//#end
- //if(x1.getPixel(1,1) == 16777215) {
- //DejaGnu.pass("x1.getPixel(1,1) returns correct number
(16777215)");
- //} else {
- //DejaGnu.fail("x1.getPixel(1,1) should return
16777215, returns "+x1.getPixel(1,1));
- //}
- //if(x1.getPixel(9,9) == 16777215) {
- //DejaGnu.pass("x1.getPixel(9,9) returns correct number
(16777215)");
- //} else {
- //DejaGnu.fail("x1.getPixel(9,9) should return
16777215, returns "+x1.getPixel(9,9));
- //}
- //if(x1.getPixel32(1,1) == -1) {
- //DejaGnu.pass("x1.getPixel32(1,1) returns correct
number (-1)");
- //} else {
- //DejaGnu.fail("x1.getPixel32(1,1) should return -1,
returns "+x1.getPixel32(1,1));
- //}
-
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [10, 10, true]);
- //if(x1.getPixel32(1,1) == -1) {
- //DejaGnu.pass("x1.getPixel32(1,1) returns correct
number (-1)");
- //} else {
- //DejaGnu.fail("x1.getPixel32(1,1) should return -1,
returns "+x1.getPixel32(1,1));
- //}
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [10, 10, false]);
- //if(x1.getPixel32(1,1) == -1) {
- //DejaGnu.pass("x1.getPixel32(1,1) returns correct
number (-1)");
- //} else {
- //DejaGnu.fail("x1.getPixel32(1,1) should return -1,
returns "+x1.getPixel32(1,1));
- //}
-
- x1 = new BitmapData(20, 30, false, 0xeeddee);
-
+ #else
+ //NOTE: Should Gnash throw an error here too?
+ // finally figured out how to make a test out of this with try ..
catch
+ // will probably have to individually test error codes to see what
each
+ // errorID is
+ DejaGnu.note("The PP throws an error if we call the constructor with
no arguments");
+ try {
+ var bmpNoArg:BitmapData = untyped __new__(BitmapData);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData() did not
throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("Ctor BitmapData() correctly threw an error, id: " +
e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("Ctor BitmapData() correctly threw
'ArgumentError' id: " + e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor did not throw
'ArgumentError', error caught: " + e);
+ }
+ }
+
+ #end
+
+ DejaGnu.note("** Ctor BitmapData(10, 10)[ln:"+here.lineNumber+"]");
+ var bmp = new BitmapData(10, 10);
+ //check_equals(typeof(bmp), 'object');
+ if (untyped __typeof__(bmp) == 'object') {
+ DejaGnu.pass("Constructor BitmapData(10, 10) returns an object");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor BitmapData(10,
10) did not return an object");
+ }
+
+ //NOTE: flash 9 does not have the instanceof function, however the haxe
+ // function Std.is seems to work in SWF8 & 9. This probably needs more
+ // investigation
+ //check(bmp instanceof Bitmap);
+ if (Std.is(bmp, BitmapData)) {
+ DejaGnu.pass("bmp is an instance of a BitmapData");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp is not an instance of a
BitmapData");
+ }
+
+
+ #if flash8
+ //NOTE: The pp gives different behavior here between SWF8 and SWF9.
This
+ // has to do with the differences in property inheritance and the
+ // hasOwnProperty function between the two versions
+
+ // These are prototype properties in flash8 and don't exist on
instances
+ //check(!bmp.hasOwnProperty("height"));
+ if ( !(untyped bmp.hasOwnProperty('height')) ) {
+ DejaGnu.pass("Constructor did not set the 'height' property for
bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor set the 'height'
property for bmp");
+ }
+ //check(!bmp.hasOwnProperty("width"));
+ if ( !(untyped bmp.hasOwnProperty("width")) ) {
+ DejaGnu.pass("Constructor did not set the 'width' property for
bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor set the 'width'
property for bmp");
+ }
+ //check(!bmp.hasOwnProperty("rectangle"));
+ if ( !(untyped bmp.hasOwnProperty('rectangle')) ) {
+ DejaGnu.pass("Constructor did not set the 'rectangle' property for
bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor set the
'rectangle' property for bmp");
+ }
+ //check(!bmp.hasOwnProperty("transparent"));
+ if ( !(untyped bmp.hasOwnProperty('transparent')) ) {
+ DejaGnu.pass("Constructor did not set the 'transparent' property
for bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor set the
'transparent' property for bmp");
+ }
+ #else
+ //These are object properties in flash9 that the instance should have
+ if ( untyped bmp.hasOwnProperty('height') ) {
+ DejaGnu.pass("Constructor set the 'height' property for bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor did not set the
'height' property for bmp");
+ }
+ if ( untyped bmp.hasOwnProperty("width") ) {
+ DejaGnu.pass("Constructor set the 'width' property for bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor did not set the
'width' property for bmp");
+ }
+ //NOTE: need to check 'rect' for flash 9
+ if ( untyped bmp.hasOwnProperty('rect') ) {
+ DejaGnu.pass("Constructor set the 'rect' property for bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor did not set the
'rect' property for bmp");
+ }
+ if ( untyped bmp.hasOwnProperty('transparent') ) {
+ DejaGnu.pass("Constructor set the 'transparent' property for bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor did not set the
'transparent' property for bmp");
+ }
+ #end
+ //check_equals(bmp.height, 10);
+ if (bmp.height == 10) {
+ DejaGnu.pass("bmp.height == 10 after construction");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height != 10 after
construction");
+ }
+ //check_equals(bmp.width, 10);
+ if (bmp.width == 10) {
+ DejaGnu.pass("bmp.width == 10 after construction");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.width != 10 after
construction");
+ }
+ //check_equals(bmp.transparent, true);
+ if (bmp.transparent == true) {
+ DejaGnu.pass("bmp.transparent == true after construction");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.transparent != true
after construction");
+ }
+ #if flash8
+ //check_equals(bmp.rectangle.toString(), "(x=0, y=0, w=10, h=10)");
+ if (bmp.rectangle.toString() == "(x=0, y=0, w=10, h=10)") {
+ DejaGnu.pass("bmp.rectangle initialized correctly during
construction");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.rectangle not
initialized correctly during construction");
+ }
+ //check(bmp.rectangle instanceOf flash.geom.Rectangle);
+ if (Std.is(bmp.rectangle, flash.geom.Rectangle)) {
+ DejaGnu.pass("bmp.rectangle is an instance of a rectangle");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.rectangle is not an
instance of a rectangle");
+ }
+ #else
+ if (bmp.rect.toString() == "(x=0, y=0, w=10, h=10)") {
+ DejaGnu.pass("bmp.rect initialized correctly during construction");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.rect not initialized
correctly during construction");
+ }
+ //check(bmp.rectangle instanceOf flash.geom.Rectangle);
+ if (Std.is(bmp.rect, flash.geom.Rectangle)) {
+ DejaGnu.pass("bmp.rect is an instance of a rectangle");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.rect is not an instance
of a rectangle");
+ }
+ #end
+ //check_equals(bmp.getPixel(1, 1), 16777215);
+ if (bmp.getPixel(1,1) == 16777215) {
+ DejaGnu.pass("bmp pixel (1, 1,) initialized correctly");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp pixel (1, 1) was not
initialized correctly");
+ }
+ //check_equals(bmp.getPixel(9, 9), 16777215);
+ if (bmp.getPixel(9, 9) == 16777215) {
+ DejaGnu.pass("bmp pixel (9, 9) initialized correctly");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp pixel (9, 9) was not
initialized correctly");
+ }
+ #if flash8
+ //NOTE: The pp returns different numbers here based on the version.
+ // Different precission values are returned based on version
+
+ // The livedocs claim that SWF8 returns a Number, which is a double-
+ // precission IEEE-754 value
+
+ //check_equals(bmp.getPixel32(1, 1), -1);
+ if (bmp.getPixel32(1, 1) == -1) {
+ DejaGnu.pass("bmp.getPixel32(1, 1) correctly returned -1");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.getPixel32(1 1) did not
return correctly");
+ }
+ #else
+ // The livedocs claim that SWF9 returns a uint value, which is a 32 bit
+ // unsigned integer
+ if (bmp.getPixel32(1, 1) == 4294967295) {
+ DejaGnu.pass("bmp.getPixel32(1, 1) correctly returns 4294967295");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.getPixel32(1, 1) did not
return correctly");
+ }
+ #end
+
+
+ DejaGnu.note("** Ctor BitmapData(10, 10,
true)[ln:"+here.lineNumber+"]");
+ bmp = new BitmapData(10, 10, true);
+ //see previous note about precission
+ #if flash8
+ //check_equals(bmp.getPixel32(1, 1), -1);
+ if (bmp.getPixel32(1, 1) == -1) {
+ DejaGnu.pass("Ctor BitmapData(10, 10, true) created correct (1, 1)
pixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor BitmapData(10,
10, true) did not operate correctly");
+ }
+ #else
+ if (bmp.getPixel32(1, 1) == 4294967295) {
+ DejaGnu.pass("Ctor BitmapData(10, 10, true) created correct (1, 1)
pixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor BitmapData(10,
10, true) did not operate correctly");
+ }
+ #end
+
+ DejaGnu.note("** Ctor BitmapData(10, 10,
false)[ln:"+here.lineNumber+"]");
+ bmp = new BitmapData(10, 10, false);
+ //see previous note about precission
+ #if flash8
+ //check_equals(bmp.getPixel32(1, 1), -1);
+ if (bmp.getPixel32(1, 1) == -1) {
+ DejaGnu.pass("Ctor BitmapData(10, 10, false) created correct (1,
1) pixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(10, 10,
false) did not operate correctly");
+ }
+ #else
+ if (bmp.getPixel32(1, 1) == 4294967295) {
+ DejaGnu.pass("Ctor BitmapData(10, 10, true) created correct (1, 1)
pixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Constructor BitmapData(10,
10, true) did not operate correctly");
+ }
+ #end
+
+
+ DejaGnu.note("** Ctor BitmapData(10, 30, false,
0xeeddee)[ln:"+here.lineNumber+"]");
+ var x1 = new BitmapData(20, 30, false, 0xeeddee);
// check(x1 instanceof Bitmap);
if (Std.is(x1,BitmapData)) {
- DejaGnu.pass("BitmapData class exists");
+ DejaGnu.pass("x1 is an instance of a BitmapData");
} else {
- DejaGnu.fail("BitmapData lass doesn't exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]x1 is not an instance of a
BitmapData");
}
//check_equals(x1.height, 10);
@@ -332,7 +767,8 @@
if (x1.height == 30) {
DejaGnu.pass("BitmapData.height property is
correct int (30)");
} else {
- DejaGnu.fail("BitmapData.height property is
incorrect int (should be 30, is "+x1.height+")");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData.height " +
+ "property is incorrect int (should be 30, is
"+x1.height+")");
}
} else {
DejaGnu.fail("BitmapData::height property doesn't
exist");
@@ -343,10 +779,11 @@
if (x1.width == 20) {
DejaGnu.pass("BitmapData.width property is
correct int (20)");
} else {
- DejaGnu.fail("BitmapData.width property is
incorrect int (should be 20, is "+x1.width+")");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData.width
property"
+ + "is incorrect int (should be 20, is
"+x1.width+")");
}
} else {
- DejaGnu.fail("BitmapData::width property doesn't
exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::width property
doesn't exist");
}
//check_equals(x1.transparent, true);
if (Type.typeof(x1.transparent) == ValueType.TBool) {
@@ -354,588 +791,902 @@
if (x1.transparent == false) {
DejaGnu.pass("BitmapData.transparent property
is correct bool (false)");
} else {
- DejaGnu.fail("BitmapData.transparent property
is incorrect bool (should be false, is "+x1.transparent+")");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData.transparent" +
+ "property is incorrect bool (should be false, is
"+
+ x1.transparent+")");
}
} else {
- DejaGnu.fail("BitmapData::transparent property doesn't
exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::transparent
property doesn't exist");
}
-#if flash9
+ #if flash9
//check_equals(x1.rect.toString(), "(x=0, y=0, w=10, h=10)");
if (Std.is(x1.rect, Rectangle)) {
DejaGnu.pass("BitmapData::rect property exists");
if (x1.rect.toString() == "(x=0, y=0, w=20, h=30)") {
DejaGnu.pass("BitmapData.rect property is
correct rectangle (x=0, y=0, w=20, h=30)");
} else {
- DejaGnu.fail("BitmapData.rect property is
incorrect rectangle (should be (x=0, y=0, w=20, h=30), is
"+x1.rect.toString()+")");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData.rect property
is incorrect rectangle (should be (x=0, y=0, w=20, h=30), is
"+x1.rect.toString()+")");
}
} else {
- DejaGnu.fail("BitmapData::rect property doesn't exist");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::rect property
doesn't exist");
}
-#else
+ #else
//check_equals(x1.rectangle.toString(), "(x=0, y=0, w=10,
h=10)");
if (Std.is(x1.rectangle, Rectangle)) {
DejaGnu.pass("BitmapData::rectangle property exists");
if (x1.rectangle.toString() == "(x=0, y=0, w=20,
h=30)") {
DejaGnu.pass("BitmapData.rectangle property is
correct rectangle (x=0, y=0, w=20, h=30)");
} else {
- DejaGnu.fail(
- "BitmapData.rectangle property is incorrect
rectangle (should be (x=0, y=0, w=20, h=30), is "+x1.rectangle.toString()+")");
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData.rectangle
property is incorrect rectangle (should be (x=0, y=0, w=20, h=30), is
"+x1.rectangle.toString()+")");
}
} else {
DejaGnu.fail("BitmapData::rectangle property doesn't
exist");
}
-#end
+ #end
//check_equals(bmp.getPixel(1, 1), 0xeeddee);
- if (Type.typeof(x1.getPixel) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::getPixel() method exists");
- if (Type.typeof(x1.getPixel(1,1)) == ValueType.TInt) {
- DejaGnu.pass("BitmapData::getPixel() method
returns correct type (number)");
- if (x1.getPixel(1,1) == 0xeeddee) {
- DejaGnu.pass("BitmapData::getPixel(1,1)
method returns correct number (0xeeddee)");
- } else {
- DejaGnu.fail("BitmapData::getPixel(1,1)
method returns incorrect number (should be 0xeeddee, is "+x1.getPixel(1,1)+")");
- }
- //check_equals(bmp.getPixel(50, 1), 0);
- if (x1.getPixel(50,1) == 0) {
-
DejaGnu.pass("BitmapData::getPixel(50,1) returns correct value (0)");
- } else {
-
DejaGnu.fail("BitmapData::getPixel(50,1) returns incorrect value (should be 0,
is "+x1.getPixel(50,1)+")");
- }
- //check_equals(bmp.getPixel(0, 0), 15654382);
- if (x1.getPixel(0,0) == 0xeeddee) {
- DejaGnu.pass("BitmapData::getPixel(0,0)
returns correct value (0xeeddee)");
- } else {
- DejaGnu.fail("BitmapData::getPixel(0,0)
returns incorrect value (should be 0xeeddee, is "+x1.getPixel(0,0)+")");
- }
- //check_equals(bmp.getPixel(-2, -5), 0);
- if (x1.getPixel(-2,-5) == 0) {
-
DejaGnu.pass("BitmapData::getPixel(-2,-5) returns correct value (0)");
- } else {
-
DejaGnu.fail("BitmapData::getPixel(-2,-5) returns incorrect value (should be 0,
is "+x1.getPixel(-2,-5)+")");
- }
- //check_equals(bmp.getPixel(20, 30), 0);
- if (x1.getPixel(20,30) == 0) {
-
DejaGnu.pass("BitmapData::getPixel(20,30) returns correct value (0)");
- } else {
-
DejaGnu.fail("BitmapData::getPixel(20,30) returns incorrect value (should be 0,
is "+x1.getPixel(20,30)+")");
- }
- } else {
- DejaGnu.fail("BitmapData::getPixel() method
returns incorrect type (should be number, is
"+Type.typeof(x1.getPixel(1,1))+")");
- }
- } else {
- DejaGnu.fail("BitmapData::getPixel() method doesn't
exist");
- }
+ if (x1.getPixel(1,1) == 0xeeddee) {
+ DejaGnu.pass("BitmapData::getPixel(1,1) method returns correct
number (0xeeddee)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::getPixel(1,1)
method returns incorrect number (should be 0xeeddee, is "+x1.getPixel(1,1)+")");
+ }
+ //check_equals(bmp.getPixel(50, 1), 0);
+ if (x1.getPixel(50,1) == 0) {
+ DejaGnu.pass("BitmapData::getPixel(50,1) returns correct value
(0)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::getPixel(50,1)
returns incorrect value (should be 0, is "+x1.getPixel(50,1)+")");
+ }
+ //check_equals(bmp.getPixel(0, 0), 15654382);
+ if (x1.getPixel(0,0) == 0xeeddee) {
+ DejaGnu.pass("BitmapData::getPixel(0,0) returns correct value
(0xeeddee)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::getPixel(0,0)
returns incorrect value (should be 0xeeddee, is "+x1.getPixel(0,0)+")");
+ }
+ //check_equals(bmp.getPixel(-2, -5), 0);
+ if (x1.getPixel(-2,-5) == 0) {
+ DejaGnu.pass("BitmapData::getPixel(-2,-5) returns correct value
(0)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::getPixel(-2,-5)
returns incorrect value (should be 0, is "+x1.getPixel(-2,-5)+")");
+ }
+ //check_equals(bmp.getPixel(20, 30), 0);
+ if (x1.getPixel(20,30) == 0) {
+ DejaGnu.pass("BitmapData::getPixel(20,30) returns correct value
(0)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::getPixel(20,30)
returns incorrect value (should be 0, is "+x1.getPixel(20,30)+")");
+ }
+
+
//check_equals(bmp.getPixel32(1, 1), -1122834);
- if (Type.typeof(x1.getPixel32) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::getPixel32() method exists");
- //getPixel32() should return a float in AS2, and a uint
in AS3.
+ //getPixel32() should return a float in AS2, and a uint in AS3.
#if !flash9
- if (Type.typeof(x1.getPixel32(1,1)) ==
ValueType.TFloat) {
- DejaGnu.xpass("BitmapData::getPixel32() method
returns correct type (number)");
+ if (untyped __typeof__(x1.getPixel32(1,1)) == 'number') {
+ DejaGnu.pass("BitmapData::getPixel32() method returns correct type
(number)");
+ if (x1.getPixel32(1,1) == -1122834) {
+ DejaGnu.pass("BitmapData::getPixel32() method returns correct
number (-01122834)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::getPixel32()
method returns incorrect number (should be -01122834, is
"+x1.getPixel32(1,1)+")");
+ }
+ } else {
+ DejaGnu.fail("BitmapData::getPixel32() method returns incorrect
type (should be number, is "+untyped __typeof__(x1.getPixel32(1,1))+")");
+ }
#else
- if (Type.typeof(x1.getPixel32(1,1)) ==
ValueType.TFloat) {
- DejaGnu.pass("BitmapData::getPixel32() method
returns correct type (int)");
-#end
- if (x1.getPixel32(1,1) == -1122834) {
- DejaGnu.pass("BitmapData::getPixel32()
method returns correct number (-01122834)");
- } else {
- DejaGnu.fail("BitmapData::getPixel32()
method returns incorrect number (should be -01122834, is
"+x1.getPixel32(1,1)+")");
- }
- } else {
- DejaGnu.xfail("BitmapData::getPixel32() method
returns incorrect type (should be number, is
"+Type.typeof(x1.getPixel32(1,1))+")");
- }
- } else {
- DejaGnu.fail("BitmapData::getPixel32() method doesn't
exist");
- }
-
- //RESUME
HERE***********************************************************************************************************
- ////bmp = new Bitmap(10000, 3);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [10000, 3]);
- ////xcheck_equals(typeof(bmp), "undefined");
- //if(Type.typeof(x1) == ValueType.TNull) {
- //DejaGnu.xpass("Type of x1 is undefined");
- //} else {
- //DejaGnu.xfail("Type of x1 should be undefined, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, undefined);
- //if(x1.height == null) {
- //DejaGnu.pass("x1.height is undefined");
- //} else {
- //DejaGnu.fail("x1.height should be undefined, is
"+x1.height);
- //}
-
- ////bmp = new Bitmap(0, 10000);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [0, 10000]);
- ////xcheck_equals(typeof(bmp), "undefined");
- //if(Type.typeof(x1) == ValueType.TNull) {
- //DejaGnu.xpass("Type of x1 is undefined");
- //} else {
- //DejaGnu.xfail("Type of x1 should be undefined, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, undefined);
- //if(x1.height == null) {
- //DejaGnu.pass("x1.height is undefined");
- //} else {
- //DejaGnu.fail("x1.height should be undefined, is
"+x1.height);
- //}
-
- ////bmp = new Bitmap(2880, 2880);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [2880, 2880]);
- ////check_equals(typeof(bmp), "object");
- //if(Type.typeof(x1) == ValueType.TObject) {
- //DejaGnu.xpass("Type of x1 is object");
- //} else {
- //DejaGnu.xfail("Type of x1 should be object, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, 2880);
- //if(x1.height == 2880) {
- //DejaGnu.pass("x1.height is 2880");
- //} else {
- //DejaGnu.fail("x1.height should be 2880, is
"+x1.height);
- //}
-
- ////bmp = new Bitmap(2880, 2881);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [2880, 2881]);
- ////xcheck_equals(typeof(bmp), "undefined");
- //if(Type.typeof(x1) == ValueType.TNull) {
- //DejaGnu.xpass("Type of x1 is undefined");
- //} else {
- //DejaGnu.xfail("Type of x1 should be undefined, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, undefined);
- //if(x1.height == null) {
- //DejaGnu.pass("x1.height is undefined");
- //} else {
- //DejaGnu.fail("x1.height should be undefined, is
"+x1.height);
- //}
-
- ////bmp = new Bitmap(0, 2880);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [0, 2880]);
- ////xcheck_equals(typeof(bmp), "undefined");
- //if(Type.typeof(x1) == ValueType.TNull) {
- //DejaGnu.xpass("Type of x1 is undefined");
- //} else {
- //DejaGnu.xfail("Type of x1 should be undefined, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, undefined);
- //if(x1.height == null) {
- //DejaGnu.pass("x1.height is undefined");
- //} else {
- //DejaGnu.fail("x1.height should be undefined, is
"+x1.height);
- //}
-
- ////bmp = new Bitmap(2879, 2879);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [2879, 2879]);
- ////check_equals(typeof(bmp), "object");
- //if(Type.typeof(x1) == ValueType.TObject) {
- //DejaGnu.xpass("Type of x1 is object");
- //} else {
- //DejaGnu.xfail("Type of x1 should be object, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, 2879);
- //if(x1.height == 2879) {
- //DejaGnu.pass("x1.height is 2879");
- //} else {
- //DejaGnu.fail("x1.height should be 2879, is
"+x1.height);
- //}
-
- ////bmp = new Bitmap(0, 2879);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [0, 2879]);
- ////xcheck_equals(typeof(bmp), "undefined");
- //if(Type.typeof(x1) == ValueType.TNull) {
- //DejaGnu.xpass("Type of x1 is undefined");
- //} else {
- //DejaGnu.xfail("Type of x1 should be undefined, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, undefined);
- //if(x1.height == null) {
- //DejaGnu.pass("x1.height is undefined");
- //} else {
- //DejaGnu.fail("x1.height should be undefined, is
"+x1.height);
- //}
-
- ////bmp = new Bitmap(-1, 10, false, 0xff);
- //x1 = Reflect.callMethod(BitmapData, Reflect.field(BitmapData,
'new'), [-1, 10, false, 0xff]);
- ////xcheck_equals(typeof(bmp), "undefined");
- //if(Type.typeof(x1) == ValueType.TNull) {
- //DejaGnu.xpass("Type of x1 is undefined");
- //} else {
- //DejaGnu.xfail("Type of x1 should be undefined, is
"+Type.typeof(x1));
- //}
- ////check_equals(bmp.height, undefined);
- //if(x1.height == null) {
- //DejaGnu.pass("x1.height is undefined");
- //} else {
- //DejaGnu.fail("x1.height should be undefined, is
"+x1.height);
- //}
-
+ if ( untyped __typeof__(x1.getPixel32(1,1)) == 'number') {
+ DejaGnu.pass("BitmapData::getPixel32() method returns correct type
'number'");
+ if (x1.getPixel32(1,1) == 4293844462) {
+ DejaGnu.pass("BitmapData::getPixel32() method returns correct
number (4293844462)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData::getPixel32()
method returns incorrect number (should be 4293844462, is
"+x1.getPixel32(1,1)+")");
+ }
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]BitmapData::getPixel32()
method returns incorrect type (should be number, is "+untyped
__typeof__(x1.getPixel32(1,1))+")");
+ }
+#end
+
+ // Testing limits on constructor values:
+ // 2880 is the maximum dimension value, 1 the minimum. Returns
+ // undefined if the dimensions are invalid.
+ DejaGnu.note("*** Ctor limit tests [ln:"+here.lineNumber+"]");
+
+
+ //bmp = new Bitmap(2880, 2880);
+ var bmp = new BitmapData(2880, 2880);
+ //check_equals(typeof(bmp), "object");
+ if (untyped __typeof__(bmp) == 'object') {
+ DejaGnu.pass("Ctor BitmapData(2880, 2880) returned an 'object'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(2880, 2880)
did not return an 'object'");
+ }
+ //check_equals(bmp.height, 2880);
+ if ( bmp.height == 2880) {
+ DejaGnu.pass("bmp.height value is 2880");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
2880");
+ }
+
+ //bmp = new Bitmap(2879, 2879);
+ bmp = new BitmapData(2879, 2879);
+ //check_equals(typeof(bmp), "object");
+ if (untyped __typeof__(bmp) == 'object') {
+ DejaGnu.pass("Ctor BitmapData(2879, 2879) returned 'object'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(2879, 2879)
did not return an 'object'");
+ }
+ //check_equals(bmp.height, 2879);
+ if ( bmp.height == 2879) {
+ DejaGnu.pass("bmp.height value is 2879");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
2879");
+ }
+
+ #if flash8
+ //bmp = new Bitmap(10000, 3);
+ bmp = new BitmapData(10000, 3);
+ //xcheck_equals(typeof(bmp), "undefined");
+ if (untyped __typeof__(bmp) == 'undefined') {
+ DejaGnu.xpass("Ctor BitmapData(10000, 3) returned 'undefined'");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]Ctor BitmapData(10000, 3)
returned an object instead of 'undefined'");
+ }
+ //check_equals(bmp.height, undefined);
+ if ( bmp.height == null) {
+ DejaGnu.pass("bmp.height value is 'undefined'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
'undefined'");
+ }
+
+ //bmp = new Bitmap(0, 10000)
+ bmp = new BitmapData(0, 10000);
+ //xcheck_equals(typeof(bmp), "undefined");
+ if (untyped __typeof__(bmp) == 'undefined') {
+ DejaGnu.xpass("Ctor BitmapData(0, 10000) returned 'undefined'");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]Ctor BitmapData(0, 10000)
returned an object instead of 'undefined'");
+ }
+ //check_equals(bmp.height, undefined);
+ if ( bmp.height == null) {
+ DejaGnu.pass("bmp.height value is 'undefined'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
'undefined'");
+ }
+
+ //bmp = new Bitmap(2880, 2881);
+ bmp = new BitmapData(2880, 2881);
+ //xcheck_equals(typeof(bmp), "undefined");
+ if (untyped __typeof__(bmp) == 'undefined') {
+ DejaGnu.xpass("Ctor BitmapData(2880, 2881) returned 'undefined'");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]Ctor BitmapData(2880, 2881)
returned an object instead of 'undefined'");
+ }
+ //check_equals(bmp.height, undefined);
+ if ( bmp.height == null) {
+ DejaGnu.pass("bmp.height value is 'undefined'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
'undefined'");
+ }
+
+ //bmp = new Bitmap(0, 2880);
+ bmp = new BitmapData(0, 2880);
+ //xcheck_equals(bmp, undefined);
+ if (untyped __typeof__(bmp) == 'undefined') {
+ DejaGnu.xpass("Ctor BitmapData(0, 2880) returned 'undefined'");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]Ctor BitmapData(0, 2880)
returned an object instead of 'undefined'");
+ }
+ //check_equals(bmp.height, undefined);
+ if ( bmp.height == null) {
+ DejaGnu.pass("bmp.height value is 'undefined'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
'undefined'");
+ }
+
+ //bmp = new Bitmap(0, 2879);
+ bmp = new BitmapData(0, 2879);
+ //xcheck_equals(bmp, undefined);
+ if (untyped __typeof__(bmp) == 'undefined') {
+ DejaGnu.xpass("Ctor BitmapData(0, 2879) returned 'undefined'");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]Ctor BitmapData(0, 2879)
returned an object instead of 'undefined'");
+ }
+ //check_equals(bmp.height, undefined);
+ if ( bmp.height == null) {
+ DejaGnu.pass("bmp.height value is 'undefined'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
'undefined'");
+ }
+
+ //bmp = new Bitmap(-1, 10, false, 0xff);
+ bmp = new BitmapData(-1, 10, false, 0xff);
+ //xcheck_equals(bmp, undefined);
+ if (untyped __typeof__(bmp) == 'undefined') {
+ DejaGnu.xpass("Ctor BitmapData(-1, 10, false, 0xff) returned
'undefined'");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]Ctor BitmapData(-1, 10,
false, 0xff) returned an object instead of 'undefined'");
+ }
+ //check_equals(bmp.height, undefined)
+ if ( bmp.height == null) {
+ DejaGnu.pass("bmp.height value is 'undefined'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]bmp.height value is not
'undefined'");
+ }
+
+ #else
+
+ //NOTE: Gnash should also throw SWF errors here
+ DejaGnu.note("The pp throws an 'ArgumentError' in SWF9 if we try to
call a constructor with out of bounds arguments");
+
+ //bmp = new Bitmap(0, 10000
+ try {
+ bmp = new BitmapData(10000, 3);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(10000, 3)
did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("Ctor BitmapData(10000, 3) correctly threw an error,
id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("Ctor correctly threw 'ArgumentError' id: " +
e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor did not throw
'ArgumentError'; error caught: " + e);
+ }
+ }
+
+ //bmp = new Bitmap(0, 10000)
+ try {
+ bmp = new BitmapData(0, 10000);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(0, 10000)
did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("Ctor BitmapData(10, 10000) correctly threw an error,
id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("Ctor correctly threw 'ArgumentError' id: " +
e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor did not throw
'ArgumentError'; error caught: " + e);
+ }
+ }
+
+ //bmp = new Bitmap(2880, 2881);
+ try {
+ bmp = new BitmapData(2880, 2881);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(2880, 2881)
did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("Ctor BitmapData(2880, 2881) correctly threw an
error, id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("Ctor correctly threw 'ArgumentError' id: " +
e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor did not throw
'ArgumentError'; error caught: " + e);
+ }
+ }
+
+ //bmp = new Bitmap(0, 2880);
+ try {
+ bmp = new BitmapData(0, 2880);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(0, 2880) did
not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("Ctor BitmapData(0, 2880) correctly threw an error,
id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("Ctor correctly threw 'ArgumentError' id: " +
e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor did not throw
'ArgumentError'; error caught: " + e);
+ }
+ }
+
+ //bmp = new Bitmap(0, 2879);
+ try {
+ bmp = new BitmapData(0, 2879);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(0, 2879) did
not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("Ctor BitmapData(0, 2879) correctly threw an error,
id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("Ctor correctly threw 'ArgumentError' id: " +
e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor did not throw
'ArgumentError'; error caught: " + e);
+ }
+ }
+
+ //bmp = new Bitmap(-1, 10, false, 0xff);
+ try {
+ bmp = new BitmapData(-1, 10, false, 0xff);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor BitmapData(-1, 10,
false, 0xff) did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("Ctor BitmapData(-1, 10, false, 0xff) correctly threw
an error, id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("Ctor correctly threw 'ArgumentError' id: " +
e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]Ctor did not throw
'ArgumentError'; error caught: " + e);
+ }
+ }
+
+
+ #end
+
+
// --------------------
// setPixel, setPixel32
// --------------------
-
- if (Type.typeof(x1.setPixel) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::setPixel() method exists");
- //x1.setPixel32(2, 2, 0x44);
- if (Type.typeof(x1.setPixel(2,2,0x44)) ==
ValueType.TNull) {
- DejaGnu.pass("BitmapData::getPixel() method
returns correct type (Void)");
- //xcheck_equals(x1.getPixel(2, 2), 0x00);
- if (!(x1.getPixel(2,2) == 0x00)) {
-
DejaGnu.pass("BitmapData::setPixel(2,2,0x44) has not set an incorrect value
(should not be 0x00, is "+x1.getPixel(2,2)+")");
- } else {
-
DejaGnu.fail("BitmapData::setPixel(2,2,0x44) has set an incorrect value
(0x00)");
- }
- //xcheck_equals(x1.getPixel32(2, 2), 0);
- if (!(x1.getPixel32(2,2) == 0)) {
-
DejaGnu.pass("BitmapData::setPixel(2,2,0x44) has not set an incorrect value
(should not be 0, is "+x1.getPixel32(2,2)+")");
- } else {
-
DejaGnu.fail("BitmapData::setPixel(2,2,0x44) has set an incorrect value (0)");
- }
- x1.setPixel(3, 3, 0xff);
- //check_equals(tr.getPixel(3, 3), 0xff);
- if (x1.getPixel(3,3) == 0xff) {
-
DejaGnu.pass("BitmapData::setPixel(3,3,0xff) has set the correct value (0xff)");
- } else {
-
DejaGnu.fail("BitmapData::setPixel(3,3,0xff) has set an incorrect value (should
be 0xff, is "+x1.getPixel(2,2)+")");
- }
- //check_equals(tr.getPixel32(3, 3), -16776961);
- if ((x1.getPixel32(3,3) == -16776961)) {
-
DejaGnu.pass("BitmapData::setPixel(3,3,0xff) has set the correct value
(-16776961)");
- } else {
-
DejaGnu.fail("BitmapData::setPixel(3,3,0xff) has set an incorrect value (should
be -16776961, is "+x1.getPixel32(2,2)+")");
- }
- } else {
- DejaGnu.fail("BitmapData::setPixel() method
returns incorrect type (should be Void, is
"+Type.typeof(x1.setPixel(2,2,0x44))+")");
- }
- } else {
- DejaGnu.fail("BitmapData::setPixel() method doesn't
exist");
- }
- if (Type.typeof(x1.setPixel32) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::setPixel32() method exists");
- //x1.setPixel32(6, 6, 0x44444444);
- if (Type.typeof(x1.setPixel32(6,6,0x44444444)) ==
ValueType.TNull) {
- DejaGnu.pass("BitmapData::setPixel32() method
returns correct type (Void)");
- //check_equals(ntr.getPixel(6, 6), 0x444444);
- if ((x1.getPixel(6,6) == 0x444444)) {
-
DejaGnu.pass("BitmapData::setPixel32(6,6,0x44444444) has set a correct value
(0x444444)");
- } else {
- DejaGnu.fail(
- "BitmapData::setPixel32(6,6,0x44444444)
has set an incorrect value (should be 0x444444, is "+x1.getPixel(6,6)+")");
- }
- //check_equals(ntr.getPixel32(6, 6), -12303292);
- if ((x1.getPixel32(6,6) == -12303292)) {
-
DejaGnu.pass("BitmapData::setPixel32(6,6,0x44444444) has set a correct value
(-12303292)");
- } else {
- DejaGnu.fail(
- "BitmapData::setPixel32(6,6,0x44444444)
has set an incorrect value (should be -12303292, is "+x1.getPixel32(6,6)+")");
- }
- } else {
- DejaGnu.fail("BitmapData::setPixel32() method
returns incorrect type (should be Void, is
"+Type.typeof(x1.setPixel(2,2,0x44))+")");
- }
- } else {
- DejaGnu.fail("BitmapData::setPixel32() method doesn't
exist");
- }
-
- // ---------
+ DejaGnu.note("**** setPixel and setPixel32 testing ****");
+
+ var tr:BitmapData = new BitmapData(30, 30, true);
+ var ntr:BitmapData = new BitmapData(30, 30, false);
+
+ if (untyped __typeof__(tr.setPixel) == 'function') {
+ DejaGnu.pass("BitmapData::setPixel() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::setPixel() is not a function");
+ }
+ //FIXME: How to check return type void
+ if (untyped __typeof__(tr.setPixel32) == 'function') {
+ DejaGnu.pass("BitmapData::setPixel32() is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::setPixel32() is not a function");
+ }
+ //FIXME: How to check return type void
+
+
+ tr.setPixel(3, 3, 0xff);
+ //check_equals(tr.getPixel(3, 3), 0xff);
+ if (tr.getPixel(3,3) == 0xff) {
+ DejaGnu.pass("BitmapData::setPixel(3,3,0xff) has set the correct
value (0xff)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::setPixel(3,3,0xff) has set an incorrect value (should be 0xff, is
"+tr.getPixel(3,3)+")");
+ }
+ //check_equals(tr.getPixel32(3, 3), -16776961);
+ #if flash8
+ if ((tr.getPixel32(3, 3) == -16776961)) {
+ DejaGnu.pass("BitmapData::setPixel(3,3,0xff) has set the correct
value (-16776961)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::setPixel(3,3,0xff) has set an incorrect value (should be -16776961,
is "+tr.getPixel32(3,3)+")");
+ }
+ #else
+ // compiler bug?
+ if (tr.getPixel32(3, 3) == 4278190335) {
+ DejaGnu.pass("BitmapData::setPixel(3,3,0xff) has set the correct
value (4278190335)");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]
BitmapData::setPixel(3,3,0xff) has set an incorrect value (should be
4278190335, is "+tr.getPixel32(3,3)+")");
+ }
+ #end
+
+ ntr.setPixel(5, 5, 0xff);
+ //check_equals(ntr.getPixel(5, 5), 0xff);
+ if (ntr.getPixel(5, 5) == 0xff) {
+ DejaGnu.pass("setPixel(3,3,0xff) has set the correct value -
getPixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel(5, 5, 0xff) set
incorrect value: "+ntr.getPixel(5,5)+" should be 0xff");
+ }
+ //check_equals(ntr.getPixel32(5, 5), -16776961);
+ #if flash8
+ if (ntr.getPixel32(5,5) == -16776961) {
+ DejaGnu.pass("setPixel(3,3,0xff) has set the correct value -
getPixel32");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel(5, 5, 0xff) set
incorrect value: "+ntr.getPixel(5,5)+" should be -16776961");
+ }
+ #else
+ if (ntr.getPixel32(5,5) == 4278190335) {
+ DejaGnu.pass("setPixel(3,3,0xff) has set the correct value -
getPixel32");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel(5, 5, 0xff) set
incorrect value: "+ntr.getPixel32(5,5)+" should be 4278190335");
+ }
+ #end
+
+ // not sure what the following not from the ming test means
+ //// Premultiplication?
+ tr.setPixel32(2, 2, 0x220000aa);
+ //xcheck_equals(tr.getPixel(2, 2), 0xac);
+ if (tr.getPixel(2, 2) == 0xac) {
+ DejaGnu.xpass("setPixel32(2, 2, 0x220000aa) has set the correct
value - getPixel");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(2, 2,
0x220000aa) set incorrect value: "+tr.getPixel(2,2)+" should be 0xac");
+ }
+ //xcheck_equals(tr.getPixel32(2, 2), 0x220000ac);
+ if (tr.getPixel32(2, 2) == 0x220000ac) {
+ DejaGnu.xpass("setPixel32(2, 2, 0x220000aa) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(2, 2,
0x220000aa) set incorrect value: "+tr.getPixel(2,2)+" should be 0x0x220000ac");
+ }
+
+ tr.setPixel32(2, 2, 0xff0000aa);
+ //check_equals(tr.getPixel(2, 2), 0xaa);
+ if (tr.getPixel(2, 2) == 0xaa) {
+ DejaGnu.pass("setPixel32(2, 2, 0xff0000aa) has set the correct
value - getPixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(2, 2, 0xff0000aa)
set incorrect value: "+tr.getPixel(2,2)+" should be 0xaa");
+ }
+ //check_equals(tr.getPixel32(2, 2), -16777046);
+ #if flash8
+ if (tr.getPixel32(2, 2) == -16777046) {
+ DejaGnu.pass("setPixel32(2, 2, 0xff0000aa) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(2, 2, 0xff0000aa)
set incorrect value: "+tr.getPixel32(2,2)+" should be -16777046");
+ }
+ #else
+ if (tr.getPixel32(2, 2) == 4278190250) {
+ DejaGnu.pass("setPixel32(2, 2, 0xff0000aa) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(2, 2, 0xff0000aa)
set incorrect value: "+tr.getPixel32(2,2)+" should be 4278190250");
+ }
+ #end
+
+ //// Premultiplication?
+ tr.setPixel32(4, 4, 0x44444444);
+ //xcheck_equals(tr.getPixel(4, 4), 0x434343);
+ if (tr.getPixel(4, 4) == 0x434343) {
+ DejaGnu.xpass("setPixel32(4, 4, 0x44444444) has set the correct
value - getPixel");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(4, 4,
0x44444444) set incorrect value: "+tr.getPixel(4,4)+" should be 0x434343");
+ }
+ //xcheck_equals(tr.getPixel32(4, 4), 0x44434343);
+ if (tr.getPixel32(4, 4) == 0x44434343) {
+ DejaGnu.xpass("setPixel32(4, 4, 0x44444444) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(4, 4,
0x44444444) set incorrect value: "+tr.getPixel32(4,4)+" should be 0x44434343");
+ }
+
+ tr.setPixel32(4, 4, 0x10101010);
+ //check_equals(tr.getPixel(4, 4), 0x101010);
+ if (tr.getPixel(4, 4) == 0x101010) {
+ DejaGnu.pass("setPixel32(4, 4, 0x10101010) has set the correct
value - getPixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(4, 4, 0x10101010)
set incorrect value: "+tr.getPixel(4,4)+" should be 0x101010");
+ }
+ //check_equals(tr.getPixel32(4, 4), 0x10101010);
+ if (tr.getPixel32(4, 4) == 0x10101010) {
+ DejaGnu.pass("setPixel32(2, 2, 0xff0000aa) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(2, 2, 0xff0000aa)
set incorrect value: "+tr.getPixel32(2,2)+" should be -16777046");
+ }
+
+ //// Premultiplication?
+ tr.setPixel32(4, 4, 0x43434343);
+ //xcheck_equals(tr.getPixel(4, 4), 0x444444);
+ if (tr.getPixel(4, 4) == 0x444444) {
+ DejaGnu.xpass("setPixel32(4, 4, 0x43434343) has set the correct
value - getPixel");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(4, 4,
0x43434343) set incorrect value: "+tr.getPixel(4,4)+" should be 0x444444");
+ }
+ //xcheck_equals(tr.getPixel32(4, 4), 0x43444444);
+ if (tr.getPixel32(4, 4) == 0x43444444) {
+ DejaGnu.xpass("setPixel32(4, 4, 0x43434343) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(4, 4,
0x43434343) set incorrect value: "+tr.getPixel32(4,4)+" should be 0x43444444");
+ }
+
+ //// Premultiplication?
+ tr.setPixel32(2, 2, 0x44);
+ //xcheck_equals(tr.getPixel(2, 2), 0x00);
+ if (tr.getPixel(2, 2) == 0x00) {
+ DejaGnu.xpass("setPixel32(2, 2, 0x44) has set the correct value -
getPixel");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(2, 2, 0x44) set
incorrect value: "+tr.getPixel(2,2)+" should be 0x00");
+ }
+ //xcheck_equals(tr.getPixel32(2, 2), 0);
+ if (tr.getPixel32(2, 2) == 0) {
+ DejaGnu.xpass("setPixel32(2, 2, 0x44) has set the correct value -
getPixel32");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]setPixel32(2, 2, 0x44) set
incorrect value: "+tr.getPixel32(2,2)+" should be 0");
+ }
+
+ ntr.setPixel32(6, 6, 0x44444444);
+ //check_equals(ntr.getPixel(6, 6), 0x444444);
+ if (ntr.getPixel(6, 6) == 0x444444) {
+ DejaGnu.pass("setPixel32(6, 6, 0x44444444) has set the correct
value - getPixel");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(6, 6, 0x44444444)
set incorrect value: "+ntr.getPixel(6, 6)+" should be 0x444444");
+ }
+ //check_equals(ntr.getPixel32(6, 6), -12303292);
+ #if flash8
+ if (ntr.getPixel32(6, 6) == -12303292) {
+ DejaGnu.pass("setPixel32(6, 6, 0x44444444) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(6, 6, 0x44444444)
set incorrect value: "+ntr.getPixel32(6, 6)+" should be -12303292");
+ }
+ #else
+ if (ntr.getPixel32(6, 6) == 4282664004) {
+ DejaGnu.pass("setPixel32(6, 6, 0x44444444) has set the correct
value - getPixel32");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]setPixel32(6, 6, 0x44444444)
set incorrect value: "+ntr.getPixel32(6, 6)+" should be 4282664004");
+ }
+ #end
+
+
+ //
--------------------------------------------------------------------
// floodFill
- // ---------
-
- //bmp.floodFill(10, 10, 0x0000ff00);
- if (Type.typeof(x1.floodFill) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::floodFill() method exists");
- if (Type.typeof(x1.floodFill(10,10,0x0000ff00)) ==
ValueType.TNull) {
- DejaGnu.pass("BitmapData::floodFill() method
returns correct type (Void)");
- //xcheck_equals(bmp.getPixel(10, 10),
0x0000ff00);
- if (!(x1.getPixel(10,10) == 0x0000ff00)) {
- DejaGnu.pass(
-
"BitmapData::floodFill(10,10,0x0000ff00) has not set an incorrect value (should
not be 0x0000ff00, is "+x1.getPixel(10,10)+")");
- } else {
- DejaGnu.fail(
-
"BitmapData::floodFill(10,10,0x0000ff00) has set an incorrect value
(0x0000ff00)");
- }
- x1.floodFill(5,5,0x000000ff);
- //xcheck_equals(bmp.getPixel(10, 0),
0x000000ff);
- if (!(x1.getPixel(10,10) == 0x000000ff)) {
- DejaGnu.pass(
- "BitmapData::floodFill(5,5,0x000000ff)
has not set an incorrect value (should not be 0x000000ff, is
"+x1.getPixel(6,6)+")");
- } else {
- DejaGnu.fail(
- "BitmapData::floodFill(5,5,0x000000ff)
has set an incorrect value (0x000000ff)");
- }
- } else {
- DejaGnu.fail(
- "BitmapData::floodFill() method returns
incorrect type (should be Void, is
"+Type.typeof(x1.floodFill(10,10,0x0000ff00))+")");
- }
- } else {
- DejaGnu.fail("BitmapData::floodFill() method doesn't
exist");
- }
- #if flash9
+ //
--------------------------------------------------------------------
+ DejaGnu.note("**** floodFill() function testing
****[ln:"+here.lineNumber+"]");
+
+
+ var bmp = new BitmapData(20, 20, false);
+
+ if (untyped __typeof__(bmp.floodFill) == 'function') {
+ DejaGnu.pass("BitmapData.floodFill is a function");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]BitmapData.floodfill is not
a function");
+ }
+
+ //NOTE: as of 8/13/09 floodFill is unimplemented in gnash
+ bmp.floodFill(10, 10, 0x0000ff00);
+ //xcheck_equals(bmp.getPixel(10, 10), 0x0000ff00);
+ if (bmp.getPixel(10,10) == 0x0000ff00) {
+ DejaGnu.xpass("floodFill correctly set the pixel (10, 10) to
0x0000ff00");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]floodFill did not correctly
set pixel (10, 10); value is: "+bmp.getPixel(10,10));
+ }
+
+ bmp.floodFill(5, 5, 0x000000ff);
+ //xcheck_equals(bmp.getPixel(10, 0), 0x000000ff);
+ if (bmp.getPixel(10,0) == 0x000000ff) {
+ DejaGnu.xpass("flodFill correctly set the pixel (10, 0) to
0x000000ff");
+ } else {
+ DejaGnu.xfail("[ln:"+here.lineNumber+"]floodFill did not correctly
set pixel (10, 0); value is: "+bmp.getPixel(10,0));
+ }
+
+
+ #if flash8
+ var depth:Int = flash.Lib.current.getNextHighestDepth();
+ //mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
+ var mc:MovieClip = flash.Lib.current.createEmptyMovieClip("mc_" +
depth, depth);
+ //mc.attachBitmap(bmp, this.getNextHighestDepth());
+ mc.attachBitmap(bmp, depth);
+ #else
+ var mc:MovieClip = new MovieClip();
+ var dispbmp:Bitmap = new Bitmap(bmp);
+ mc.addChild(dispbmp);
+ #end
+
+ // not needed?
+ //Rectangle = flash.geom.Rectangle;
+
+ //---------------------------------------------------------------------
+ // fillRect()
+ //---------------------------------------------------------------------
+ DejaGnu.note("**** fillRect() function testing
*****[ln:"+here.lineNumber+"]");
+
+ bmp = new BitmapData(20, 20, false);
+ //r = new Rectangle(2, 2, 5, 5);
+ #if flash9
var r:Rectangle = new Rectangle(2, 2, 5, 5);
-#else
+ #else
var r:Rectangle<Int> = new Rectangle(2, 2, 5, 5);
-#end
- if (Type.typeof(x1.fillRect) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::fillRect() method exists");
- if (Type.typeof(x1.fillRect(r, 0xff1100)) ==
ValueType.TNull) {
- DejaGnu.pass("BitmapData::fillRect() method
returns correct type (Void)");
- //check_equals(bmp.getPixel(1, 1), 0xffffff);
- if (x1.getPixel(1,1) == 0xeeddee) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
not set an incorrect value @ (1,1) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (1,1) (should be 0xeeddee, is "+x1.getPixel(1,1)+")");
- }
- //check_equals(bmp.getPixel(2, 2), 0xff1100);
- if (x1.getPixel(2,2) == 0xff1100) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
set a correct value @ (2,2) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (2,2) (should be 0xff1100, is "+x1.getPixel(2,2)+")");
- }
- //check_equals(bmp.getPixel(2, 5), 0xff1100);
- if (x1.getPixel(2,5) == 0xff1100) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
set a correct value @ (2,5) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (2,5) (should be 0xff1100, is "+x1.getPixel(2,5)+")");
- }
- //check_equals(bmp.getPixel(5, 2), 0xff1100);
- if (x1.getPixel(5,2) == 0xff1100) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
set a correct value @ (5,2) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (5,2) (should be 0xff1100, is "+x1.getPixel(5,2)+")");
- }
- //check_equals(bmp.getPixel(2, 6), 0xff1100);
- if (x1.getPixel(2,6) == 0xff1100) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
set a correct value @ (2,6) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (2,6) (should be 0xff1100, is "+x1.getPixel(2,6)+")");
- }
- //check_equals(bmp.getPixel(6, 6), 0xff1100);
- if (x1.getPixel(6,6) == 0xff1100) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
set a correct value @ (6,6) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (6,6) (should be 0xff1100, is "+x1.getPixel(6,6)+")");
- }
- //check_equals(bmp.getPixel(6, 7), 0xffffff);
- if (x1.getPixel(6,7) == 0xeeddee) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
not set an incorrect value @ (6,7) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (6,7) (should be 0xeeddee, is "+x1.getPixel(1,1)+")");
- }
- //check_equals(bmp.getPixel(7, 6), 0xffffff);
- if (x1.getPixel(7,6) == 0xeeddee) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0xff1100) has
not set an incorrect value @ (7,6) (0xff1100)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0xff1100) has
set an incorrect value @ (7,6) (should be 0xeeddee, is "+x1.getPixel(1,1)+")");
- }
- r = new Rectangle(-2, -2, 8, 8);
- x1.fillRect(r, 0x00ff00);
- //check_equals(bmp.getPixel(1, 1), 0x00ff00);
- if (x1.getPixel(1,1) == 0x00ff00) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0x00ff00) has
set a correct value @ (1,1) (0x00ff00)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0x00ff00) has
set an incorrect value @ (1,1) (should be 0x00ff00, is "+x1.getPixel(1,1)+")");
- }
- r = new Rectangle(18, 18, -4, -4);
- x1.fillRect(r, 0x0000ff);
- //check_equals(bmp.getPixel(7, 6), 0xeeddee);
- if (x1.getPixel(7,6) == 0xeeddee) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0x0000ff) has
not set an incorrect value @ (7,6) (0x0000ff)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0x0000ff) has
set an incorrect value @ (7,6) (should be 0xeeddee, is "+x1.getPixel(7,6)+")");
- }
- r = new Rectangle(18, 18, 200, 200);
- x1.fillRect(r, 0x0000ff);
- //check_equals(bmp.getPixel(19,19), 0x0000ff);
- if (x1.getPixel(19,19) == 0x0000ff) {
- DejaGnu.pass(
- "BitmapData::fillRect(r, 0x0000ff) has
set a correct value @ (19,19) (0x0000ff)");
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect(r, 0x0000ff) has
set an incorrect value @ (19,19) (should be 0x0000ff, is
"+x1.getPixel(19,19)+")");
- }
- // Doesn't have to be a rectangle
- //var g = {x: 15, y: 15, width: 2, height: 2};
- //bmp.fillRect(g, 0xff00ff);
- //check_equals(bmp.getPixel(16, 16), 0xff00ff);
- } else {
- DejaGnu.fail(
- "BitmapData::fillRect() method returns
incorrect type (should be Void, is
"+Type.typeof(x1.floodFill(10,10,0x0000ff00))+")");
- }
- } else {
- DejaGnu.fail("BitmapData::fillRect() method doesn't
exist");
- }
- if (Type.typeof(x1.applyFilter) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::applyFilter() method exists");
- } else {
- DejaGnu.fail("BitmapData::applyFilter() method doesn't
exist");
- }
- if (Type.typeof(x1.clone) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::clone() method exists");
- } else {
- DejaGnu.fail("BitmapData::clone() method doesn't exist");
- }
- if (Type.typeof(x1.colorTransform) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::colorTransform() method
exists");
- } else {
- DejaGnu.fail("BitmapData::colorTransform() method
doesn't exist");
- }
-#if flash9
- if (Type.typeof(x1.compare) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::compare() method exists");
- } else {
- DejaGnu.fail("BitmapData::compare() method doesn't exist");
- }
-#end
- if (Type.typeof(x1.copyChannel) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::copyChannel() method exists");
- } else {
- DejaGnu.fail("BitmapData::copyChannel() method doesn't
exist");
- }
- if (Type.typeof(x1.copyPixels) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::copyPixels() method exists");
- } else {
- DejaGnu.fail("BitmapData::copyPixels() method doesn't
exist");
- }
- if (Type.typeof(x1.dispose) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::dispose() method exists");
- } else {
- DejaGnu.fail("BitmapData::dispose() method doesn't
exist");
- }
- if (Type.typeof(x1.draw) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::draw() method exists");
- } else {
- DejaGnu.fail("BitmapData::draw() method doesn't exist");
- }
- if (Type.typeof(x1.generateFilterRect) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::generateFilterRect() method
exists");
- } else {
- DejaGnu.fail("BitmapData::generateFilterRect() method
doesn't exist");
- }
- if (Type.typeof(x1.getColorBoundsRect) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::getColorBoundsRect() method
exists");
- } else {
- DejaGnu.fail("BitmapData::getColorBoundsRect() method
doesn't exist");
- }
-#if flash9
- if (Type.typeof(x1.getPixels) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::getPixels() method exists");
- } else {
- DejaGnu.fail("BitmapData::getPixels() method doesn't
exist");
- }
-//FIXME: These method exists in HaXe API Documentation, but is not supported,
and does not exist in Adobe documentation
-// if (Type.typeof(x1.getVector) == ValueType.TFunction) {
-// DejaGnu.pass("BitmapData::getVector() method exists");
-// } else {
-// DejaGnu.fail("BitmapData::getVector() method doesn't exist");
-// }
-// if (Type.typeof(x1.histogram) == ValueType.TFunction) {
-// DejaGnu.pass("BitmapData::histogram() method exists");
-// } else {
-// DejaGnu.fail("BitmapData::histogram() method doesn't exist");
-// }
-#end
- if (Type.typeof(x1.hitTest) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::hitTest() method exists");
- } else {
- DejaGnu.fail("BitmapData::hitTest() method doesn't exist");
- }
-#if flash9
- if (Type.typeof(x1.lock) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::lock() method exists");
- } else {
- DejaGnu.fail("BitmapData::lock() method doesn't exist");
- }
-#end
- if (Type.typeof(x1.merge) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::merge() method exists");
- } else {
- DejaGnu.fail("BitmapData::merge() method doesn't
exist");
- }
- if (Type.typeof(x1.noise) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::noise() method exists");
- } else {
- DejaGnu.fail("BitmapData::noise() method doesn't
exist");
- }
- if (Type.typeof(x1.paletteMap) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::paletteMap() method exists");
- } else {
- DejaGnu.fail("BitmapData::paletteMap() method doesn't
exist");
- }
- if (Type.typeof(x1.perlinNoise) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::perlinNoise() method exists");
- } else {
- DejaGnu.fail("BitmapData::perlinNoise() method doesn't
exist");
- }
- if (Type.typeof(x1.pixelDissolve) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::pixelDissolve() method exists");
- } else {
- DejaGnu.fail("BitmapData::pixelDissolve() method doesn't
exist");
- }
- if (Type.typeof(x1.scroll) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::scroll() method exists");
- } else {
- DejaGnu.fail("BitmapData::scroll() method doesn't
exist");
- }
-#if flash9
- if (Type.typeof(x1.setPixels) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::setPixels() method exists");
- } else {
- DejaGnu.fail("BitmapData::setPixels() method doesn't
exist");
- }
-//FIXME: This method exists in HaXe API Documentation, but is not supported,
and does not exist in Adobe documentation
-// if (Type.typeof(x1.setVector) == ValueType.TFunction) {
-// DejaGnu.pass("BitmapData::setVector() method exists");
-// } else {
-// DejaGnu.fail("BitmapData::setVector() method doesn't exist");
-// }
-#end
- if (Type.typeof(x1.threshold) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::threshold() method exists");
- } else {
- DejaGnu.fail("BitmapData::threshold() method doesn't
exist");
- }
-#if flash9
- if (Type.typeof(x1.unlock) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::unlock() method exists");
- } else {
- DejaGnu.fail("BitmapData::unlock() method doesn't
exist");
- }
-#else
- if (Type.typeof(BitmapData.loadBitmap) == ValueType.TFunction) {
- DejaGnu.pass("BitmapData::loadBitmap() method exists");
- } else {
- DejaGnu.fail("BitmapData::loadBitmap() method doesn't
exist");
- }
-#end
+ #end
+
+ bmp.fillRect(r, 0xff1100);
+ //check_equals(bmp.getPixel(1, 1), 0xffffff);
+ if (bmp.getPixel(1, 1) == 0xffffff) {
+ DejaGnu.pass("fillRect correctly set pixel (1,1) to 0xffffff");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (1,1); value is: "+bmp.getPixel(1,1));
+ }
+ //check_equals(bmp.getPixel(2, 2), 0xff1100);
+ if (bmp.getPixel(2, 2) == 0xff1100) {
+ DejaGnu.pass("fillRect correctly set pixel (2,2) to 0xff1100");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (2,2); value is: "+bmp.getPixel(2,2));
+ }
+ //check_equals(bmp.getPixel(2, 5), 0xff1100);
+ if (bmp.getPixel(2, 5) == 0xff1100) {
+ DejaGnu.pass("fillRect correctly set pixel (2,5) to 0xff1100");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (2,5); value is: "+bmp.getPixel(2,5));
+ }
+ //check_equals(bmp.getPixel(5, 2), 0xff1100);
+ if (bmp.getPixel(5, 2) == 0xff1100) {
+ DejaGnu.pass("fillRect correctly set pixel (5,2) to 0xff1100");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (5,2); value is: "+bmp.getPixel(5,2));
+ }
+ //check_equals(bmp.getPixel(2, 6), 0xff1100);
+ if (bmp.getPixel(2, 6) == 0xff1100) {
+ DejaGnu.pass("fillRect correctly set pixel (2,6) to 0xff1100");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (2,6); value is: "+bmp.getPixel(2,6));
+ }
+ //check_equals(bmp.getPixel(6, 6), 0xff1100);
+ if (bmp.getPixel(6, 6) == 0xff1100) {
+ DejaGnu.pass("fillRect correctly set pixel (6,6) to 0xff1100");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (6,6); value is: "+bmp.getPixel(6,6));
+ }
+ //check_equals(bmp.getPixel(6, 7), 0xffffff);
+ if (bmp.getPixel(6, 7) == 0xffffff) {
+ DejaGnu.pass("fillRect correctly set pixel (6,7) to 0xffffff");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (6,7); value is: "+bmp.getPixel(6,7));
+ }
+ //check_equals(bmp.getPixel(7, 6), 0xffffff);
+ if (bmp.getPixel(7, 6) == 0xffffff) {
+ DejaGnu.pass("fillRect correctly set pixel (7,6) to 0xffffff");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (7,6); value is: "+bmp.getPixel(7,6));
+ }
+
+ r = new Rectangle(-2, -2, 8, 8);
+ bmp.fillRect(r, 0x00ff00);
+ //check_equals(bmp.getPixel(1, 1), 0x00ff00);
+ if (bmp.getPixel(1, 1) == 0x00ff00) {
+ DejaGnu.pass("fillRect correctly set pixel (1,1) to 0x00ff00");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (1,1); value is: "+bmp.getPixel(1,1));
+ }
+
+ //// Fails.
+ r = new Rectangle(18, 18, -4, -4);
+ bmp.fillRect(r, 0x0000ff);
+ //check_equals(bmp.getPixel(7, 6), 0xffffff);
+ if (bmp.getPixel(7, 6) == 0xffffff) {
+ DejaGnu.pass("fillRect correctly set pixel (7,6) to 0xffffff");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (7,6); value is: "+bmp.getPixel(7,6));
+ }
+
+ r = new Rectangle(18, 18, 200, 200);
+ bmp.fillRect(r, 0x0000ff);
+ //check_equals(bmp.getPixel(19,19), 0x0000ff);
+ if (bmp.getPixel(19, 19) == 0x0000ff) {
+ DejaGnu.pass("fillRect correctly set pixel (19,19) to 0x0000ff");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (19,19); value is: "+bmp.getPixel(19,19));
+ }
+
+ //// Doesn't have to be a rectangle
+ // This doesn't seem to be true in flash 9 - throws an error
+ //g = {x: 15, y: 15, width: 2, height: 2};
+ var g = {x: 15, y: 15, width: 2, height: 2};
+ #if flash8
+ bmp.fillRect(untyped g, 0xff00ff);
+ //check_equals(bmp.getPixel(16, 16), 0xff00ff);
+ if (bmp.getPixel(16, 16) == 0xff00ff) {
+ DejaGnu.pass("fillRect correctly set pixel (16,16) to 0xff00ff");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (16,16); value is: "+bmp.getPixel(16,16));
+ }
+ #else
+ try {
+ bmp.fillRect(untyped g, 0xff00ff);
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect(g, 0xff0ff) did not
throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("fillRect(g, 0xff0ff) correctly threw an error, id: "
+ e.errorID);
+ if ( e.name == 'TypeError') {
+ DejaGnu.pass("fillRect correctly threw 'TypeError' id: " +
e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect did not throw
'TypeError'; error caught: " + e);
+ }
+ }
+ #end
+
+ #if flash8
+ //// Transparency (this bitmap is not transparent).
+ //g = {x: 18, y: 2, width: 7, height: 7};
+ g = {x: 18, y: 2, width: 7, height: 7};
+ bmp.fillRect(untyped g, 0xddff00ff);
+ //check_equals(bmp.getPixel32(18, 2), -65281);
+ if (bmp.getPixel32(18, 2) == -65281) {
+ DejaGnu.pass("fillRect correctly set pixel (18,2) to -65281");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (18,2); value is: "+bmp.getPixel32(18,2));
+ }
+ #end
+
+ #if flash8
+ mc.attachBitmap(bmp, depth);
+ #else
+ dispbmp = new Bitmap(bmp);
+ mc.addChild(dispbmp);
+ #end
+
+ //// Transparency (transparent bitmap). Fill just obliterates
+ //// what was there, even if it's transparent.
+ bmp = new BitmapData(20, 20, true);
+ r = new Rectangle(1, 1, 10, 10);
+ bmp.fillRect(r, 0xff00ff00);
+ r = new Rectangle(2, 2, 9, 9);
+ bmp.fillRect(r, 0x99ff1100);
+ #if flash8
+ //check_equals(bmp.getPixel32(3, 3), -1711337216);
+ if (bmp.getPixel32(3, 3) == -1711337216) {
+ DejaGnu.pass("fillRect correctly set pixel (3,3) to -1711337216");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (3,3); value is: "+bmp.getPixel32(3,3));
+ }
+ #else
+ //precission difference
+ if (bmp.getPixel32(3, 3) == 2583630080) {
+ DejaGnu.pass("fillRect correctly set pixel (3,3) to 2583630080");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]fillRect incorrectly set
pixel (3,3); value is: "+bmp.getPixel32(3,3));
+ }
+ #end
+
+ #if flash8
+ mc.attachBitmap(bmp, depth);
+ #else
+ dispbmp = new Bitmap(bmp);
+ mc.addChild(dispbmp);
+ #end
+
+
//----------------------------------------------------------------------
+ // dispose()
+
//----------------------------------------------------------------------
+ DejaGnu.note("**** dispose() function testing
****[ln:"+here.lineNumber+"]");
+
+ bmp.dispose();
+
+ //check(bmp instanceOf Bitmap);
+ if (Std.is(bmp, BitmapData) ) {
+ DejaGnu.pass("dispose() correctly did not change the type of bmp");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]dispose() incorrectly
changed"+
+ " the type of bmp to: "+ untyped __typeof__(bmp) );
+ }
+ #if flash8
+ //check_equals(bmp.height, -1);
+ if (bmp.height == -1) {
+ DejaGnu.pass("BitmapData.dispose correctly set bmp.height to -1");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]dispose() did not correctly"+
+ " set bmp.height; value is: "+bmp.height);
+ }
+ //check_equals(bmp.width, -1);
+ if (bmp.width == -1) {
+ DejaGnu.pass("BitmapData.dispose correctly set bmp.width to -1");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]dispose() did not correctly"+
+ " set bmp.width; value is: "+bmp.width);
+ }
+ //check_equals(bmp.transparent, -1);
+ if (bmp.transparent == untyped -1) {
+ DejaGnu.pass("BitmapData.dispose correctly set bmp.transparent to
-1");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]dispose() did not correctly"+
+ " set bmp.transparent; value is: "+bmp.transparent);
+ }
+ //check_equals(typeof(bmp.rectangle), "number");
+ if (untyped __typeof__(bmp.rectangle) == 'number') {
+ DejaGnu.pass("BitmapData.dispose correctly changed bmp.rectangle"+
+ " to a number");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]dispose() did not correctly"+
+ "change bmp.rectangle; type is: "+
+ untyped __typeof__(bmp.rectangle) );
+ }
+ //check_equals(bmp.rectangle, -1);
+ if (bmp.rectangle == untyped -1) {
+ DejaGnu.pass("BitmapData.dispose correctly set bmp.rectangle to
-1");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]dispose() did not correctly"+
+ " set bmp.rectangle; value is: "+bmp.rectangle);
+ }
+ //check_equals(bmp.rectangle.toString(), "-1");
+ if ( bmp.rectangle.toString() == "-1") {
+ DejaGnu.pass("dispose() correctly set bmp.rectangle.toString()"+
+ " to '-1'");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]dispose() did not correctly"+
+ " set bmp.rectangle.toString(); value is: "
+ + bmp.rectangle.toString() );
+ }
+
+ bmp.height = 2;
+ //check_equals(bmp.height, -1);
+ if (bmp.height == -1) {
+ DejaGnu.pass("After calling dispose() we cannot change
bmp.height");
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]After calling dispose() we"+
+ " were still able to change bmp.height which is not"+
+ " allowed");
+ }
+ #else
+ var x1;
+ //check_equals(bmp.height, -1);
+ try {
+ x1 = bmp.height;
+ DejaGnu.fail("[ln:"+here.lineNumber+"]After dispose() getting"+
+ " bmp.height did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("After dispose() getting bmp.height correctly threw"+
+ " an error, id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("getting bmp.height correctly threw"+
+ " 'ArgumentError' id: " + e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]getting bmp.height did"+
+ " not throw 'ArgumentError'; error caught: " + e);
+ }
+ }
+ //check_equals(bmp.width, -1);
+ try {
+ x1 = bmp.width;
+ DejaGnu.fail("[ln:"+here.lineNumber+"]After dispose() getting"+
+ " bmp.width did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("After dispose() getting bmp.width correctly threw"+
+ " an error, id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("getting bmp.width correctly threw"+
+ " 'ArgumentError' id: " + e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]getting bmp.width did"+
+ " not throw 'ArgumentError'; error caught: " + e);
+ }
+ }
+ //check_equals(bmp.transparent, -1);
+ var x2;
+ try {
+ x2 = bmp.transparent;
+ DejaGnu.fail("[ln:"+here.lineNumber+"]After dispose() getting"+
+ " bmp.transparent did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("After dispose() getting bmp.transparent correctly"+
+ " threw an error, id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("getting bmp.transparent correctly threw"+
+ " 'ArgumentError' id: " + e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]getting bmp.transparent"+
+ " did not throw 'ArgumentError'; error caught: "
+ + e );
+ }
+ }
+ //check_equals(bmp.rectangle, -1);
+ var x3;
+ try {
+ x3 = bmp.rect;
+ DejaGnu.fail("[ln:"+here.lineNumber+"]After dispose() getting"+
+ " bmp.rect did not throw an error, it should");
+ } catch( e : Error ) {
+ DejaGnu.pass("After dispose() getting bmp.rect correctly"+
+ " threw an error, id: " + e.errorID);
+ if ( e.name == 'ArgumentError') {
+ DejaGnu.pass("getting bmp.rect correctly threw"+
+ " 'ArgumentError' id: " + e.message);
+ } else {
+ DejaGnu.fail("[ln:"+here.lineNumber+"]getting bmp.rect"+
+ " did not throw 'ArgumentError'; error caught: "
+ + e );
+ }
+ }
+
+ #end
+
+ DejaGnu.unresolved("Skipping some ming tests");
+ DejaGnu.note("Skipping some very strange tests from the ming test
cases");
+ DejaGnu.note("Haxe will not allow assignment to flash.geom.Rectangle");
+ DejaGnu.note("Does flash allow this sort of thing and should we"+
+ " allow this in Gnash?");
+
+ //bmp = new BitmapData(20, 10, true);
+ //var backup = flash.geom.Rectangle;
+ //flash.geom.Rectangle = 2;
+ //check_equals(bmp.rectangle, -1);
+
+ //flash.geom.Rectangle = function (x, y, w, h)
+ //{
+ //this.y = x + 5;
+ //this.x = 10.5;
+ //this.width = h;
+ //this.height = w;
+ //};
+ //check_equals(bmp.rectangle.toString(), "[object Object]");
+
+ //flash.geom.Rectangle = function (x, y, w, h)
+ //{
+ //};
+ //check_equals(bmp.rectangle.toString(), "[object Object]");
+
+ //flash.geom.Rectangle = function ()
+ //{
+ //};
+ //check_equals(bmp.rectangle.toString(), "[object Object]");
+
+ //flash.geom.Rectangle = backup;
+ //check_equals(bmp.rectangle.toString(), "(x=0, y=0, w=20, h=10)");
+
+
+
+
//-------------------------------------------------------------
// END OF TEST
//-------------------------------------------------------------
+#else
+ DejaGnu.note("This class (BitmapData) is only available in
flash8 and flash9");
+#end
// Call this after finishing all tests. It prints out the
totals.
DejaGnu.done();
-#else
- DejaGnu.note("This class (BitmapData) is only available in
flash8 and flash9");
-#end
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/Bitmap_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/Bitmap_as.hx 2009-06-15
20:00:09 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/Bitmap_as.hx 2009-08-13
20:51:30 +0000
@@ -50,35 +50,39 @@
} else {
DejaGnu.fail("Bitmap lass 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.
- var d1:BitmapData = new BitmapData(20, 30, false, 0xeeddee);
- x1.bitmapData = d1;
- if (Std.is(x1.bitmapData, BitmapData)) {
- DejaGnu.pass("Bitmap::bitmapData property exists");
- } else {
- DejaGnu.fail("Bitmap::bitmapData property doesn't exist");
- }
- DejaGnu.note(""+Type.typeof(x1.bitmapData));
- if (Std.is(x1.pixelSnapping, String)) {
- DejaGnu.pass("Bitmap::pixelSnapping property exists");
- } else {
- DejaGnu.fail("Bitmap::pixelSnapping property doesn't exist");
- }
- if (Type.typeof(x1.smoothing) == ValueType.TBool) {
- DejaGnu.pass("Bitmap::smoothing property exists");
- } else {
- DejaGnu.fail("Bitmap::smoothing property 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.
+
+ var d1:BitmapData = new BitmapData(20, 30, false, 0xeeddee);
+ x1.bitmapData = d1;
+
+ if (Std.is(x1.bitmapData, BitmapData)) {
+ DejaGnu.pass("Bitmap::bitmapData property exists");
+ } else {
+ DejaGnu.fail("Bitmap::bitmapData property doesn't exist");
+ }
+ DejaGnu.note(""+Type.typeof(x1.bitmapData));
+ if (Std.is(x1.pixelSnapping, String)) {
+ DejaGnu.pass("Bitmap::pixelSnapping property exists");
+ } else {
+ DejaGnu.fail("Bitmap::pixelSnapping property doesn't exist");
+ }
+ if (Type.typeof(x1.smoothing) == ValueType.TBool) {
+ DejaGnu.pass("Bitmap::smoothing property exists");
+ } else {
+ DejaGnu.fail("Bitmap::smoothing 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.
-
+#else
+ DejaGnu.note("Bitmap only exists in SWF 9 and up");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
-#end
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/DisplayObject_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/DisplayObject_as.hx
2009-06-15 17:12:43 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/DisplayObject_as.hx
2009-08-13 20:51:30 +0000
@@ -66,44 +66,44 @@
var accessProps:AccessibilityProperties = new
AccessibilityProperties();
accessProps.name = "Test";
x1.accessibilityProperties = accessProps;
- if (Std.is(x1.accessibilityProperties, AccessibilityProperties)) {
- DejaGnu.pass("DisplayObject::accessibilityProperties property
exists");
- } else {
- DejaGnu.fail("DisplayObject::accessibilityProperties property
doesn't exist");
- }
- if (Type.typeof(x1.alpha) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::alpha property exists");
- } else {
- DejaGnu.fail("DisplayObject::alpha property doesn't exist");
- }
- if (Std.is(x1.blendMode, String)) {
- DejaGnu.pass("DisplayObject::blendMode property exists");
- } else {
- DejaGnu.fail("DisplayObject::blendMode property doesn't exist");
- }
- if (Type.typeof(x1.cacheAsBitmap) == ValueType.TBool) {
- DejaGnu.pass("DisplayObject::cacheAsBitmap property exists");
- } else {
- DejaGnu.fail("DisplayObject::cacheAsBitmap property doesn't exist");
- }
- if (Std.is(x1.filters, Array)) {
- DejaGnu.pass("DisplayObject::filters property exists");
- } else {
- DejaGnu.fail("DisplayObject::filters property doesn't exist");
- }
- if (Type.typeof(x1.height) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::height property exists");
- } else {
- DejaGnu.fail("DisplayObject::height property doesn't exist");
- }
-//Determine if the mask property of x1 exists by setting it and testing it
- var m1:Sprite = new Sprite();
- x1.mask = m1;
- if (Std.is(x1.mask, DisplayObject)) {
- DejaGnu.pass("DisplayObject::mask property exists");
- } else {
- DejaGnu.fail("DisplayObject::mask property doesn't exist");
- }
+ if (Std.is(x1.accessibilityProperties, AccessibilityProperties)) {
+ DejaGnu.pass("DisplayObject::accessibilityProperties property
exists");
+ } else {
+ DejaGnu.fail("DisplayObject::accessibilityProperties property
doesn't exist");
+ }
+ if (Type.typeof(x1.alpha) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::alpha property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::alpha property doesn't exist");
+ }
+ if (Std.is(x1.blendMode, String)) {
+ DejaGnu.pass("DisplayObject::blendMode property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::blendMode property doesn't exist");
+ }
+ if (Type.typeof(x1.cacheAsBitmap) == ValueType.TBool) {
+ DejaGnu.pass("DisplayObject::cacheAsBitmap property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::cacheAsBitmap property doesn't
exist");
+ }
+ if (Std.is(x1.filters, Array)) {
+ DejaGnu.pass("DisplayObject::filters property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::filters property doesn't exist");
+ }
+ if (Type.typeof(x1.height) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::height property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::height property doesn't exist");
+ }
+ //Determine if the mask property of x1 exists by setting it and testing it
+ var m1:Sprite = new Sprite();
+ x1.mask = m1;
+ if (Std.is(x1.mask, DisplayObject)) {
+ DejaGnu.pass("DisplayObject::mask property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::mask property doesn't exist");
+ }
//Determine if the loaderInfo property of x1 exists by setting it and testing
it
// var urlRequest:URLRequest = new URLRequest("../classes.all/TEST.jpg");
// loader.load(urlRequest);
@@ -112,140 +112,143 @@
// } else {
// DejaGnu.fail("DisplayObject::loaderInfo property doesn't exist");
// }
- if (Type.typeof(x1.mouseX) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::mouseX property exists");
- } else {
- DejaGnu.fail("DisplayObject::mouseX property doesn't exist");
- }
- if (Type.typeof(x1.mouseY) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::mouseY property exists");
- } else {
- DejaGnu.fail("DisplayObject::mouseY property doesn't exist");
- }
- if (Std.is(x1.name, String)) {
- DejaGnu.pass("DisplayObject::name property exists");
- } else {
- DejaGnu.fail("DisplayObject::name property doesn't exist");
- }
- if (Type.typeof(x1.opaqueBackground) == ValueType.TNull) {
- DejaGnu.pass("DisplayObject::opaqueBackground property exists");
- } else {
- DejaGnu.fail("DisplayObject::opaqueBackground property doesn't
exist");
- }
+ if (Type.typeof(x1.mouseX) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::mouseX property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::mouseX property doesn't exist");
+ }
+ if (Type.typeof(x1.mouseY) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::mouseY property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::mouseY property doesn't exist");
+ }
+ if (Std.is(x1.name, String)) {
+ DejaGnu.pass("DisplayObject::name property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::name property doesn't exist");
+ }
+ if (Type.typeof(x1.opaqueBackground) == ValueType.TNull) {
+ DejaGnu.pass("DisplayObject::opaqueBackground property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::opaqueBackground property doesn't
exist");
+ }
//Determine if the parent property of x1 exists by setting it and testing it
- m1.addChild(x1);
- if (Std.is(x1.parent, DisplayObjectContainer)) {
- DejaGnu.pass("DisplayObject::parent property exists");
- } else {
- DejaGnu.fail("DisplayObject::parent property doesn't exist");
- }
- m1.addChild(l1);
+ m1.addChild(x1);
+ if (Std.is(x1.parent, DisplayObjectContainer)) {
+ DejaGnu.pass("DisplayObject::parent property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::parent property doesn't exist");
+ }
+ m1.addChild(l1);
//Determine if the stage property of x1 exists by setting it and testing it
- flash.Lib.current.stage.addChild(x1);
- if (Std.is(x1.stage, Stage)) {
- DejaGnu.pass("DisplayObject::stage property exists");
- } else {
- DejaGnu.fail("DisplayObject::stage property doesn't exist");
- }
- if (Std.is(l1.root, DisplayObject)) {
- DejaGnu.pass("DisplayObject::root property exists");
- } else {
- DejaGnu.fail("DisplayObject::root property doesn't exist");
- }
- DejaGnu.note("Type of l1.root is "+Type.typeof(l1.root));
- if (Type.typeof(x1.rotation) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::rotation property exists");
- } else {
- DejaGnu.fail("DisplayObject::rotation property doesn't exist");
- }
+ flash.Lib.current.stage.addChild(x1);
+ if (Std.is(x1.stage, Stage)) {
+ DejaGnu.pass("DisplayObject::stage property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::stage property doesn't exist");
+ }
+ if (Std.is(l1.root, DisplayObject)) {
+ DejaGnu.pass("DisplayObject::root property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::root property doesn't exist");
+ }
+ DejaGnu.note("Type of l1.root is "+Type.typeof(l1.root));
+ if (Type.typeof(x1.rotation) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::rotation property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::rotation property doesn't exist");
+ }
//Determine if the scale9Grid property of x1 exists by setting it and testing
it
- x1.graphics.drawRect(0,0,10,10);
- x1.scale9Grid = r1;
- if (Std.is(x1.scale9Grid, Rectangle)) {
- DejaGnu.pass("DisplayObject::scale9Grid property exists");
- } else {
- DejaGnu.fail("DisplayObject::scale9Grid property doesn't exist");
- }
- if (Type.typeof(x1.scaleX) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::scaleX property exists");
- } else {
- DejaGnu.fail("DisplayObject::scaleX property doesn't exist");
- }
- if (Type.typeof(x1.scaleY) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::scaleY property exists");
- } else {
- DejaGnu.fail("DisplayObject::scaleY property doesn't exist");
- }
+ x1.graphics.drawRect(0,0,10,10);
+ x1.scale9Grid = r1;
+ if (Std.is(x1.scale9Grid, Rectangle)) {
+ DejaGnu.pass("DisplayObject::scale9Grid property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::scale9Grid property doesn't exist");
+ }
+ if (Type.typeof(x1.scaleX) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::scaleX property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::scaleX property doesn't exist");
+ }
+ if (Type.typeof(x1.scaleY) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::scaleY property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::scaleY property doesn't exist");
+ }
//Determine if the scrollRect property of x1 exists by setting it and testing
it
- x1.scrollRect = r1;
- if (Std.is(x1.scrollRect, Rectangle)) {
- DejaGnu.pass("DisplayObject::scrollRect property exists");
- } else {
- DejaGnu.fail("DisplayObject::scrollRect property doesn't exist");
- }
- if (Std.is(x1.transform, Transform)) {
- DejaGnu.pass("DisplayObject::transform property exists");
- } else {
- DejaGnu.fail("DisplayObject::transform property doesn't exist");
- }
- if (Type.typeof(x1.visible) == ValueType.TBool) {
- DejaGnu.pass("DisplayObject::visible property exists");
- } else {
- DejaGnu.fail("DisplayObject::visible property doesn't exist");
- }
- if (Type.typeof(x1.width) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::width property exists");
- } else {
- DejaGnu.fail("DisplayObject::width property doesn't exist");
- }
- if (Type.typeof(x1.x) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::x property exists");
- } else {
- DejaGnu.fail("DisplayObject::x property doesn't exist");
- }
- if (Type.typeof(x1.y) == ValueType.TFloat) {
- DejaGnu.pass("DisplayObject::y property exists");
- } else {
- DejaGnu.fail("DisplayObject::y property doesn't exist");
- }
+ x1.scrollRect = r1;
+ if (Std.is(x1.scrollRect, Rectangle)) {
+ DejaGnu.pass("DisplayObject::scrollRect property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::scrollRect property doesn't exist");
+ }
+ if (Std.is(x1.transform, Transform)) {
+ DejaGnu.pass("DisplayObject::transform property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::transform property doesn't exist");
+ }
+ if (Type.typeof(x1.visible) == ValueType.TBool) {
+ DejaGnu.pass("DisplayObject::visible property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::visible property doesn't exist");
+ }
+ if (Type.typeof(x1.width) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::width property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::width property doesn't exist");
+ }
+ if (Type.typeof(x1.x) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::x property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::x property doesn't exist");
+ }
+ if (Type.typeof(x1.y) == ValueType.TFloat) {
+ DejaGnu.pass("DisplayObject::y property exists");
+ } else {
+ DejaGnu.fail("DisplayObject::y 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 (Type.typeof(x1.getBounds) == ValueType.TFunction) {
- DejaGnu.pass("DisplayObject::getBounds() method exists");
- } else {
- DejaGnu.fail("DisplayObject::getBounds() method doesn't exist");
- }
- if (Type.typeof(x1.getRect) == ValueType.TFunction) {
- DejaGnu.pass("DisplayObject::getRect() method exists");
- } else {
- DejaGnu.fail("DisplayObject::getRect() method doesn't exist");
- }
- if (Type.typeof(x1.globalToLocal) == ValueType.TFunction) {
- DejaGnu.pass("DisplayObject::globalToLocal() method exists");
- } else {
- DejaGnu.fail("DisplayObject::globalToLocal() method doesn't exist");
- }
- if (Type.typeof(x1.hitTestObject) == ValueType.TFunction) {
- DejaGnu.pass("DisplayObject::hitTestObject() method exists");
- } else {
- DejaGnu.fail("DisplayObject::hitTestObject() method doesn't exist");
- }
- if (Type.typeof(x1.hitTestPoint) == ValueType.TFunction) {
- DejaGnu.pass("DisplayObject::hitTestPoint() method exists");
- } else {
- DejaGnu.fail("DisplayObject::hitTestPoint() method doesn't exist");
- }
- if (Type.typeof(x1.localToGlobal) == ValueType.TFunction) {
- DejaGnu.pass("DisplayObject::localToGlobal() method exists");
- } else {
- DejaGnu.fail("DisplayObject::localToGlobal() method doesn't exist");
- }
-
+ if (Type.typeof(x1.getBounds) == ValueType.TFunction) {
+ DejaGnu.pass("DisplayObject::getBounds() method exists");
+ } else {
+ DejaGnu.fail("DisplayObject::getBounds() method doesn't exist");
+ }
+ if (Type.typeof(x1.getRect) == ValueType.TFunction) {
+ DejaGnu.pass("DisplayObject::getRect() method exists");
+ } else {
+ DejaGnu.fail("DisplayObject::getRect() method doesn't exist");
+ }
+ if (Type.typeof(x1.globalToLocal) == ValueType.TFunction) {
+ DejaGnu.pass("DisplayObject::globalToLocal() method exists");
+ } else {
+ DejaGnu.fail("DisplayObject::globalToLocal() method doesn't
exist");
+ }
+ if (Type.typeof(x1.hitTestObject) == ValueType.TFunction) {
+ DejaGnu.pass("DisplayObject::hitTestObject() method exists");
+ } else {
+ DejaGnu.fail("DisplayObject::hitTestObject() method doesn't
exist");
+ }
+ if (Type.typeof(x1.hitTestPoint) == ValueType.TFunction) {
+ DejaGnu.pass("DisplayObject::hitTestPoint() method exists");
+ } else {
+ DejaGnu.fail("DisplayObject::hitTestPoint() method doesn't exist");
+ }
+ if (Type.typeof(x1.localToGlobal) == ValueType.TFunction) {
+ DejaGnu.pass("DisplayObject::localToGlobal() method exists");
+ } else {
+ DejaGnu.fail("DisplayObject::localToGlobal() method doesn't
exist");
+ }
+#else
+ DejaGnu.note("Display Object did not exist in versions prior to SWF
9");
// Call this after finishing all tests. It prints out the totals.
+
+#end
DejaGnu.done();
-#end
+
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/JointStyle_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/JointStyle_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/JointStyle_as.hx
2009-08-13 20:51:30 +0000
@@ -39,16 +39,16 @@
class JointStyle_as {
static function main() {
- #if flash9
- // Make sure we actually get a valid class
- if (Type.typeof(JointStyle)==TObject) {
- DejaGnu.pass("JointStyle class exists.");
- } else {
- DejaGnu.fail("JointStyle class doesn't exist");
- }
+#if flash9
+ // Make sure we actually get a valid class
+ if (Type.typeof(JointStyle)==TObject) {
+ DejaGnu.pass("JointStyle class exists.");
+ } else {
+ DejaGnu.fail("JointStyle class doesn't exist");
+ }
- // Tests to see if all the constants exist. All these do is test for
- // existance of a constants, and don't test the functionality at all.
+ // Tests to see if all the constants exist. All these do is test for
+ // existance of a constants, and don't test the functionality at all.
if (Type.typeof(JointStyle.BEVEL)!= null) {
DejaGnu.pass("JointStyle.BEVEL constant exists");
} else {
@@ -65,9 +65,12 @@
DejaGnu.fail("JointStyle.ROUND constant doesn't exist");
}
+#else
+ DejaGnu.note("JointStyle did not exist in version prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
+
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/LineScaleMode_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/LineScaleMode_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/LineScaleMode_as.hx
2009-08-13 20:51:30 +0000
@@ -39,7 +39,7 @@
class LineScaleMode_as {
static function main() {
- #if flash9
+#if flash9
// Make sure we actually get a valid class
if (Type.typeof(LineScaleMode)==TObject) {
DejaGnu.pass("LineScaleMode class exists.");
@@ -69,10 +69,13 @@
} else {
DejaGnu.fail("LineScaleMode.VERTICAL constant doesn't exist");
}
+#else
+ DejaGnu.note("LineScaleMode did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
+
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/LoaderInfo_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/LoaderInfo_as.hx
2009-08-13 17:09:24 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/LoaderInfo_as.hx
2009-08-13 21:02:02 +0000
@@ -205,15 +205,16 @@
} else {
DejaGnu.fail("LoaderInfo::getLoaderInfoByDefinition()
method doesn't exist");
}*/
-
+
+#else
+ DejaGnu.note("LoaderInfo did not exist in versions prior to SWF9");
+#end
DejaGnu.done();
- });
// Specify file where .swf resides -- user can simply replace their
username in the
// appropriate spot below
loader.load(new
URLRequest("/home/user_name/gnash/trunk/testsuite/car_smash.swf"));
- #end
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/Loader_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/Loader_as.hx 2009-06-02
02:08:31 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/Loader_as.hx 2009-08-13
20:51:30 +0000
@@ -92,10 +92,13 @@
} else {
DejaGnu.fail("Loader::unload() method doesn't exist");
}
+
+#else
+ DejaGnu.note("Loader did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/PixelSnapping_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/PixelSnapping_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/PixelSnapping_as.hx
2009-08-13 20:51:30 +0000
@@ -39,8 +39,8 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class PixelSnapping_as {
static function main() {
-
- #if flash9
+
+#if flash9
// Make sure we actually get a valid class
if (Type.typeof(PixelSnapping)==TObject) {
DejaGnu.pass("PixelSnapping class exists.");
@@ -68,9 +68,11 @@
DejaGnu.fail("PixelSnapping.NEVER doesn't exist");
}
+#else
+ DejaGnu.note("PixelSnapping class did not exist in versions prior to
SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/Shape_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/Shape_as.hx 2009-06-01
17:24:36 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/Shape_as.hx 2009-08-13
20:51:30 +0000
@@ -56,9 +56,12 @@
DejaGnu.fail("Shape::graphics property doesn't exist");
}
+#else
+ DejaGnu.note("Shape class did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
-#end
+
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/SimpleButton_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/SimpleButton_as.hx
2009-06-02 02:08:31 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/SimpleButton_as.hx
2009-08-13 20:51:30 +0000
@@ -43,7 +43,7 @@
class SimpleButton_as {
static function main() {
- #if flash9
+#if flash9
var x1:SimpleButton = new SimpleButton();
var x2:DisplayObject = new Shape();
@@ -111,9 +111,11 @@
// DejaGnu.fail("SimpleButton::SimpleButton() method doesn't exist");
// }
+#else
+ DejaGnu.note("SimpleButton did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/SpreadMethod_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/SpreadMethod_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/SpreadMethod_as.hx
2009-08-13 20:51:30 +0000
@@ -39,7 +39,7 @@
class SpreadMethod_as {
static function main() {
- #if flash9
+#if flash9
// Make sure we actually get a valid class
if (Type.typeof(SpreadMethod)==TObject) {
DejaGnu.pass("SpreadMethod class exists.");
@@ -67,9 +67,11 @@
DejaGnu.fail("SpreadMethod.REPEAT constant doesn't exist");
}
+#else
+ DejaGnu.note("SpreadMethod did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/Sprite_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/Sprite_as.hx 2009-06-15
20:00:09 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/Sprite_as.hx 2009-08-13
20:51:30 +0000
@@ -41,6 +41,7 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class Sprite_as {
static function main() {
+
#if flash9
var x1:Sprite = new Sprite();
var x2:Sprite = new Sprite();
@@ -103,9 +104,12 @@
DejaGnu.fail("Sprite::stopDrag() method doesn't exist");
}
+#else
+ DejaGnu.note("Sprite did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
-#end
+
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/display/StageAlign_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/StageAlign_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/StageAlign_as.hx
2009-08-13 20:51:30 +0000
@@ -91,9 +91,12 @@
DejaGnu.fail("StageAlign.TOP_RIGHT constant doesn't exist");
}
+#else
+ DejaGnu.note("StageAlign did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
+
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/StageDisplayState_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/StageDisplayState_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/StageDisplayState_as.hx
2009-08-13 20:51:30 +0000
@@ -65,10 +65,14 @@
// } else {
// DejaGnu.fail("StageDisplayState.FULL_SCREEN_INTERACTIVE
constant doesn't exist");
// }
+
+
+#else
+ DejaGnu.note("StageDisplayState did not exist before SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/StageQuality_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/StageQuality_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/StageQuality_as.hx
2009-08-13 20:51:30 +0000
@@ -39,7 +39,7 @@
class StageQuality_as {
static function main() {
- #if flash9
+#if flash9
// Make sure we actually get a valid class
if (Type.typeof(StageQuality)==TObject) {
DejaGnu.pass("StageQuality class exists.");
@@ -70,9 +70,12 @@
DejaGnu.fail("StageQuality.MEDIUM constant doesn't exist");
}
+#else
+ DejaGnu.note("StageQuality did not exist before SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
+
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/display/StageScaleMode_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/display/StageScaleMode_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/display/StageScaleMode_as.hx
2009-08-13 20:51:30 +0000
@@ -39,7 +39,7 @@
class StageScaleMode_as {
static function main() {
- #if flash9
+#if flash9
// Make sure we actually get a valid class
if (Type.typeof(StageScaleMode)==TObject) {
DejaGnu.pass("StageScaleMode class exists.");
@@ -73,9 +73,12 @@
DejaGnu.fail("StageScaleMode.SHOW_ALL constant doesn't exist");
}
+#else
+ DejaGnu.note("StageScaleMode did not exist in versions before SWF9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/net/Responder_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/net/Responder_as.hx 2009-06-02
02:08:31 +0000
+++ b/testsuite/misc-haxe.all/classes.all/net/Responder_as.hx 2009-08-13
20:51:30 +0000
@@ -39,7 +39,8 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class Responder_as {
static function main() {
- #if flash9
+
+#if flash9
var x1:Responder = new Responder(null, null);
// Make sure we actually get a valid class
@@ -49,9 +50,11 @@
DejaGnu.fail("Responder class doesn't exist");
}
+#else
+ DejaGnu.note("Responder did not exist in versions prior to SWF9");
+#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/net/URLVariables_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/net/URLVariables_as.hx
2009-06-02 02:08:31 +0000
+++ b/testsuite/misc-haxe.all/classes.all/net/URLVariables_as.hx
2009-08-13 20:51:30 +0000
@@ -50,9 +50,12 @@
DejaGnu.fail("URLVariables class doesn't exist");
}
+#else
+ DejaGnu.note("URLVariables did not exist before SWF9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/system/ApplicationDomain_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/system/ApplicationDomain_as.hx
2009-06-01 21:58:06 +0000
+++ b/testsuite/misc-haxe.all/classes.all/system/ApplicationDomain_as.hx
2009-08-13 20:51:30 +0000
@@ -36,20 +36,18 @@
// import our testing API
import DejaGnu;
-// Class must be named with the _as3 suffix, as that's the same name as the
file.
+// Class must be named with the _as suffix, as that's the same name as the
file.
class ApplicationDomain_as {
static function main() {
#if flash9
var x1:ApplicationDomain = new ApplicationDomain();
- var x2:ApplicationDomain = new ApplicationDomain(x1);
+ var x2:ApplicationDomain = new ApplicationDomain(x1);
-// DejaGnu.note("Type of x1" + Type.typeof(x1) );
-// DejaGnu.note("Type of ApplicationDomain" +
Type.typeof(ApplicationDomain) );
// Make sure we actually get a valid class
- if (Type.typeof(ApplicationDomain)==TObject && x1 != null) {
+ if (Type.typeof(ApplicationDomain) == TObject && x1 != null) {
DejaGnu.pass("ApplicationDomain class exists");
} else {
DejaGnu.fail("ApplicationDomain class doesn't exist");
@@ -58,21 +56,13 @@
// existance of a property, and don't test the functionality at all. This
// is primarily useful only to test completeness of the API implementation.
-//Si:
-//Check completed
-
-// DejaGnu.note("Type of ApplicationDomain.currentDomain " +
Type.typeof(ApplicationDomain.currentDomain) );
-// DejaGnu.note("Type " + Type.typeof(x1.ByteArray) );
-// DejaGnu.note("Type " + Type.typeof(x1.MIN_DOMAIN_MEMORY_LENGTH) );
-// DejaGnu.note("Type " + Type.typeof(ApplicationDomain.parentDomain) );
-// DejaGnu.note("Type " + Type.typeof(x1.parentDomain) );
if (Std.is(ApplicationDomain.currentDomain,ApplicationDomain) ) {
DejaGnu.pass("ApplicationDomain.currentDomain property exists");
} else {
DejaGnu.fail("ApplicationDomain.currentDomain property doesn't
exist");
}
-//Si
+
//The definition of the class is really weird!
//I made it passed right now!
//Please check it later!
@@ -85,9 +75,10 @@
DejaGnu.fail("ApplicationDomain.parentDomain property doesn't
exist");
}
-//Si:
+
//Adobe may have these properties, we do not.
//allowLoadBytesCodeExecuiton does not exist!
+// What? FIXME
// if (x1.domainMemory == ByteArray) {
// DejaGnu.pass("ApplicationDomain.domainMemory property exists");
@@ -104,7 +95,7 @@
// existance of a method, and don't test the functionality at all. This
// is primarily useful only to test completeness of the API implementation.
-//Si:
+
//Check Functions!
//Check completed!
@@ -119,6 +110,8 @@
DejaGnu.fail("ApplicationDomain::hasDefinition() method doesn't
exist");
}
+#else
+ DejaGnu.note("Application domain does not exist prior to SWF 9");
#end
// Call this after finishing all tests. It prints out the totals.
=== modified file
'testsuite/misc-haxe.all/classes.all/system/IMEConversionMode_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/system/IMEConversionMode_as.hx
2009-06-01 21:58:06 +0000
+++ b/testsuite/misc-haxe.all/classes.all/system/IMEConversionMode_as.hx
2009-08-13 20:51:30 +0000
@@ -96,7 +96,11 @@
}
// Call this after finishing all tests. It prints out the totals.
+#else
+ DejaGnu.note("The IMEConversionMode class did not exist in versions
prior to SWF9");
+
#end
+
DejaGnu.done();
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/system/IME_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/system/IME_as.hx 2009-06-01
21:58:06 +0000
+++ b/testsuite/misc-haxe.all/classes.all/system/IME_as.hx 2009-08-13
20:51:30 +0000
@@ -77,6 +77,8 @@
}
// Call this after finishing all tests. It prints out the totals.
+#else
+ DejaGnu.note("The IME class did not exist in versions prior to SWF9");
#end
DejaGnu.done();
=== modified file
'testsuite/misc-haxe.all/classes.all/system/LoaderContext_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/system/LoaderContext_as.hx
2009-06-01 21:58:06 +0000
+++ b/testsuite/misc-haxe.all/classes.all/system/LoaderContext_as.hx
2009-08-13 20:51:30 +0000
@@ -109,11 +109,13 @@
DejaGnu.fail("LoaderContext.securityDomain property doesn't exist");
}
+#else
+ DejaGnu.note("LoaderContext did not exist in versions prior to SWF9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
-#else
-#end
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/system/SecurityDomain_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/system/SecurityDomain_as.hx
2009-06-01 21:58:06 +0000
+++ b/testsuite/misc-haxe.all/classes.all/system/SecurityDomain_as.hx
2009-08-13 20:51:30 +0000
@@ -49,6 +49,8 @@
} else {
DejaGnu.fail("SecurityDomain class doesn't exist");
}
+#else
+ DejaGnu.note("SecurityDomain did not exist in versions prior to SWF9");
#end
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
=== modified file
'testsuite/misc-haxe.all/classes.all/system/SecurityPanel_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/system/SecurityPanel_as.hx
2009-06-01 21:58:06 +0000
+++ b/testsuite/misc-haxe.all/classes.all/system/SecurityPanel_as.hx
2009-08-13 20:51:30 +0000
@@ -50,6 +50,9 @@
} else {
DejaGnu.fail("SecurityPanel class doesn't exist");
}
+
+#else
+ DejaGnu.note("SecurityPanel did not exist in versions prior to SWF9");
#end
// Call this after finishing all tests. It prints out the totals.
=== modified file 'testsuite/misc-haxe.all/classes.all/text/StyleSheet_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/text/StyleSheet_as.hx 2009-06-03
19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/text/StyleSheet_as.hx 2009-08-13
20:51:30 +0000
@@ -39,7 +39,8 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class StyleSheet_as {
static function main() {
- #if flash9
+
+#if flash9
var x1:StyleSheet = new StyleSheet();
// Make sure we actually get a valid class
@@ -89,9 +90,13 @@
DejaGnu.note("transform: " + Type.typeof(x1.transform));
}
+
+#else
+ DejaGnu.note("StyleSheet did not exist before SWF9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/text/TextColorType_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/text/TextColorType_as.hx
2009-06-02 22:39:40 +0000
+++ b/testsuite/misc-haxe.all/classes.all/text/TextColorType_as.hx
2009-08-13 20:51:30 +0000
@@ -42,8 +42,7 @@
// var x1:TextColorType = new TextColorType();
-//Si:
-//Check the followings:
+
#if flash9
// Make sure we actually get a valid class
if (Type.typeof(TextColorType)== TObject) {
@@ -63,11 +62,15 @@
DejaGnu.fail("TextColorType LIGHT_COLOR 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.
+#else
+ DejaGnu.note("TextColorType did not exist before SWF9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
}
=== modified file
'testsuite/misc-haxe.all/classes.all/text/TextDisplayMode_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/text/TextDisplayMode_as.hx
2009-06-02 22:39:40 +0000
+++ b/testsuite/misc-haxe.all/classes.all/text/TextDisplayMode_as.hx
2009-08-13 20:51:30 +0000
@@ -41,8 +41,6 @@
static function main() {
//var x1:TextDisplayMode = new TextDisplayMode();
-//Si:
-//Check the following:
#if flash9
// Make sure we actually get a valid class
@@ -75,7 +73,10 @@
// existance of a method, and don't test the functionality at all. This
// is primarily useful only to test completeness of the API implementation.
// Call this after finishing all tests. It prints out the totals.
+#else
+ DejaGnu.note("TextDisplayMode did not exist before SWF9");
#end
+
DejaGnu.done();
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/text/TextFieldAutoSize_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/text/TextFieldAutoSize_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/text/TextFieldAutoSize_as.hx
2009-08-13 20:51:30 +0000
@@ -39,7 +39,8 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class TextFieldAutoSize_as {
static function main() {
- #if flash9
+
+#if flash9
// Make sure we actually get a valid class
if (Type.typeof(TextFieldAutoSize)==TObject) {
DejaGnu.pass("TextFieldAutoSize class exists.");
@@ -71,9 +72,13 @@
DejaGnu.fail("TextFieldAutoSize.RIGHT constant doesn't exist");
}
+#else
+ DejaGnu.note("TextFieldAutosize did not exist before SWF9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
+
}
}
=== modified file 'testsuite/misc-haxe.all/classes.all/text/TextFieldType_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/text/TextFieldType_as.hx
2009-06-03 19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/text/TextFieldType_as.hx
2009-08-13 20:51:30 +0000
@@ -61,9 +61,13 @@
DejaGnu.fail("TextFieldType.INPUT constant doesn't exist");
}
+
+#else
+ DejaGnu.note("TextFieldType did not exist before SWF9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
=== modified file
'testsuite/misc-haxe.all/classes.all/text/TextFormatAlign_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/text/TextFormatAlign_as.hx
2009-06-02 22:39:40 +0000
+++ b/testsuite/misc-haxe.all/classes.all/text/TextFormatAlign_as.hx
2009-08-13 20:51:30 +0000
@@ -73,6 +73,10 @@
// 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.
+
+
+#else
+ DejaGnu.note("TextFormatAlign did not exist before SWF9");
#end
// Call this after finishing all tests. It prints out the totals.
=== modified file 'testsuite/misc-haxe.all/classes.all/text/TextFormat_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/text/TextFormat_as.hx 2009-08-12
17:03:54 +0000
+++ b/testsuite/misc-haxe.all/classes.all/text/TextFormat_as.hx 2009-08-13
21:02:02 +0000
@@ -33,6 +33,7 @@
import flash.Lib;
import Type;
import Std;
+import haxe.PosInfos;
// import our testing API
import DejaGnu;
=== modified file 'testsuite/misc-haxe.all/classes.all/utils/Proxy_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/utils/Proxy_as.hx 2009-06-03
19:42:00 +0000
+++ b/testsuite/misc-haxe.all/classes.all/utils/Proxy_as.hx 2009-08-13
20:51:30 +0000
@@ -39,7 +39,8 @@
// Class must be named with the _as suffix, as that's the same name as the
file.
class Proxy_as {
static function main() {
- #if flash9
+
+#if flash9
var x1:Proxy = new Proxy();
// Make sure we actually get a valid class
@@ -53,9 +54,13 @@
// existance of a method, and don't test the functionality at all. This
// is primarily useful only to test completeness of the API implementation.
+
+#else
+ DejaGnu.note("Proxy class did not exist in versions prior to SWF 9");
+#end
+
// Call this after finishing all tests. It prints out the totals.
DejaGnu.done();
- #end
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11420: Minor changes to output of many test cases for clarity. Major changes to haxe test case display/BitmapData_as.hx. Added much imporved tests for the pp. Will test again in light of recent changes to BitmapData.cpp,
Jon Crider <=