gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r9537: More tests for instance const


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9537: More tests for instance construction, minor change to BitmapData.
Date: Fri, 25 Jul 2008 11:43:24 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9537
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2008-07-25 11:43:24 +0200
message:
  More tests for instance construction, minor change to BitmapData.
modified:
  libcore/asobj/flash/display/BitmapData_as.cpp
  testsuite/actionscript.all/BitmapData.as
  testsuite/actionscript.all/Instance.as
  testsuite/swfdec/PASSING
    ------------------------------------------------------------
    revno: 9536.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-07-25 10:37:24 +0200
    message:
      New swfdec tests
    modified:
      testsuite/swfdec/PASSING
    ------------------------------------------------------------
    revno: 9536.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-07-25 11:03:48 +0200
    message:
      Add a few more tests.
    modified:
      testsuite/actionscript.all/BitmapData.as
    ------------------------------------------------------------
    revno: 9536.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-07-25 11:04:02 +0200
    message:
      Add test for BitmapData construction.
    modified:
      testsuite/actionscript.all/Instance.as
    ------------------------------------------------------------
    revno: 9536.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-07-25 11:09:44 +0200
    message:
      More tests for dimensions, also test height property.
    modified:
      testsuite/actionscript.all/BitmapData.as
    ------------------------------------------------------------
    revno: 9536.1.5
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-07-25 11:10:16 +0200
    message:
      Return undefined from constructor when the dimensions are invalid.
      This should not construct an object, but will do after strk's changes
      (better than the assertion failure before). It will at least have no
      BitmapData properties.
    modified:
      libcore/asobj/flash/display/BitmapData_as.cpp
    ------------------------------------------------------------
    revno: 9536.1.6
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Fri 2008-07-25 11:30:42 +0200
    message:
      A few more checks, mark failing tests.
    modified:
      testsuite/actionscript.all/BitmapData.as
      testsuite/actionscript.all/Instance.as
=== modified file 'libcore/asobj/flash/display/BitmapData_as.cpp'
--- a/libcore/asobj/flash/display/BitmapData_as.cpp     2008-06-21 15:32:20 
+0000
+++ b/libcore/asobj/flash/display/BitmapData_as.cpp     2008-07-25 09:10:16 
+0000
@@ -583,9 +583,9 @@
             break;
     }
     
-    // Should fail to construct the object.
-    if (width > 2880) width = 2880;
-    if (height > 2880) height = 2880;
+    // FIXME: Should fail to construct the object.
+    if (width > 2880 || height > 2880) return as_value();
+    if (width < 1 || height < 1) return as_value();
 
     boost::intrusive_ptr<BitmapData_as> obj =
                 new BitmapData_as(width, height, transparent, fillColor);

=== modified file 'testsuite/actionscript.all/BitmapData.as'
--- a/testsuite/actionscript.all/BitmapData.as  2008-06-20 12:28:54 +0000
+++ b/testsuite/actionscript.all/BitmapData.as  2008-07-25 09:30:42 +0000
@@ -111,16 +111,40 @@
 // 0,0 is inside, 20, 30 outside a 20x30 bitmap.
 check_equals(bmp.getPixel(20, 30), 0);
 
-bmp = new Bitmap(10000, 0);
-xcheck_equals(bmp, undefined);
+
+// 2880 is the maximum, 1 the minimum. Returns
+// undefined if the dimensions are invalid.
+bmp = new Bitmap(10000, 3);
+xcheck_equals(typeof(bmp), "undefined");
+check_equals(bmp.height, undefined);
+
 bmp = new Bitmap(0, 10000);
 xcheck_equals(bmp, undefined);
-
-bmp = new Bitmap(2881, 0);
+check_equals(bmp.height, undefined);
+
+bmp = new Bitmap(2880, 2880);
+check_equals(typeof(bmp), "object");
+check_equals(bmp.height, 2880);
+
+bmp = new Bitmap(2880, 2881);
 xcheck_equals(typeof(bmp), "undefined");
-bmp = new Bitmap(0, 2881);
-xcheck_equals(bmp, undefined);
-
+check_equals(bmp.height, undefined);
+
+bmp = new Bitmap(0, 2880);
+xcheck_equals(bmp, undefined);
+check_equals(bmp.height, undefined);
+
+bmp = new Bitmap(2879, 2879);
+check_equals(typeof(bmp), "object");
+check_equals(bmp.height, 2879);
+
+bmp = new Bitmap(0, 2879);
+xcheck_equals(bmp, undefined);
+check_equals(bmp.height, undefined);
+
+bmp = new Bitmap(-1, 10, false, 0xff);
+xcheck_equals(bmp, undefined);
+check_equals(bmp.height, undefined);
 
 // floodFill
 bmp = new Bitmap(20, 20, false);
@@ -187,6 +211,6 @@
 // END OF TEST
 //-------------------------------------------------------------
 
-totals(77);
+totals(89);
 
 #endif // OUTPUT_VERSION >= 8

=== modified file 'testsuite/actionscript.all/Instance.as'
--- a/testsuite/actionscript.all/Instance.as    2008-07-24 18:20:21 +0000
+++ b/testsuite/actionscript.all/Instance.as    2008-07-25 09:30:42 +0000
@@ -114,4 +114,16 @@
 check_equals(o.valueOf(), undefined);
 check(!o instanceOf Object);
 
-check_totals(32);
+// This should be undefined in SWF7 and below because BitmapData doesn't exist.
+// It should be undefined in SWF8 because the object isn't constructed when the
+// given values are incorrect.
+o = new flash.display.BitmapData();
+#if OUTPUT_VERSION < 8
+check_equals(typeof(o), "undefined");
+check_equals(o, undefined);
+#else
+xcheck_equals(typeof(o), "undefined");
+xcheck_equals(o, undefined);
+#endif
+
+check_totals(34);

=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING  2008-07-23 10:35:04 +0000
+++ b/testsuite/swfdec/PASSING  2008-07-25 08:37:24 +0000
@@ -87,6 +87,9 @@
 beginFill-values-8.swf:6413d81730e062f9ded5052440cb3144
 bevel-filter-properties-5.swf:019bb55478951055973b5f953b2e82ef
 bevel-filter-properties-5.swf:0ec31af3035594a9cbcb1ba8a645ad4c
+bitmapdata-getters-5.swf:b32dce961f672c8c7ae32d5cee3d8f45
+bitmapdata-getters-6.swf:305acbd129fc45f26837dec9f24720ca
+bitmapdata-getters-7.swf:93e7771bb9f3ad11318b18c136555649
 bitmap-filter-properties-5.swf:62973bfcdf9f1fd383440fabcbfebca9
 bitmap-filter-properties-5.swf:d69ea38322111b3626c6b9577838674f
 bitwise-5.swf:98475055aae4796a066e7728d5a7a944


reply via email to

[Prev in Thread] Current Thread [Next in Thread]