You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2019/08/09 05:24:30 UTC
[royale-asjs] branch develop updated: Attempt to fix Reflection
tests
This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 1646da8 Attempt to fix Reflection tests
1646da8 is described below
commit 1646da82ebffcfd5ef551bf5b28d6a50691b28e6
Author: greg-dove <gr...@gmail.com>
AuthorDate: Fri Aug 9 17:24:16 2019 +1200
Attempt to fix Reflection tests
---
.../reflection/ReflectionTesterNativeTypes.as | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/frameworks/projects/Reflection/src/test/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as b/frameworks/projects/Reflection/src/test/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as
index 0e80fef..d831e45 100644
--- a/frameworks/projects/Reflection/src/test/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as
+++ b/frameworks/projects/Reflection/src/test/royale/flexUnitTests/reflection/ReflectionTesterNativeTypes.as
@@ -21,7 +21,7 @@ package flexUnitTests.reflection
import org.apache.royale.test.asserts.*;
import flexUnitTests.reflection.support.*;
import org.apache.royale.reflection.*;
- //import testshim.RoyaleUnitTestRunner;
+ import org.apache.royale.test.Runtime;
/**
* @royalesuppresspublicvarwarning
@@ -29,7 +29,17 @@ package flexUnitTests.reflection
public class ReflectionTesterNativeTypes
{
- public static var isJS:Boolean = COMPILE::JS;;
+ public static var isJS:Boolean = COMPILE::JS;
+
+ public static function getSwfVersion():uint{
+ COMPILE::SWF{
+ return Runtime.swfVersion;
+ }
+ COMPILE::JS {
+ //this mimics the version of the flash player that is 11.3
+ return 16
+ }
+ }
[BeforeClass]
public static function setUpBeforeClass():void
@@ -123,7 +133,7 @@ package flexUnitTests.reflection
var def:TypeDefinition = describeType(Number);
//player 11.2 and below has zero static methods in the Number class reflection.
//from player 11.3 and above it has 18 (same as javascript)
- const expectedCount:uint = COMPILE::JS ? 18 : 0;
+ const expectedCount:uint = getSwfVersion() >= 16 ? 18 : 0;
assertEquals( def.staticMethods.length , expectedCount, "unexpected value");
assertEquals( def.name, "Number", "Unexpected type name");
}
@@ -140,7 +150,7 @@ package flexUnitTests.reflection
assertEquals( def.name, "Number", "Unexpected type name");
//player 11.2 and below has zero static methods in the Number class reflection.
//from player 11.3 and above it has 18 (same as javascript)
- const expectedCount:uint = COMPILE::JS ? 18 : 0;
+ const expectedCount:uint = getSwfVersion() >= 16 ? 18 : 0;
assertEquals( def.staticMethods.length , expectedCount, "unexpected value");
}