diff options
| author | Marcus Boerger <helly@php.net> | 2005-07-18 00:14:54 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2005-07-18 00:14:54 +0000 |
| commit | 503330fb88dde112f010a90f2e7e501deed634c2 (patch) | |
| tree | 026ef9f1e58106a6462553de4d9a0cd3a1e40e66 /ext/ming | |
| parent | 70ec0f41ace74a5a7bc39d88b7f6ba983c11e135 (diff) | |
| download | php-git-503330fb88dde112f010a90f2e7e501deed634c2.tar.gz | |
- Provide distinction and distinct tests
Diffstat (limited to 'ext/ming')
| -rw-r--r-- | ext/ming/ming.c | 10 | ||||
| -rwxr-xr-x | ext/ming/tests/swfaction-new.phpt | 51 | ||||
| -rw-r--r-- | ext/ming/tests/swfaction.phpt | 7 |
3 files changed, 66 insertions, 2 deletions
diff --git a/ext/ming/ming.c b/ext/ming/ming.c index 5501b77288..2fdc81da68 100644 --- a/ext/ming/ming.c +++ b/ext/ming/ming.c @@ -4068,6 +4068,16 @@ PHP_MINIT_FUNCTION(ming) #define CONSTANT(s,c) REGISTER_LONG_CONSTANT((s), (c), CONST_CS | CONST_PERSISTENT) +#ifdef HAVE_NEW_MING + CONSTANT("MING_NEW", 1); +#else + CONSTANT("MING_NEW", 0); +#endif +#ifdef HAVE_MING_ZLIB + CONSTANT("MING_ZLIB", 1); +#else + CONSTANT("MING_ZLIB", 0); +#endif /* flags for SWFButton_addShape */ CONSTANT("SWFBUTTON_HIT", SWFBUTTONRECORD_HITSTATE); CONSTANT("SWFBUTTON_DOWN", SWFBUTTONRECORD_DOWNSTATE); diff --git a/ext/ming/tests/swfaction-new.phpt b/ext/ming/tests/swfaction-new.phpt new file mode 100755 index 0000000000..4352710015 --- /dev/null +++ b/ext/ming/tests/swfaction-new.phpt @@ -0,0 +1,51 @@ +--TEST-- +Ming: Simple SWFAction() test +--SKIPIF-- +<?php +if (!extension_loaded("ming")) die("skip"); +if (!MING_NEW && !MING_ZLIB) die("skip old ming"); +?> +--FILE-- +<?php /* $Id$ */ + + $s = new SWFShape(); + $f = $s->addFill(0xff, 0, 0); + $s->setRightFill($f); + + $s->movePenTo(-500,-500); + $s->drawLineTo(500,-500); + $s->drawLineTo(500,500); + $s->drawLineTo(-500,500); + $s->drawLineTo(-500,-500); + + $p = new SWFSprite(); + $i = $p->add($s); + $i->setDepth(1); + $p->nextFrame(); + + for($n=0; $n<5; ++$n) + { + $i->rotate(-15); + $p->nextFrame(); + } + + $m = new SWFMovie(); + $m->setBackground(0xff, 0xff, 0xff); + $m->setDimension(6000,4000); + + $i = $m->add($p); + $i->setDepth(1); + $i->moveTo(1000,2000); + $i->setName("box"); + + $m->add(new SWFAction("_root.box._x += 3;")); + $m->nextFrame(); + $m->add(new SWFAction("gotoFrame(0); play();")); + $m->nextFrame(); + + $m->save(dirname(__FILE__).'/test.swf'); + echo md5_file(dirname(__FILE__).'/test.swf'), "\n"; + unlink(dirname(__FILE__).'/test.swf'); +?> +--EXPECT-- +d0f09a7b6a14d3fe6d570367deb38633 diff --git a/ext/ming/tests/swfaction.phpt b/ext/ming/tests/swfaction.phpt index f29bcdb47d..4717c7c998 100644 --- a/ext/ming/tests/swfaction.phpt +++ b/ext/ming/tests/swfaction.phpt @@ -1,7 +1,10 @@ --TEST-- Ming: Simple SWFAction() test --SKIPIF-- -<?php if (!extension_loaded("ming")) print "skip"; ?> +<?php +if (!extension_loaded("ming")) die("skip"); +if (MING_NEW || MING_ZLIB) die("skip new ming"); +?> --FILE-- <?php /* $Id$ */ @@ -40,7 +43,7 @@ Ming: Simple SWFAction() test $m->add(new SWFAction("gotoFrame(0); play();")); $m->nextFrame(); - $m->save(dirname(__FILE__).'/test.swf', 0); + $m->save(dirname(__FILE__).'/test.swf'); echo md5_file(dirname(__FILE__).'/test.swf'), "\n"; unlink(dirname(__FILE__).'/test.swf'); ?> |
