~ubuntu-branches/ubuntu/karmic/gnash/karmic

« back to all changes in this revision

Viewing changes to testsuite/actionscript.all/Color.as

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-10-13 14:29:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081013142949-f6qdvnu4mn05ltdc
Tags: 0.8.4~~bzr9980-0ubuntu1
* new upstream release 0.8.4 (LP: #240325)
* ship new lib usr/lib/gnash/libmozsdk.so.* in mozilla-plugin-gnash
  - update debian/mozilla-plugin-gnash.install
* ship new lib usr/lib/gnash/libgnashnet.so.* in gnash-common
  - update debian/gnash-common.install
* add basic debian/build_head script to build latest CVS head packages.
  - add debian/build_head
* new sound architecture requires build depend on libsdl1.2-dev
  - update debian/control
* head build script now has been completely migrated to bzr (upstream +
  ubuntu)
  - update debian/build_head
* disable kde gui until klash/qt4 has been fixed; keep kde packages as empty
  packages for now.
  - update debian/rules
  - debian/klash.install
  - debian/klash.links
  - debian/klash.manpages
  - debian/konqueror-plugin-gnash.install
* drop libkonq5-dev build dependency accordingly
  - update debian/control
* don't install headers manually anymore. gnash doesnt provide a -dev
  package after all
  - update debian/rules
* update libs installed in gnash-common; libgnashserver-*.so is not available
  anymore (removed); in turn we add the new libgnashcore-*.so
  - update debian/gnash-common.install
* use -Os for optimization and properly pass CXXFLAGS=$(CFLAGS) to configure
  - update debian/rules
* touch firefox .autoreg in postinst of mozilla plugin
  - update debian/mozilla-plugin-gnash.postinst
* link gnash in ubufox plugins directory for the plugin alternative switcher
  - add debian/mozilla-plugin-gnash.links
* suggest ubufox accordingly
  - update debian/control
* add new required build-depends on libgif-dev
  - update debian/control
* add Xb-Npp-Description and Xb-Npp-File as new plugin database meta data
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
// compile this test case with Ming makeswf, and then
22
22
// execute it like this gnash -1 -r 0 -v out.swf
23
23
 
24
 
rcsid="$Id: Color.as,v 1.12 2007/11/02 17:50:50 strk Exp $";
25
24
 
 
25
rcsid="$Id: Color.as,v 1.20 2008/05/23 02:30:21 zoulunkai Exp $";
26
26
#include "check.as"
27
27
 
28
28
//--------------------------------
218
218
check_equals ( trans2.rb, 0 );
219
219
check_equals ( trans2.ga, -50 );
220
220
check_equals ( trans2.gb, 255 );
221
 
xcheck_equals ( Math.round(trans2.ba*100)/100, 31.64 ); // gnash returns 32, who's right ?
 
221
// pp uses 1/256 accuracy, 31.640625 == int(0.32*256)*100/256.0f
 
222
check( trans2.ba - 31.640625 < 0.000001 ); // Don't use check_equals or Math.round here.
222
223
check_equals ( trans2.bb, 2 );
223
224
check_equals ( trans2.aa, 100 );
224
225
check_equals ( trans2.ab, 0 );
240
241
check_equals ( trans.aa, 100 );
241
242
check_equals ( trans.ab, 0 );
242
243
 
 
244
//
 
245
// Accuracy test
 
246
//
 
247
trans.ra = 99.9;
 
248
trans.rb = 99.9;
 
249
colorObj.setTransform(trans);
 
250
trans2 = colorObj.getTransform();
 
251
// 99.609375 == int(0.999*256)*100/256.0
 
252
check(trans2.ra - 99.609375 < 0.0000001); // Don't use check_equals or Math.round here.
 
253
check_equals(trans2.rb, 99);
 
254
 
 
255
#if OUTPUT_VERSION >= 6
 
256
trans.aa = 12800; // 0x80 * 100
 
257
trans.ab = 0;
 
258
_root.createEmptyMovieClip("mc1", 10);
 
259
check_equals(mc1._alpha, 100);
 
260
colorObj = new Color(mc1);
 
261
colorObj.setTransform(trans);
 
262
trans2 = colorObj.getTransform();
 
263
// (int16)(12800 / 100.0 * 256) == -12800
 
264
// Gnash failed, but not due to accuracy problem,
 
265
// _alpha is not calculated correctly.
 
266
xcheck_equals(mc1._alpha, -12800);
 
267
 
 
268
trans.ab = 10;
 
269
// _alpha is not calculated correctly. Not sure about the algorithm at the moment. 
 
270
xcheck_equals(mc1._alpha, -12800);
 
271
 
 
272
mc1._alpha = 60;
 
273
trans2 = colorObj.getTransform();
 
274
// 59.765625: value retrieved from AS
 
275
// int(60 / 100.0 * 256): value stored in cxform. 
 
276
// 59.765625 == int(60 / 100.0 * 256) / 2.56
 
277
check(trans2.aa - 59.765625 < 0.0000001);
 
278
check_equals(trans.ab, 10);
 
279
#endif
 
280
 
 
281
//
 
282
// Some tests for same-named (case-insensitive) variables in SWF6
 
283
//
 
284
#if OUTPUT_VERSION == 6
 
285
color = 8;
 
286
 
 
287
c = new Color;
 
288
check_equals(c, undefined);
 
289
c = new color;
 
290
check_equals(c, undefined);
 
291
 
 
292
delete color;
 
293
c = new Color;
 
294
check_equals (typeof(c), 'object');
 
295
c = new color;
 
296
check_equals (typeof(c), 'object');
 
297
 
 
298
color = 8;
 
299
check_equals (typeof(c), 'object');
 
300
check_equals (typeof(c), 'object');
 
301
 
 
302
delete c;
 
303
c = new Color;
 
304
check_equals (typeof(c), 'undefined');
 
305
c = new color;
 
306
check_equals (typeof(c), 'undefined');
 
307
 
 
308
delete color; // variable
 
309
delete color; // class
 
310
c = new Color;
 
311
check_equals (typeof(c), 'undefined');
 
312
c = new color;
 
313
check_equals (typeof(c), 'undefined');
 
314
 
 
315
// Do not add any tests after here (color deleted).
 
316
#endif
 
317
 
243
318
//-----------------------------------------------------------
244
319
// end of test
245
320
//-----------------------------------------------------------