[Swfdec] 9 commits - configure.ac test/custom test/Makefile.am test/swfdec_test_initialize.as test/swfdec_test_initialize.h test/swfdec_test_test.c test/trace
Benjamin Otte
company at kemper.freedesktop.org
Tue Jan 8 04:33:27 PST 2008
configure.ac | 1
dev/null |binary
test/Makefile.am | 2
test/custom/.gitignore | 2
test/custom/Makefile.am | 85 +++
test/custom/button-events-button-5.swf |binary
test/custom/button-events-button-5.swf.trace | 60 ++
test/custom/button-events-button-6.swf |binary
test/custom/button-events-button-6.swf.trace | 68 +++
test/custom/button-events-button-7.swf |binary
test/custom/button-events-button-7.swf.trace | 68 +++
test/custom/button-events-button-8.swf |binary
test/custom/button-events-button-8.swf.trace | 68 +++
test/custom/button-events-menu-5.swf |binary
test/custom/button-events-menu-5.swf.trace | 53 ++
test/custom/button-events-menu-6.swf |binary
test/custom/button-events-menu-6.swf.trace | 60 ++
test/custom/button-events-menu-7.swf |binary
test/custom/button-events-menu-7.swf.trace | 60 ++
test/custom/button-events-menu-8.swf |binary
test/custom/button-events-menu-8.swf.trace | 60 ++
test/custom/button-events.c | 144 ++++++
test/custom/button-events.stas | 64 +++
test/custom/button-events.sts |binary
test/custom/definebutton-5.swf |binary
test/custom/definebutton-5.swf.trace | 18
test/custom/definebutton-6.swf |binary
test/custom/definebutton-6.swf.trace | 18
test/custom/definebutton-7.swf |binary
test/custom/definebutton-7.swf.trace | 18
test/custom/definebutton-8.swf |binary
test/custom/definebutton-8.swf.trace | 18
test/custom/definebutton.stas | 64 +++
test/custom/definebutton.sts |binary
test/custom/definebutton.xml | 138 ++++++
test/custom/mouse-addProperty-relevant-5.swf |binary
test/custom/mouse-addProperty-relevant-5.swf.trace | 1
test/custom/mouse-addProperty-relevant-6.swf |binary
test/custom/mouse-addProperty-relevant-6.swf.trace | 3
test/custom/mouse-addProperty-relevant-7.swf |binary
test/custom/mouse-addProperty-relevant-7.swf.trace | 3
test/custom/mouse-addProperty-relevant-8.swf |binary
test/custom/mouse-addProperty-relevant-8.swf.trace | 3
test/custom/mouse-addProperty-relevant.as | 23 +
test/custom/mouse-addProperty-relevant.stas | 56 ++
test/custom/mouse-addProperty-relevant.sts |binary
test/custom/mouse-movie-below-movie-5.swf |binary
test/custom/mouse-movie-below-movie-6.swf |binary
test/custom/mouse-movie-below-movie-6.swf.trace | 9
test/custom/mouse-movie-below-movie-7.swf |binary
test/custom/mouse-movie-below-movie-7.swf.trace | 9
test/custom/mouse-movie-below-movie-8.swf |binary
test/custom/mouse-movie-below-movie-8.swf.trace | 9
test/custom/mouse-movie-below-movie.as | 27 +
test/custom/mouse-movie-below-nonevent-movie-5.swf |binary
test/custom/mouse-movie-below-nonevent-movie-6.swf |binary
test/custom/mouse-movie-below-nonevent-movie-6.swf.trace | 5
test/custom/mouse-movie-below-nonevent-movie-7.swf |binary
test/custom/mouse-movie-below-nonevent-movie-7.swf.trace | 5
test/custom/mouse-movie-below-nonevent-movie-8.swf |binary
test/custom/mouse-movie-below-nonevent-movie-8.swf.trace | 5
test/custom/mouse-movie-below-nonevent-movie.as | 27 +
test/custom/mouse-movie-below.stas | 64 +++
test/custom/mouse-movie-below.sts |binary
test/custom/mouse-scaled-5.swf |binary
test/custom/mouse-scaled-5.swf.trace | 1
test/custom/mouse-scaled-6.swf |binary
test/custom/mouse-scaled-6.swf.trace | 9
test/custom/mouse-scaled-6.swf.trace.org | 9
test/custom/mouse-scaled-7.swf |binary
test/custom/mouse-scaled-7.swf.trace | 9
test/custom/mouse-scaled-7.swf.trace.org | 9
test/custom/mouse-scaled.as | 17
test/custom/mouse-scaled.stas | 56 ++
test/custom/mouse-scaled.sts |binary
test/swfdec_test_initialize.as | 3
test/swfdec_test_initialize.h | 58 +-
test/swfdec_test_test.c | 55 ++
test/trace/.gitignore | 10
test/trace/Makefile.am | 17
test/trace/button-events-button-5.swf.act | 17
test/trace/button-events-button-5.swf.trace | 60 --
test/trace/button-events-button-6.swf.act | 17
test/trace/button-events-button-6.swf.trace | 68 ---
test/trace/button-events-button-7.swf.act | 17
test/trace/button-events-button-7.swf.trace | 68 ---
test/trace/button-events-button-8.swf.act | 17
test/trace/button-events-button-8.swf.trace | 68 ---
test/trace/button-events-menu-5.swf.act | 17
test/trace/button-events-menu-5.swf.trace | 53 --
test/trace/button-events-menu-6.swf.act | 17
test/trace/button-events-menu-6.swf.trace | 60 --
test/trace/button-events-menu-7.swf.act | 17
test/trace/button-events-menu-7.swf.trace | 60 --
test/trace/button-events-menu-8.swf.act | 17
test/trace/button-events-menu-8.swf.trace | 60 --
test/trace/button-events.c | 144 ------
test/trace/default.as | 49 ++
test/trace/default.sts |binary
test/trace/definebutton-5.swf.act | 17
test/trace/definebutton-5.swf.trace | 18
test/trace/definebutton-6.swf.act | 17
test/trace/definebutton-6.swf.trace | 18
test/trace/definebutton-7.swf.act | 17
test/trace/definebutton-7.swf.trace | 18
test/trace/definebutton-8.swf.act | 17
test/trace/definebutton-8.swf.trace | 18
test/trace/definebutton.xml | 138 ------
test/trace/mouse-addProperty-relevant-5.swf.act | 9
test/trace/mouse-addProperty-relevant-5.swf.trace | 1
test/trace/mouse-addProperty-relevant-6.swf.act | 9
test/trace/mouse-addProperty-relevant-6.swf.trace | 3
test/trace/mouse-addProperty-relevant-7.swf.act | 9
test/trace/mouse-addProperty-relevant-7.swf.trace | 3
test/trace/mouse-addProperty-relevant-8.swf.act | 9
test/trace/mouse-addProperty-relevant-8.swf.trace | 3
test/trace/mouse-addProperty-relevant.as | 23 -
test/trace/mouse-movie-below-movie-5.swf.act | 17
test/trace/mouse-movie-below-movie-6.swf.act | 17
test/trace/mouse-movie-below-movie-6.swf.trace | 9
test/trace/mouse-movie-below-movie-7.swf.act | 17
test/trace/mouse-movie-below-movie-7.swf.trace | 9
test/trace/mouse-movie-below-movie-8.swf.act | 17
test/trace/mouse-movie-below-movie-8.swf.trace | 9
test/trace/mouse-movie-below-movie.as | 27 -
test/trace/mouse-movie-below-nonevent-movie-5.swf.act | 17
test/trace/mouse-movie-below-nonevent-movie-6.swf.act | 17
test/trace/mouse-movie-below-nonevent-movie-6.swf.trace | 5
test/trace/mouse-movie-below-nonevent-movie-7.swf.act | 17
test/trace/mouse-movie-below-nonevent-movie-7.swf.trace | 5
test/trace/mouse-movie-below-nonevent-movie-8.swf.act | 17
test/trace/mouse-movie-below-nonevent-movie-8.swf.trace | 5
test/trace/mouse-movie-below-nonevent-movie.as | 27 -
test/trace/mouse-scaled-5.swf.act | 9
test/trace/mouse-scaled-5.swf.trace | 1
test/trace/mouse-scaled-6.swf.act | 9
test/trace/mouse-scaled-6.swf.trace | 9
test/trace/mouse-scaled-6.swf.trace.org | 9
test/trace/mouse-scaled-7.swf.act | 9
test/trace/mouse-scaled-7.swf.trace | 9
test/trace/mouse-scaled-7.swf.trace.org | 9
test/trace/mouse-scaled.as | 17
test/trace/swfdec_interaction.c | 289 -------------
test/trace/swfdec_interaction.h | 87 ----
test/trace/trace.c | 319 ---------------
145 files changed, 1569 insertions(+), 2183 deletions(-)
New commits:
commit 5ccb283352c238eb859117720293c9c445cdb606
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 13:31:38 2008 +0100
and the last test is gone, too
diff --git a/test/custom/Makefile.am b/test/custom/Makefile.am
index 938edc5..0e937d8 100644
--- a/test/custom/Makefile.am
+++ b/test/custom/Makefile.am
@@ -56,29 +56,21 @@ EXTRA_DIST = \
mouse-addProperty-relevant-8.swf.trace \
mouse-movie-below-movie.as \
mouse-movie-below-movie-5.swf \
- mouse-movie-below-movie-5.swf.act \
mouse-movie-below-movie-5.swf.trace \
mouse-movie-below-movie-6.swf \
- mouse-movie-below-movie-6.swf.act \
mouse-movie-below-movie-6.swf.trace \
mouse-movie-below-movie-7.swf \
- mouse-movie-below-movie-7.swf.act \
mouse-movie-below-movie-7.swf.trace \
mouse-movie-below-movie-8.swf \
- mouse-movie-below-movie-8.swf.act \
mouse-movie-below-movie-8.swf.trace \
mouse-movie-below-nonevent-movie.as \
mouse-movie-below-nonevent-movie-5.swf \
- mouse-movie-below-nonevent-movie-5.swf.act \
mouse-movie-below-nonevent-movie-5.swf.trace \
mouse-movie-below-nonevent-movie-6.swf \
- mouse-movie-below-nonevent-movie-6.swf.act \
mouse-movie-below-nonevent-movie-6.swf.trace \
mouse-movie-below-nonevent-movie-7.swf \
- mouse-movie-below-nonevent-movie-7.swf.act \
mouse-movie-below-nonevent-movie-7.swf.trace \
mouse-movie-below-nonevent-movie-8.swf \
- mouse-movie-below-nonevent-movie-8.swf.act \
mouse-movie-below-nonevent-movie-8.swf.trace \
mouse-scaled.as \
mouse-scaled.stas \
diff --git a/test/custom/mouse-movie-below-movie-5.swf.act b/test/custom/mouse-movie-below-movie-5.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-movie-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below-movie-6.swf.act b/test/custom/mouse-movie-below-movie-6.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-movie-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below-movie-7.swf.act b/test/custom/mouse-movie-below-movie-7.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-movie-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below-movie-8.swf.act b/test/custom/mouse-movie-below-movie-8.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-movie-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-5.swf.act b/test/custom/mouse-movie-below-nonevent-movie-5.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-nonevent-movie-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-6.swf.act b/test/custom/mouse-movie-below-nonevent-movie-6.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-nonevent-movie-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-7.swf.act b/test/custom/mouse-movie-below-nonevent-movie-7.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-nonevent-movie-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-8.swf.act b/test/custom/mouse-movie-below-nonevent-movie-8.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/custom/mouse-movie-below-nonevent-movie-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/custom/mouse-movie-below.stas b/test/custom/mouse-movie-below.stas
new file mode 100644
index 0000000..6617b65
--- /dev/null
+++ b/test/custom/mouse-movie-below.stas
@@ -0,0 +1,64 @@
+/* Swfdec
+ * Copyright (C) 2008 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+run_test = function (t, file) {
+ var e;
+ print ("Testing " + file);
+ try {
+ t.reset (file);
+ t.trace (file + ".trace");
+ t.advance (300);
+ t.mouse_move (50, 50);
+ t.advance (300);
+ t.mouse_press (50, 50);
+ t.advance (300);
+ t.mouse_move (140, 140);
+ t.advance (300);
+ t.mouse_move (50, 50);
+ t.advance (300);
+ t.mouse_release (50, 50);
+ t.advance (300);
+ t.mouse_press (50, 50);
+ t.advance (300);
+ t.mouse_move (140, 140);
+ t.advance (300);
+ t.mouse_release (140, 140);
+ t.advance (300);
+ t.trace ();
+ } catch (e) {
+ if (e) {
+ error (e);
+ return false;
+ }
+ };
+ Native.print (" OK\n");
+ return true;
+};
+
+filenames.sort ();
+t = new Test ();
+fail = [];
+for (var i = 0; i < filenames.length; i++) {
+ if (!run_test (t, filenames[i]))
+ fail.push (filenames[i]);
+};
+if (fail.length > 0) {
+ error (fail.join ("\n "));
+ throw (fail.length + " failures");
+}
diff --git a/test/custom/mouse-movie-below.sts b/test/custom/mouse-movie-below.sts
new file mode 100644
index 0000000..b904d09
Binary files /dev/null and b/test/custom/mouse-movie-below.sts differ
commit 0914f9683d657ff7db3f8e8f58fe46db703d5a81
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 13:29:16 2008 +0100
another test converted
diff --git a/test/custom/Makefile.am b/test/custom/Makefile.am
index 8b429f3..938edc5 100644
--- a/test/custom/Makefile.am
+++ b/test/custom/Makefile.am
@@ -44,17 +44,15 @@ EXTRA_DIST = \
definebutton.sts \
definebutton.xml \
mouse-addProperty-relevant.as \
+ mouse-addProperty-relevant.stas \
+ mouse-addProperty-relevant.sts \
mouse-addProperty-relevant-5.swf \
- mouse-addProperty-relevant-5.swf.act \
mouse-addProperty-relevant-5.swf.trace \
mouse-addProperty-relevant-6.swf \
- mouse-addProperty-relevant-6.swf.act \
mouse-addProperty-relevant-6.swf.trace \
mouse-addProperty-relevant-7.swf \
- mouse-addProperty-relevant-7.swf.act \
mouse-addProperty-relevant-7.swf.trace \
mouse-addProperty-relevant-8.swf \
- mouse-addProperty-relevant-8.swf.act \
mouse-addProperty-relevant-8.swf.trace \
mouse-movie-below-movie.as \
mouse-movie-below-movie-5.swf \
diff --git a/test/custom/mouse-addProperty-relevant-5.swf.act b/test/custom/mouse-addProperty-relevant-5.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/custom/mouse-addProperty-relevant-5.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/mouse-addProperty-relevant-6.swf.act b/test/custom/mouse-addProperty-relevant-6.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/custom/mouse-addProperty-relevant-6.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/mouse-addProperty-relevant-7.swf.act b/test/custom/mouse-addProperty-relevant-7.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/custom/mouse-addProperty-relevant-7.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/mouse-addProperty-relevant-8.swf.act b/test/custom/mouse-addProperty-relevant-8.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/custom/mouse-addProperty-relevant-8.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/mouse-addProperty-relevant.stas b/test/custom/mouse-addProperty-relevant.stas
new file mode 100644
index 0000000..7d2f269
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant.stas
@@ -0,0 +1,56 @@
+/* Swfdec
+ * Copyright (C) 2008 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+run_test = function (t, file) {
+ var e;
+ print ("Testing " + file);
+ try {
+ t.reset (file);
+ t.trace (file + ".trace");
+ t.advance (1000);
+ t.mouse_move (50, 50);
+ t.advance (1000);
+ t.mouse_press (50, 50);
+ t.advance (1000);
+ t.mouse_move (140, 140);
+ t.advance (1000);
+ t.mouse_release (140, 140);
+ t.advance (1000);
+ t.trace ();
+ } catch (e) {
+ if (e) {
+ error (e);
+ return false;
+ }
+ };
+ Native.print (" OK\n");
+ return true;
+};
+
+filenames.sort ();
+t = new Test ();
+fail = [];
+for (var i = 0; i < filenames.length; i++) {
+ if (!run_test (t, filenames[i]))
+ fail.push (filenames[i]);
+};
+if (fail.length > 0) {
+ error (fail.join ("\n "));
+ throw (fail.length + " failures");
+}
diff --git a/test/custom/mouse-addProperty-relevant.sts b/test/custom/mouse-addProperty-relevant.sts
new file mode 100644
index 0000000..24dd0ad
Binary files /dev/null and b/test/custom/mouse-addProperty-relevant.sts differ
commit e2142d183e234bd5b9b43929f537a8bd71a57512
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 13:26:17 2008 +0100
another test converted
diff --git a/test/custom/Makefile.am b/test/custom/Makefile.am
index 276fe09..8b429f3 100644
--- a/test/custom/Makefile.am
+++ b/test/custom/Makefile.am
@@ -33,17 +33,15 @@ EXTRA_DIST = \
button-hittest-8.swf.trace \
button-hittest.c \
definebutton-5.swf \
- definebutton-5.swf.act \
definebutton-5.swf.trace \
definebutton-6.swf \
- definebutton-6.swf.act \
definebutton-6.swf.trace \
definebutton-7.swf \
- definebutton-7.swf.act \
definebutton-7.swf.trace \
definebutton-8.swf \
- definebutton-8.swf.act \
definebutton-8.swf.trace \
+ definebutton.stas \
+ definebutton.sts \
definebutton.xml \
mouse-addProperty-relevant.as \
mouse-addProperty-relevant-5.swf \
diff --git a/test/custom/definebutton-5.swf.act b/test/custom/definebutton-5.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/definebutton-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/definebutton-6.swf.act b/test/custom/definebutton-6.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/definebutton-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/definebutton-7.swf.act b/test/custom/definebutton-7.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/definebutton-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/definebutton-8.swf.act b/test/custom/definebutton-8.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/definebutton-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/definebutton.stas b/test/custom/definebutton.stas
new file mode 100644
index 0000000..865329d
--- /dev/null
+++ b/test/custom/definebutton.stas
@@ -0,0 +1,64 @@
+/* Swfdec
+ * Copyright (C) 2008 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+run_test = function (t, file) {
+ var e;
+ print ("Testing " + file);
+ try {
+ t.reset (file);
+ t.trace (file + ".trace");
+ t.advance (1000);
+ t.mouse_move (50, 50);
+ t.advance (1000);
+ t.mouse_press (50, 50);
+ t.advance (1000);
+ t.mouse_move (140, 140);
+ t.advance (1000);
+ t.mouse_move (50, 50);
+ t.advance (1000);
+ t.mouse_release (50, 50);
+ t.advance (1000);
+ t.mouse_press (50, 50);
+ t.advance (1000);
+ t.mouse_move (140, 140);
+ t.advance (1000);
+ t.mouse_release (140, 140);
+ t.advance (1000);
+ t.trace ();
+ } catch (e) {
+ if (e) {
+ error (e);
+ return false;
+ }
+ };
+ Native.print (" OK\n");
+ return true;
+};
+
+filenames.sort ();
+t = new Test ();
+fail = [];
+for (var i = 0; i < filenames.length; i++) {
+ if (!run_test (t, filenames[i]))
+ fail.push (filenames[i]);
+};
+if (fail.length > 0) {
+ error (fail.join ("\n "));
+ throw (fail.length + " failures");
+}
diff --git a/test/custom/definebutton.sts b/test/custom/definebutton.sts
new file mode 100644
index 0000000..378773f
Binary files /dev/null and b/test/custom/definebutton.sts differ
commit 1f6fac351c87fe44754e83d9b03691ea703de139
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 13:24:11 2008 +0100
replace next test
diff --git a/test/custom/Makefile.am b/test/custom/Makefile.am
index 07be641..276fe09 100644
--- a/test/custom/Makefile.am
+++ b/test/custom/Makefile.am
@@ -4,42 +4,32 @@ check-local:
done
EXTRA_DIST = \
+ button-events.c \
+ button-events.stas \
+ button-events.sts \
button-events-button-5.swf \
- button-events-button-5.swf.act \
button-events-button-5.swf.trace \
button-events-button-6.swf \
- button-events-button-6.swf.act \
button-events-button-6.swf.trace \
button-events-button-7.swf \
- button-events-button-7.swf.act \
button-events-button-7.swf.trace \
button-events-button-8.swf \
- button-events-button-8.swf.act \
button-events-button-8.swf.trace \
- button-events.c \
button-events-menu-5.swf \
- button-events-menu-5.swf.act \
button-events-menu-5.swf.trace \
button-events-menu-6.swf \
- button-events-menu-6.swf.act \
button-events-menu-6.swf.trace \
button-events-menu-7.swf \
- button-events-menu-7.swf.act \
button-events-menu-7.swf.trace \
button-events-menu-8.swf \
- button-events-menu-8.swf.act \
button-events-menu-8.swf.trace \
button-hittest-5.swf \
- button-hittest-5.swf.act \
button-hittest-5.swf.trace \
button-hittest-6.swf \
- button-hittest-6.swf.act \
button-hittest-6.swf.trace \
button-hittest-7.swf \
- button-hittest-7.swf.act \
button-hittest-7.swf.trace \
button-hittest-8.swf \
- button-hittest-8.swf.act \
button-hittest-8.swf.trace \
button-hittest.c \
definebutton-5.swf \
@@ -95,14 +85,13 @@ EXTRA_DIST = \
mouse-movie-below-nonevent-movie-8.swf.act \
mouse-movie-below-nonevent-movie-8.swf.trace \
mouse-scaled.as \
+ mouse-scaled.stas \
+ mouse-scaled.sts \
mouse-scaled-5.swf \
- mouse-scaled-5.swf.act \
mouse-scaled-5.swf.trace \
mouse-scaled-6.swf \
- mouse-scaled-6.swf.act \
mouse-scaled-6.swf.trace \
mouse-scaled-6.swf.trace.org \
mouse-scaled-7.swf \
- mouse-scaled-7.swf.act \
mouse-scaled-7.swf.trace \
mouse-scaled-7.swf.trace.org
diff --git a/test/custom/button-events-button-5.swf.act b/test/custom/button-events-button-5.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-button-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events-button-6.swf.act b/test/custom/button-events-button-6.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-button-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events-button-7.swf.act b/test/custom/button-events-button-7.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-button-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events-button-8.swf.act b/test/custom/button-events-button-8.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-button-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events-menu-5.swf.act b/test/custom/button-events-menu-5.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-menu-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events-menu-6.swf.act b/test/custom/button-events-menu-6.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-menu-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events-menu-7.swf.act b/test/custom/button-events-menu-7.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-menu-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events-menu-8.swf.act b/test/custom/button-events-menu-8.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/custom/button-events-menu-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/custom/button-events.stas b/test/custom/button-events.stas
new file mode 100644
index 0000000..865329d
--- /dev/null
+++ b/test/custom/button-events.stas
@@ -0,0 +1,64 @@
+/* Swfdec
+ * Copyright (C) 2008 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+run_test = function (t, file) {
+ var e;
+ print ("Testing " + file);
+ try {
+ t.reset (file);
+ t.trace (file + ".trace");
+ t.advance (1000);
+ t.mouse_move (50, 50);
+ t.advance (1000);
+ t.mouse_press (50, 50);
+ t.advance (1000);
+ t.mouse_move (140, 140);
+ t.advance (1000);
+ t.mouse_move (50, 50);
+ t.advance (1000);
+ t.mouse_release (50, 50);
+ t.advance (1000);
+ t.mouse_press (50, 50);
+ t.advance (1000);
+ t.mouse_move (140, 140);
+ t.advance (1000);
+ t.mouse_release (140, 140);
+ t.advance (1000);
+ t.trace ();
+ } catch (e) {
+ if (e) {
+ error (e);
+ return false;
+ }
+ };
+ Native.print (" OK\n");
+ return true;
+};
+
+filenames.sort ();
+t = new Test ();
+fail = [];
+for (var i = 0; i < filenames.length; i++) {
+ if (!run_test (t, filenames[i]))
+ fail.push (filenames[i]);
+};
+if (fail.length > 0) {
+ error (fail.join ("\n "));
+ throw (fail.length + " failures");
+}
diff --git a/test/custom/button-events.sts b/test/custom/button-events.sts
new file mode 100644
index 0000000..378773f
Binary files /dev/null and b/test/custom/button-events.sts differ
commit 80f6324356d3981bf8a4544d2c861bb2b7e554c7
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 13:18:48 2008 +0100
replace first set of act files
Also update test runner to do this:
For every NAME.sts file run test --script NAME.sts NAME*.swf
diff --git a/test/custom/Makefile.am b/test/custom/Makefile.am
index 7559cfb..07be641 100644
--- a/test/custom/Makefile.am
+++ b/test/custom/Makefile.am
@@ -1,6 +1,6 @@
check-local:
- for file in $(srcdir)/*.swf; do \
- ../test --script $$file.sts $$file; \
+ for file in $(srcdir)/*.sts; do \
+ ../test --script $$file $(srcdir)/`basename $$file .sts`*.swf; \
done
EXTRA_DIST = \
diff --git a/test/custom/mouse-scaled-5.swf.act b/test/custom/mouse-scaled-5.swf.act
deleted file mode 100644
index 83d4379..0000000
--- a/test/custom/mouse-scaled-5.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 500
-move 50, 50
-wait 500
-down
-wait 500
-move 100, 100
-wait 500
-up
-wait 1000
diff --git a/test/custom/mouse-scaled-6.swf.act b/test/custom/mouse-scaled-6.swf.act
deleted file mode 100644
index 83d4379..0000000
--- a/test/custom/mouse-scaled-6.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 500
-move 50, 50
-wait 500
-down
-wait 500
-move 100, 100
-wait 500
-up
-wait 1000
diff --git a/test/custom/mouse-scaled-7.swf.act b/test/custom/mouse-scaled-7.swf.act
deleted file mode 100644
index 83d4379..0000000
--- a/test/custom/mouse-scaled-7.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 500
-move 50, 50
-wait 500
-down
-wait 500
-move 100, 100
-wait 500
-up
-wait 1000
diff --git a/test/custom/mouse-scaled.stas b/test/custom/mouse-scaled.stas
new file mode 100644
index 0000000..2900795
--- /dev/null
+++ b/test/custom/mouse-scaled.stas
@@ -0,0 +1,56 @@
+/* Swfdec
+ * Copyright (C) 2008 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+run_test = function (t, file) {
+ var e;
+ print ("Testing " + file);
+ try {
+ t.reset (file);
+ t.trace (file + ".trace");
+ t.advance (500);
+ t.mouse_move (50, 50);
+ t.advance (500);
+ t.mouse_press (50, 50);
+ t.advance (500);
+ t.mouse_move (100, 100);
+ t.advance (500);
+ t.mouse_release (100, 100);
+ t.advance (1000);
+ t.trace ();
+ } catch (e) {
+ if (e) {
+ error (e);
+ return false;
+ }
+ };
+ Native.print (" OK\n");
+ return true;
+};
+
+filenames.sort ();
+t = new Test ();
+fail = [];
+for (var i = 0; i < filenames.length; i++) {
+ if (!run_test (t, filenames[i]))
+ fail.push (filenames[i]);
+};
+if (fail.length > 0) {
+ error (fail.join ("\n "));
+ throw (fail.length + " failures");
+}
diff --git a/test/custom/mouse-scaled.sts b/test/custom/mouse-scaled.sts
new file mode 100644
index 0000000..359978b
Binary files /dev/null and b/test/custom/mouse-scaled.sts differ
commit 186d4d8583fbb1b915b4cbc610c1a09b7722c2f8
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 13:16:48 2008 +0100
add mouse_move() mouse_press() and mouse_release() functions to Test class
This replaces the act API completely
diff --git a/test/swfdec_test_initialize.as b/test/swfdec_test_initialize.as
index 338fdf0..6d72d9b 100644
--- a/test/swfdec_test_initialize.as
+++ b/test/swfdec_test_initialize.as
@@ -20,6 +20,9 @@
Test = Native.Test;
Test.prototype = {};
Test.prototype.advance = Native.Test_advance;
+Test.prototype.mouse_move = Native.Test_mouse_move;
+Test.prototype.mouse_press = Native.Test_mouse_press;
+Test.prototype.mouse_release = Native.Test_mouse_release;
Test.prototype.reset = Native.Test_reset;
Test.prototype.trace = Native.Test_trace;
Test.prototype.addProperty ("rate", Native.Test_get_rate, null);
diff --git a/test/swfdec_test_initialize.h b/test/swfdec_test_initialize.h
index a7dc1f4..a625182 100644
--- a/test/swfdec_test_initialize.h
+++ b/test/swfdec_test_initialize.h
@@ -2,31 +2,41 @@
/* compiled from swfdec_test_initialize.as */
static const unsigned char swfdec_test_initialize[] = {
- 0x88, 0x8B, 0x00, 0x11, 0x00, 0x54, 0x65, 0x73, 0x74, 0x00, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x88, 0xE4, 0x00, 0x17, 0x00, 0x54, 0x65, 0x73, 0x74, 0x00, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65,
0x00, 0x70, 0x72, 0x6F, 0x74, 0x6F, 0x74, 0x79, 0x70, 0x65, 0x00, 0x61, 0x64, 0x76, 0x61, 0x6E,
0x63, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x61, 0x64, 0x76, 0x61, 0x6E, 0x63, 0x65, 0x00,
- 0x72, 0x65, 0x73, 0x65, 0x74, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x72, 0x65, 0x73, 0x65, 0x74,
- 0x00, 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x74, 0x72, 0x61, 0x63,
- 0x65, 0x00, 0x72, 0x61, 0x74, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F,
- 0x72, 0x61, 0x74, 0x65, 0x00, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79,
- 0x00, 0x70, 0x72, 0x69, 0x6E, 0x74, 0x00, 0x73, 0x00, 0x49, 0x4E, 0x46, 0x4F, 0x3A, 0x20, 0x00,
- 0x65, 0x72, 0x72, 0x6F, 0x72, 0x00, 0x45, 0x52, 0x52, 0x4F, 0x52, 0x3A, 0x20, 0x00, 0x96, 0x04,
- 0x00, 0x08, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x00, 0x4E, 0x1D, 0x96, 0x02, 0x00,
- 0x08, 0x00, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96,
- 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x03,
- 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x05, 0x08, 0x01, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x06, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02,
- 0x4E, 0x96, 0x04, 0x00, 0x08, 0x07, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x4F,
- 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0A, 0x4E, 0x96, 0x09, 0x00,
- 0x08, 0x09, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E,
- 0x96, 0x02, 0x00, 0x08, 0x0B, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x9B, 0x07, 0x00, 0x00,
- 0x01, 0x00, 0x73, 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x1C, 0x12, 0x9D, 0x02, 0x00,
- 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08, 0x0E, 0x08, 0x0D, 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07, 0x01,
- 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x52, 0x17, 0x1D, 0x96, 0x02,
- 0x00, 0x08, 0x0F, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73, 0x00, 0x27, 0x00, 0x96, 0x02, 0x00,
- 0x08, 0x0D, 0x1C, 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08, 0x10, 0x08, 0x0D,
- 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x0C, 0x52, 0x17, 0x1D, 0x00
+ 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F,
+ 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65, 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65,
+ 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x6D, 0x6F, 0x75, 0x73,
+ 0x65, 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x72, 0x65,
+ 0x6C, 0x65, 0x61, 0x73, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x6D, 0x6F, 0x75, 0x73, 0x65,
+ 0x5F, 0x72, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x00, 0x72, 0x65, 0x73, 0x65, 0x74, 0x00, 0x54,
+ 0x65, 0x73, 0x74, 0x5F, 0x72, 0x65, 0x73, 0x65, 0x74, 0x00, 0x74, 0x72, 0x61, 0x63, 0x65, 0x00,
+ 0x54, 0x65, 0x73, 0x74, 0x5F, 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x72, 0x61, 0x74, 0x65, 0x00,
+ 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x72, 0x61, 0x74, 0x65, 0x00, 0x61, 0x64,
+ 0x64, 0x50, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x00, 0x70, 0x72, 0x69, 0x6E, 0x74, 0x00,
+ 0x73, 0x00, 0x49, 0x4E, 0x46, 0x4F, 0x3A, 0x20, 0x00, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x00, 0x45,
+ 0x52, 0x52, 0x4F, 0x52, 0x3A, 0x20, 0x00, 0x96, 0x04, 0x00, 0x08, 0x00, 0x08, 0x01, 0x1C, 0x96,
+ 0x02, 0x00, 0x08, 0x00, 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x07, 0x00, 0x08,
+ 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x02, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x03, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08,
+ 0x04, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E, 0x96,
+ 0x04, 0x00, 0x08, 0x05, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x06, 0x4E, 0x4F, 0x96, 0x02,
+ 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x07, 0x08,
+ 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96,
+ 0x02, 0x00, 0x08, 0x02, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x09, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
+ 0x08, 0x0A, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E,
+ 0x96, 0x04, 0x00, 0x08, 0x0B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x4E, 0x4F, 0x96,
+ 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x0D,
+ 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0E, 0x4E, 0x4F, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x10, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x0F, 0x07, 0x03, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x02, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x11, 0x52,
+ 0x17, 0x96, 0x02, 0x00, 0x08, 0x12, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73, 0x00, 0x27, 0x00,
+ 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C, 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08,
+ 0x14, 0x08, 0x13, 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x12, 0x52, 0x17, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x15, 0x9B, 0x07, 0x00,
+ 0x00, 0x01, 0x00, 0x73, 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C, 0x12, 0x9D, 0x02,
+ 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08, 0x16, 0x08, 0x13, 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07,
+ 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x12, 0x52, 0x17, 0x1D, 0x00
};
diff --git a/test/swfdec_test_test.c b/test/swfdec_test_test.c
index bb61d43..b0e04f4 100644
--- a/test/swfdec_test_test.c
+++ b/test/swfdec_test_test.c
@@ -264,7 +264,8 @@ swfdec_test_test_advance (SwfdecAsContext *cx, SwfdecAsObject *object, guint arg
if (msecs < 0 || test->player_quit)
return;
- swfdec_test_test_ensure_player (test);
+ if (!swfdec_test_test_ensure_player (test))
+ return;
if (msecs == 0) {
if (!test->player_quit)
swfdec_player_advance (test->player, 0);
@@ -293,6 +294,58 @@ swfdec_test_test_reset (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
swfdec_test_do_reset (test, filename);
}
+SWFDEC_TEST_FUNCTION ("Test_mouse_move", swfdec_test_test_mouse_move, 0)
+void
+swfdec_test_test_mouse_move (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
+ SwfdecAsValue *argv, SwfdecAsValue *retval)
+{
+ SwfdecTestTest *test;
+ double x, y;
+
+ SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_TEST, &test, "nn", &x, &y);
+
+ if (!swfdec_test_test_ensure_player (test))
+ return;
+
+ swfdec_player_mouse_move (test->player, x, y);
+}
+
+SWFDEC_TEST_FUNCTION ("Test_mouse_press", swfdec_test_test_mouse_press, 0)
+void
+swfdec_test_test_mouse_press (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
+ SwfdecAsValue *argv, SwfdecAsValue *retval)
+{
+ SwfdecTestTest *test;
+ double x, y;
+ int button;
+
+ SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_TEST, &test, "nn|i", &x, &y, &button);
+
+ if (!swfdec_test_test_ensure_player (test))
+ return;
+
+ button = CLAMP (button, 1, 32);
+ swfdec_player_mouse_press (test->player, x, y, button);
+}
+
+SWFDEC_TEST_FUNCTION ("Test_mouse_release", swfdec_test_test_mouse_release, 0)
+void
+swfdec_test_test_mouse_release (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
+ SwfdecAsValue *argv, SwfdecAsValue *retval)
+{
+ SwfdecTestTest *test;
+ double x, y;
+ int button;
+
+ SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_TEST, &test, "nn|i", &x, &y, &button);
+
+ if (!swfdec_test_test_ensure_player (test))
+ return;
+
+ button = CLAMP (button, 1, 32);
+ swfdec_player_mouse_release (test->player, x, y, button);
+}
+
SWFDEC_TEST_FUNCTION ("Test", swfdec_test_test_new, swfdec_test_test_get_type)
void
swfdec_test_test_new (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
commit 98b5d6be244ad21d3ab3cef95b07bf538acd290f
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 12:53:32 2008 +0100
move files that need a custom script to their own test directory
diff --git a/configure.ac b/configure.ac
index ee98b00..25bb286 100644
--- a/configure.ac
+++ b/configure.ac
@@ -352,6 +352,7 @@ libswfdec/jpeg/Makefile
libswfdec-gtk/Makefile
player/Makefile
test/Makefile
+test/custom/Makefile
test/image/Makefile
test/sound/Makefile
test/trace/Makefile
diff --git a/test/Makefile.am b/test/Makefile.am
index af22776..05112ac 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = image sound trace various
+SUBDIRS = custom image sound trace various
noinst_PROGRAMS = test
diff --git a/test/custom/.gitignore b/test/custom/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/test/custom/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/test/custom/Makefile.am b/test/custom/Makefile.am
new file mode 100644
index 0000000..7559cfb
--- /dev/null
+++ b/test/custom/Makefile.am
@@ -0,0 +1,108 @@
+check-local:
+ for file in $(srcdir)/*.swf; do \
+ ../test --script $$file.sts $$file; \
+ done
+
+EXTRA_DIST = \
+ button-events-button-5.swf \
+ button-events-button-5.swf.act \
+ button-events-button-5.swf.trace \
+ button-events-button-6.swf \
+ button-events-button-6.swf.act \
+ button-events-button-6.swf.trace \
+ button-events-button-7.swf \
+ button-events-button-7.swf.act \
+ button-events-button-7.swf.trace \
+ button-events-button-8.swf \
+ button-events-button-8.swf.act \
+ button-events-button-8.swf.trace \
+ button-events.c \
+ button-events-menu-5.swf \
+ button-events-menu-5.swf.act \
+ button-events-menu-5.swf.trace \
+ button-events-menu-6.swf \
+ button-events-menu-6.swf.act \
+ button-events-menu-6.swf.trace \
+ button-events-menu-7.swf \
+ button-events-menu-7.swf.act \
+ button-events-menu-7.swf.trace \
+ button-events-menu-8.swf \
+ button-events-menu-8.swf.act \
+ button-events-menu-8.swf.trace \
+ button-hittest-5.swf \
+ button-hittest-5.swf.act \
+ button-hittest-5.swf.trace \
+ button-hittest-6.swf \
+ button-hittest-6.swf.act \
+ button-hittest-6.swf.trace \
+ button-hittest-7.swf \
+ button-hittest-7.swf.act \
+ button-hittest-7.swf.trace \
+ button-hittest-8.swf \
+ button-hittest-8.swf.act \
+ button-hittest-8.swf.trace \
+ button-hittest.c \
+ definebutton-5.swf \
+ definebutton-5.swf.act \
+ definebutton-5.swf.trace \
+ definebutton-6.swf \
+ definebutton-6.swf.act \
+ definebutton-6.swf.trace \
+ definebutton-7.swf \
+ definebutton-7.swf.act \
+ definebutton-7.swf.trace \
+ definebutton-8.swf \
+ definebutton-8.swf.act \
+ definebutton-8.swf.trace \
+ definebutton.xml \
+ mouse-addProperty-relevant.as \
+ mouse-addProperty-relevant-5.swf \
+ mouse-addProperty-relevant-5.swf.act \
+ mouse-addProperty-relevant-5.swf.trace \
+ mouse-addProperty-relevant-6.swf \
+ mouse-addProperty-relevant-6.swf.act \
+ mouse-addProperty-relevant-6.swf.trace \
+ mouse-addProperty-relevant-7.swf \
+ mouse-addProperty-relevant-7.swf.act \
+ mouse-addProperty-relevant-7.swf.trace \
+ mouse-addProperty-relevant-8.swf \
+ mouse-addProperty-relevant-8.swf.act \
+ mouse-addProperty-relevant-8.swf.trace \
+ mouse-movie-below-movie.as \
+ mouse-movie-below-movie-5.swf \
+ mouse-movie-below-movie-5.swf.act \
+ mouse-movie-below-movie-5.swf.trace \
+ mouse-movie-below-movie-6.swf \
+ mouse-movie-below-movie-6.swf.act \
+ mouse-movie-below-movie-6.swf.trace \
+ mouse-movie-below-movie-7.swf \
+ mouse-movie-below-movie-7.swf.act \
+ mouse-movie-below-movie-7.swf.trace \
+ mouse-movie-below-movie-8.swf \
+ mouse-movie-below-movie-8.swf.act \
+ mouse-movie-below-movie-8.swf.trace \
+ mouse-movie-below-nonevent-movie.as \
+ mouse-movie-below-nonevent-movie-5.swf \
+ mouse-movie-below-nonevent-movie-5.swf.act \
+ mouse-movie-below-nonevent-movie-5.swf.trace \
+ mouse-movie-below-nonevent-movie-6.swf \
+ mouse-movie-below-nonevent-movie-6.swf.act \
+ mouse-movie-below-nonevent-movie-6.swf.trace \
+ mouse-movie-below-nonevent-movie-7.swf \
+ mouse-movie-below-nonevent-movie-7.swf.act \
+ mouse-movie-below-nonevent-movie-7.swf.trace \
+ mouse-movie-below-nonevent-movie-8.swf \
+ mouse-movie-below-nonevent-movie-8.swf.act \
+ mouse-movie-below-nonevent-movie-8.swf.trace \
+ mouse-scaled.as \
+ mouse-scaled-5.swf \
+ mouse-scaled-5.swf.act \
+ mouse-scaled-5.swf.trace \
+ mouse-scaled-6.swf \
+ mouse-scaled-6.swf.act \
+ mouse-scaled-6.swf.trace \
+ mouse-scaled-6.swf.trace.org \
+ mouse-scaled-7.swf \
+ mouse-scaled-7.swf.act \
+ mouse-scaled-7.swf.trace \
+ mouse-scaled-7.swf.trace.org
diff --git a/test/custom/button-events-button-5.swf b/test/custom/button-events-button-5.swf
new file mode 100644
index 0000000..c669574
Binary files /dev/null and b/test/custom/button-events-button-5.swf differ
diff --git a/test/custom/button-events-button-5.swf.act b/test/custom/button-events-button-5.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-button-5.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-button-5.swf.trace b/test/custom/button-events-button-5.swf.trace
new file mode 100644
index 0000000..65a55a8
--- /dev/null
+++ b/test/custom/button-events-button-5.swf.trace
@@ -0,0 +1,60 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance11.over4
+load _level0.button.instance12.over2
+load _level0.button.instance13.up_over
+button OverDown => OutDown: _level0
+unload _level0.button.instance11.over4
+unload _level0.button.instance12.over2
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.up_down
+button OutDown => OverDown: _level0
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance16.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance22.up_down
+load _level0.button.instance23.over4
+load _level0.button.instance24.over2
+load _level0.button.instance25.up_over
+button OverDown => OutDown: _level0
+unload _level0.button.instance23.over4
+unload _level0.button.instance24.over2
+unload _level0.button.instance7.over_down
+load _level0.button.instance26.up2
+load _level0.button.instance27.up3
+load _level0.button.instance28.up_down
+button OutDown => Idle: _level0
diff --git a/test/custom/button-events-button-6.swf b/test/custom/button-events-button-6.swf
new file mode 100644
index 0000000..820fb33
Binary files /dev/null and b/test/custom/button-events-button-6.swf differ
diff --git a/test/custom/button-events-button-6.swf.act b/test/custom/button-events-button-6.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-button-6.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-button-6.swf.trace b/test/custom/button-events-button-6.swf.trace
new file mode 100644
index 0000000..752c2fc
--- /dev/null
+++ b/test/custom/button-events-button-6.swf.trace
@@ -0,0 +1,68 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+onRollOver: _level0.button
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance11.over4
+load _level0.button.instance12.over2
+load _level0.button.instance13.up_over
+button OverDown => OutDown: _level0
+onDragOut: _level0.button
+unload _level0.button.instance11.over4
+unload _level0.button.instance12.over2
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.up_down
+button OutDown => OverDown: _level0
+onDragOver: _level0.button
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance16.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+onRelease: _level0.button
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance22.up_down
+load _level0.button.instance23.over4
+load _level0.button.instance24.over2
+load _level0.button.instance25.up_over
+button OverDown => OutDown: _level0
+onDragOut: _level0.button
+unload _level0.button.instance23.over4
+unload _level0.button.instance24.over2
+unload _level0.button.instance7.over_down
+load _level0.button.instance26.up2
+load _level0.button.instance27.up3
+load _level0.button.instance28.up_down
+button OutDown => Idle: _level0
+onReleaseOutside: _level0.button
diff --git a/test/custom/button-events-button-7.swf b/test/custom/button-events-button-7.swf
new file mode 100644
index 0000000..2dadd1d
Binary files /dev/null and b/test/custom/button-events-button-7.swf differ
diff --git a/test/custom/button-events-button-7.swf.act b/test/custom/button-events-button-7.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-button-7.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-button-7.swf.trace b/test/custom/button-events-button-7.swf.trace
new file mode 100644
index 0000000..752c2fc
--- /dev/null
+++ b/test/custom/button-events-button-7.swf.trace
@@ -0,0 +1,68 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+onRollOver: _level0.button
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance11.over4
+load _level0.button.instance12.over2
+load _level0.button.instance13.up_over
+button OverDown => OutDown: _level0
+onDragOut: _level0.button
+unload _level0.button.instance11.over4
+unload _level0.button.instance12.over2
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.up_down
+button OutDown => OverDown: _level0
+onDragOver: _level0.button
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance16.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+onRelease: _level0.button
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance22.up_down
+load _level0.button.instance23.over4
+load _level0.button.instance24.over2
+load _level0.button.instance25.up_over
+button OverDown => OutDown: _level0
+onDragOut: _level0.button
+unload _level0.button.instance23.over4
+unload _level0.button.instance24.over2
+unload _level0.button.instance7.over_down
+load _level0.button.instance26.up2
+load _level0.button.instance27.up3
+load _level0.button.instance28.up_down
+button OutDown => Idle: _level0
+onReleaseOutside: _level0.button
diff --git a/test/custom/button-events-button-8.swf b/test/custom/button-events-button-8.swf
new file mode 100644
index 0000000..cbc15ee
Binary files /dev/null and b/test/custom/button-events-button-8.swf differ
diff --git a/test/custom/button-events-button-8.swf.act b/test/custom/button-events-button-8.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-button-8.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-button-8.swf.trace b/test/custom/button-events-button-8.swf.trace
new file mode 100644
index 0000000..752c2fc
--- /dev/null
+++ b/test/custom/button-events-button-8.swf.trace
@@ -0,0 +1,68 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+onRollOver: _level0.button
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance11.over4
+load _level0.button.instance12.over2
+load _level0.button.instance13.up_over
+button OverDown => OutDown: _level0
+onDragOut: _level0.button
+unload _level0.button.instance11.over4
+unload _level0.button.instance12.over2
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.up_down
+button OutDown => OverDown: _level0
+onDragOver: _level0.button
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance16.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+onRelease: _level0.button
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance22.up_down
+load _level0.button.instance23.over4
+load _level0.button.instance24.over2
+load _level0.button.instance25.up_over
+button OverDown => OutDown: _level0
+onDragOut: _level0.button
+unload _level0.button.instance23.over4
+unload _level0.button.instance24.over2
+unload _level0.button.instance7.over_down
+load _level0.button.instance26.up2
+load _level0.button.instance27.up3
+load _level0.button.instance28.up_down
+button OutDown => Idle: _level0
+onReleaseOutside: _level0.button
diff --git a/test/custom/button-events-menu-5.swf b/test/custom/button-events-menu-5.swf
new file mode 100644
index 0000000..2892fda
Binary files /dev/null and b/test/custom/button-events-menu-5.swf differ
diff --git a/test/custom/button-events-menu-5.swf.act b/test/custom/button-events-menu-5.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-menu-5.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-menu-5.swf.trace b/test/custom/button-events-menu-5.swf.trace
new file mode 100644
index 0000000..10f1ff0
--- /dev/null
+++ b/test/custom/button-events-menu-5.swf.trace
@@ -0,0 +1,53 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance7.over_down
+load _level0.button.instance11.up2
+load _level0.button.instance12.up3
+load _level0.button.instance13.up_over
+button OverDown => Idle: _level0
+unload _level0.button.instance11.up2
+unload _level0.button.instance12.up3
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.over_down
+button Idle => OutDown: _level0
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance16.over_down
+load _level0.button.instance23.up2
+load _level0.button.instance24.up3
+load _level0.button.instance25.up_over
+button OverDown => Idle: _level0
diff --git a/test/custom/button-events-menu-6.swf b/test/custom/button-events-menu-6.swf
new file mode 100644
index 0000000..f535879
Binary files /dev/null and b/test/custom/button-events-menu-6.swf differ
diff --git a/test/custom/button-events-menu-6.swf.act b/test/custom/button-events-menu-6.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-menu-6.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-menu-6.swf.trace b/test/custom/button-events-menu-6.swf.trace
new file mode 100644
index 0000000..6f9f001
--- /dev/null
+++ b/test/custom/button-events-menu-6.swf.trace
@@ -0,0 +1,60 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+onRollOver: _level0.button
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance7.over_down
+load _level0.button.instance11.up2
+load _level0.button.instance12.up3
+load _level0.button.instance13.up_over
+button OverDown => Idle: _level0
+onDragOut: _level0.button
+unload _level0.button.instance11.up2
+unload _level0.button.instance12.up3
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.over_down
+button Idle => OutDown: _level0
+onDragOver: _level0.button
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+onRelease: _level0.button
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance16.over_down
+load _level0.button.instance23.up2
+load _level0.button.instance24.up3
+load _level0.button.instance25.up_over
+button OverDown => Idle: _level0
+onDragOut: _level0.button
diff --git a/test/custom/button-events-menu-7.swf b/test/custom/button-events-menu-7.swf
new file mode 100644
index 0000000..04c3b27
Binary files /dev/null and b/test/custom/button-events-menu-7.swf differ
diff --git a/test/custom/button-events-menu-7.swf.act b/test/custom/button-events-menu-7.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-menu-7.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-menu-7.swf.trace b/test/custom/button-events-menu-7.swf.trace
new file mode 100644
index 0000000..6f9f001
--- /dev/null
+++ b/test/custom/button-events-menu-7.swf.trace
@@ -0,0 +1,60 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+onRollOver: _level0.button
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance7.over_down
+load _level0.button.instance11.up2
+load _level0.button.instance12.up3
+load _level0.button.instance13.up_over
+button OverDown => Idle: _level0
+onDragOut: _level0.button
+unload _level0.button.instance11.up2
+unload _level0.button.instance12.up3
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.over_down
+button Idle => OutDown: _level0
+onDragOver: _level0.button
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+onRelease: _level0.button
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance16.over_down
+load _level0.button.instance23.up2
+load _level0.button.instance24.up3
+load _level0.button.instance25.up_over
+button OverDown => Idle: _level0
+onDragOut: _level0.button
diff --git a/test/custom/button-events-menu-8.swf b/test/custom/button-events-menu-8.swf
new file mode 100644
index 0000000..b13d0d0
Binary files /dev/null and b/test/custom/button-events-menu-8.swf differ
diff --git a/test/custom/button-events-menu-8.swf.act b/test/custom/button-events-menu-8.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/button-events-menu-8.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/button-events-menu-8.swf.trace b/test/custom/button-events-menu-8.swf.trace
new file mode 100644
index 0000000..6f9f001
--- /dev/null
+++ b/test/custom/button-events-menu-8.swf.trace
@@ -0,0 +1,60 @@
+load _level0.button.instance1.up2
+load _level0.button.instance2.up3
+load _level0.button.instance3.up_down
+load _level0.button.instance4.up_over
+unload _level0.button.instance1.up2
+unload _level0.button.instance2.up3
+unload _level0.button.instance3.up_down
+load _level0.button.instance5.over4
+load _level0.button.instance6.over2
+load _level0.button.instance7.over_down
+button Idle => OverUp: _level0
+onRollOver: _level0.button
+unload _level0.button.instance5.over4
+unload _level0.button.instance6.over2
+unload _level0.button.instance4.up_over
+load _level0.button.instance8.down2
+load _level0.button.instance9.down5
+load _level0.button.instance10.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance8.down2
+unload _level0.button.instance9.down5
+unload _level0.button.instance7.over_down
+load _level0.button.instance11.up2
+load _level0.button.instance12.up3
+load _level0.button.instance13.up_over
+button OverDown => Idle: _level0
+onDragOut: _level0.button
+unload _level0.button.instance11.up2
+unload _level0.button.instance12.up3
+unload _level0.button.instance13.up_over
+load _level0.button.instance14.down2
+load _level0.button.instance15.down5
+load _level0.button.instance16.over_down
+button Idle => OutDown: _level0
+onDragOver: _level0.button
+unload _level0.button.instance14.down2
+unload _level0.button.instance15.down5
+unload _level0.button.instance10.up_down
+load _level0.button.instance17.over4
+load _level0.button.instance18.over2
+load _level0.button.instance19.up_over
+button OverDown => OverUp: _level0
+onRelease: _level0.button
+unload _level0.button.instance17.over4
+unload _level0.button.instance18.over2
+unload _level0.button.instance19.up_over
+load _level0.button.instance20.down2
+load _level0.button.instance21.down5
+load _level0.button.instance22.up_down
+button OverUp => OverDown: _level0
+onPress: _level0.button
+unload _level0.button.instance20.down2
+unload _level0.button.instance21.down5
+unload _level0.button.instance16.over_down
+load _level0.button.instance23.up2
+load _level0.button.instance24.up3
+load _level0.button.instance25.up_over
+button OverDown => Idle: _level0
+onDragOut: _level0.button
diff --git a/test/custom/button-events.c b/test/custom/button-events.c
new file mode 100644
index 0000000..dad2eb0
--- /dev/null
+++ b/test/custom/button-events.c
@@ -0,0 +1,144 @@
+/* gcc `pkg-config --libs --cflags libming` button-events.c -o button-events && ./button-events
+ */
+
+#include <ming.h>
+
+static const char *events[] = { "Press", "Release", "ReleaseOutside", "RollOver", "RollOut", "DragOver", "DragOut" };
+static const char *button_events[] = { "Idle => OverUp", "OverUp => Idle", "OverUp => OverDown", "OverDown => OverUp", "OverDown => OutDown", "OutDown => OverDown", "OutDown => Idle", "Idle => OutDown", "OverDown => Idle" };
+
+static void
+add_button_events (SWFButton button)
+{
+ char script[100];
+ unsigned int i;
+
+ for (i = 0; i < sizeof (button_events) / sizeof (button_events[0]); i++) {
+ sprintf (script, "trace (\"button %s: \" + this);", button_events[i]);
+ SWFButton_addAction (button, newSWFAction (script), (1 << i));
+ }
+}
+
+static SWFCharacter
+get_clip_events_movie (const char *name)
+{
+ SWFMovieClip clip;
+ SWFDisplayItem item;
+
+ clip = newSWFMovieClip ();
+ item = SWFMovieClip_add (clip, (SWFBlock) newSWFMovieClip ());
+ SWFDisplayItem_addAction (item, newSWFAction ("trace (\"load \" + this);"), SWFACTION_ONLOAD);
+ SWFDisplayItem_addAction (item, newSWFAction ("trace (\"unload \" + this);"), SWFACTION_UNLOAD);
+ SWFDisplayItem_setName (item, name);
+ SWFMovieClip_nextFrame (clip);
+ return (SWFCharacter) clip;
+}
+
+static void
+add_item_events (SWFDisplayItem item)
+{
+ char script[100];
+ unsigned int i;
+
+ for (i = 0; i < sizeof (events) / sizeof (events[0]); i++) {
+ sprintf (script, "trace (\"place %s: \" + this);", events[i]);
+ SWFDisplayItem_addAction (item, newSWFAction (script), 1 << (10 + i));
+ }
+}
+
+static SWFCharacter
+get_rectangle (int r, int g, int b)
+{
+ SWFShape shape;
+ SWFFillStyle fill;
+
+ shape = newSWFShape ();
+ fill = SWFShape_addSolidFillStyle (shape, r, g, b, 255);
+ SWFShape_setRightFillStyle (shape, fill);
+ SWFShape_drawLineTo (shape, 100, 0);
+ SWFShape_drawLineTo (shape, 100, 100);
+ SWFShape_drawLineTo (shape, 0, 100);
+ SWFShape_drawLineTo (shape, 0, 0);
+
+ return (SWFCharacter) shape;
+}
+
+static void
+do_movie (int version, int menu)
+{
+ char name[100];
+ SWFMovie movie;
+ SWFDisplayItem item;
+ SWFButton button;
+ SWFButtonRecord rec;
+
+ movie = newSWFMovieWithVersion (version);
+ SWFMovie_setRate (movie, 10);
+ SWFMovie_setDimension (movie, 200, 150);
+
+ SWFMovie_add (movie, newSWFInitAction (newSWFAction (
+ "button.onPress = function () { trace (\"onPress: \" + this); };"
+ "button.onRelease = function () { trace (\"onRelease: \" + this); };"
+ "button.onReleaseOutside = function () { trace (\"onReleaseOutside: \" + this); };"
+ "button.onRollOver = function () { trace (\"onRollOver: \" + this); };"
+ "button.onRollOut = function () { trace (\"onRollOut: \" + this); };"
+ "button.onDragOver = function () { trace (\"onDragOver: \" + this); };"
+ "button.onDragOut = function () { trace (\"onDragOut: \" + this); };"
+ )));
+ button = newSWFButton ();
+ SWFButton_setMenu (button, menu);
+ rec = SWFButton_addCharacter (button, get_rectangle (255, 0, 0), SWFBUTTON_UP | SWFBUTTON_HIT);
+ SWFButtonRecord_setDepth (rec, 1);
+ rec = SWFButton_addCharacter (button, get_rectangle (0, 255, 0), SWFBUTTON_OVER);
+ SWFButtonRecord_setDepth (rec, 1);
+ rec = SWFButton_addCharacter (button, get_rectangle (0, 0, 255), SWFBUTTON_DOWN);
+ SWFButtonRecord_setDepth (rec, 1);
+
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("up2"), SWFBUTTON_UP);
+ SWFButtonRecord_setDepth (rec, 2);
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("up3"), SWFBUTTON_UP);
+ SWFButtonRecord_setDepth (rec, 3);
+
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("over4"), SWFBUTTON_OVER);
+ SWFButtonRecord_setDepth (rec, 4);
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("over2"), SWFBUTTON_OVER);
+ SWFButtonRecord_setDepth (rec, 2);
+
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("down2"), SWFBUTTON_DOWN);
+ SWFButtonRecord_setDepth (rec, 2);
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("down5"), SWFBUTTON_DOWN);
+ SWFButtonRecord_setDepth (rec, 5);
+
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("up_down"), SWFBUTTON_UP | SWFBUTTON_DOWN);
+ SWFButtonRecord_setDepth (rec, 6);
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("up_over"), SWFBUTTON_UP | SWFBUTTON_OVER);
+ SWFButtonRecord_setDepth (rec, 7);
+ rec = SWFButton_addCharacter (button, get_clip_events_movie ("over_down"), SWFBUTTON_DOWN | SWFBUTTON_OVER);
+ SWFButtonRecord_setDepth (rec, 8);
+
+ add_button_events (button);
+ item = SWFMovie_add (movie, button);
+ add_item_events (item);
+ SWFDisplayItem_setDepth (item, 0);
+ SWFDisplayItem_setName (item, "button");
+
+ SWFMovie_nextFrame (movie);
+
+ sprintf (name, "button-events-%s-%d.swf", menu ? "menu" : "button", version);
+ SWFMovie_save (movie, name);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+
+ if (Ming_init ())
+ return 1;
+
+ for (i = 8; i >= 5; i--) {
+ do_movie (i, 0);
+ do_movie (i, 1);
+ }
+
+ return 0;
+}
diff --git a/test/custom/definebutton-5.swf b/test/custom/definebutton-5.swf
new file mode 100644
index 0000000..6ab33d2
Binary files /dev/null and b/test/custom/definebutton-5.swf differ
diff --git a/test/custom/definebutton-5.swf.act b/test/custom/definebutton-5.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/definebutton-5.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/definebutton-5.swf.trace b/test/custom/definebutton-5.swf.trace
new file mode 100644
index 0000000..49d341d
--- /dev/null
+++ b/test/custom/definebutton-5.swf.trace
@@ -0,0 +1,18 @@
+load _level0.instance1.instance2.instance3
+unload _level0.instance1.instance2.instance3
+load _level0.instance1.instance4.instance5
+unload _level0.instance1.instance4.instance5
+load _level0.instance1.instance6.instance7
+unload _level0.instance1.instance6.instance7
+load _level0.instance1.instance8.instance9
+unload _level0.instance1.instance8.instance9
+load _level0.instance1.instance10.instance11
+unload _level0.instance1.instance10.instance11
+load _level0.instance1.instance12.instance13
+_level0
+unload _level0.instance1.instance12.instance13
+load _level0.instance1.instance14.instance15
+unload _level0.instance1.instance14.instance15
+load _level0.instance1.instance16.instance17
+unload _level0.instance1.instance16.instance17
+load _level0.instance1.instance18.instance19
diff --git a/test/custom/definebutton-6.swf b/test/custom/definebutton-6.swf
new file mode 100644
index 0000000..6e1444b
Binary files /dev/null and b/test/custom/definebutton-6.swf differ
diff --git a/test/custom/definebutton-6.swf.act b/test/custom/definebutton-6.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/definebutton-6.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/definebutton-6.swf.trace b/test/custom/definebutton-6.swf.trace
new file mode 100644
index 0000000..49d341d
--- /dev/null
+++ b/test/custom/definebutton-6.swf.trace
@@ -0,0 +1,18 @@
+load _level0.instance1.instance2.instance3
+unload _level0.instance1.instance2.instance3
+load _level0.instance1.instance4.instance5
+unload _level0.instance1.instance4.instance5
+load _level0.instance1.instance6.instance7
+unload _level0.instance1.instance6.instance7
+load _level0.instance1.instance8.instance9
+unload _level0.instance1.instance8.instance9
+load _level0.instance1.instance10.instance11
+unload _level0.instance1.instance10.instance11
+load _level0.instance1.instance12.instance13
+_level0
+unload _level0.instance1.instance12.instance13
+load _level0.instance1.instance14.instance15
+unload _level0.instance1.instance14.instance15
+load _level0.instance1.instance16.instance17
+unload _level0.instance1.instance16.instance17
+load _level0.instance1.instance18.instance19
diff --git a/test/custom/definebutton-7.swf b/test/custom/definebutton-7.swf
new file mode 100644
index 0000000..067ce1a
Binary files /dev/null and b/test/custom/definebutton-7.swf differ
diff --git a/test/custom/definebutton-7.swf.act b/test/custom/definebutton-7.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/definebutton-7.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/definebutton-7.swf.trace b/test/custom/definebutton-7.swf.trace
new file mode 100644
index 0000000..49d341d
--- /dev/null
+++ b/test/custom/definebutton-7.swf.trace
@@ -0,0 +1,18 @@
+load _level0.instance1.instance2.instance3
+unload _level0.instance1.instance2.instance3
+load _level0.instance1.instance4.instance5
+unload _level0.instance1.instance4.instance5
+load _level0.instance1.instance6.instance7
+unload _level0.instance1.instance6.instance7
+load _level0.instance1.instance8.instance9
+unload _level0.instance1.instance8.instance9
+load _level0.instance1.instance10.instance11
+unload _level0.instance1.instance10.instance11
+load _level0.instance1.instance12.instance13
+_level0
+unload _level0.instance1.instance12.instance13
+load _level0.instance1.instance14.instance15
+unload _level0.instance1.instance14.instance15
+load _level0.instance1.instance16.instance17
+unload _level0.instance1.instance16.instance17
+load _level0.instance1.instance18.instance19
diff --git a/test/custom/definebutton-8.swf b/test/custom/definebutton-8.swf
new file mode 100644
index 0000000..7a445b7
Binary files /dev/null and b/test/custom/definebutton-8.swf differ
diff --git a/test/custom/definebutton-8.swf.act b/test/custom/definebutton-8.swf.act
new file mode 100644
index 0000000..352902b
--- /dev/null
+++ b/test/custom/definebutton-8.swf.act
@@ -0,0 +1,17 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+move 50, 50
+wait 1000
+up
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/definebutton-8.swf.trace b/test/custom/definebutton-8.swf.trace
new file mode 100644
index 0000000..49d341d
--- /dev/null
+++ b/test/custom/definebutton-8.swf.trace
@@ -0,0 +1,18 @@
+load _level0.instance1.instance2.instance3
+unload _level0.instance1.instance2.instance3
+load _level0.instance1.instance4.instance5
+unload _level0.instance1.instance4.instance5
+load _level0.instance1.instance6.instance7
+unload _level0.instance1.instance6.instance7
+load _level0.instance1.instance8.instance9
+unload _level0.instance1.instance8.instance9
+load _level0.instance1.instance10.instance11
+unload _level0.instance1.instance10.instance11
+load _level0.instance1.instance12.instance13
+_level0
+unload _level0.instance1.instance12.instance13
+load _level0.instance1.instance14.instance15
+unload _level0.instance1.instance14.instance15
+load _level0.instance1.instance16.instance17
+unload _level0.instance1.instance16.instance17
+load _level0.instance1.instance18.instance19
diff --git a/test/custom/definebutton.xml b/test/custom/definebutton.xml
new file mode 100644
index 0000000..e07514d
--- /dev/null
+++ b/test/custom/definebutton.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+<swf version="8" compressed="0">
+ <Header framerate="1" frames="1">
+ <size>
+ <Rectangle left="0" right="4000" top="0" bottom="3000"/>
+ </size>
+ <tags>
+ <SetBackgroundColor>
+ <color>
+ <Color red="255" green="255" blue="255"/>
+ </color>
+ </SetBackgroundColor>
+ <DefineShape objectID="1">
+ <bounds>
+ <Rectangle left="0" right="1200" top="0" bottom="1200"/>
+ </bounds>
+ <styles>
+ <StyleList>
+ <fillStyles>
+ <Solid>
+ <color>
+ <Color red="255" green="0" blue="0"/>
+ </color>
+ </Solid>
+ </fillStyles>
+ <lineStyles />
+ </StyleList>
+ </styles>
+ <shapes>
+ <Shape>
+ <edges>
+ <ShapeSetup x="0" y="0" fillStyle1="1"/>
+ <LineTo x="0" y="1200"/>
+ <LineTo x="1200" y="0"/>
+ <LineTo x="0" y="-1200"/>
+ <LineTo x="-1200" y="0"/>
+ <ShapeSetup/>
+ </edges>
+ </Shape>
+ </shapes>
+ </DefineShape>
+ <DefineSprite objectID="2" frames="1">
+ <tags>
+ <PlaceObject2 replace="0" depth="1" objectID="1" />
+ <ShowFrame/>
+ </tags>
+ </DefineSprite>
+ <DefineSprite objectID="3" frames="1">
+ <tags>
+ <PlaceObject2 replace="0" depth="1" objectID="2" allflags1="5" allflags2="0">
+ <events>
+ <Event flags1="1" flags2="0">
+ <actions>
+ <Dictionary>
+ <strings>
+ <String value="load "/>
+ <String value="this"/>
+ </strings>
+ </Dictionary>
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ <StackDictionaryLookup index="1"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/>
+ <Trace/>
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="4" flags2="0">
+ <actions>
+ <Dictionary>
+ <strings>
+ <String value="unload "/>
+ <String value="this"/>
+ </strings>
+ </Dictionary>
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ <StackDictionaryLookup index="1"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/>
+ <Trace/>
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="0" flags2="0"/>
+ </events>
+ </PlaceObject2>
+ <ShowFrame/>
+ </tags>
+ </DefineSprite>
+ <DefineButton objectID="4">
+ <buttons>
+ <Button hitTest="0" down="0" over="0" up="1" objectID="3" depth="1">
+ <transform>
+ <Transform transX="1200" transY="0"/>
+ </transform>
+ </Button>
+ <Button hitTest="0" down="0" over="1" up="0" objectID="3" depth="1">
+ <transform>
+ <Transform transX="1200" transY="1200"/>
+ </transform>
+ </Button>
+ <Button hitTest="0" down="1" over="0" up="0" objectID="3" depth="1">
+ <transform>
+ <Transform transX="0" transY="1200"/>
+ </transform>
+ </Button>
+ <Button hitTest="1" down="0" over="0" up="0" objectID="1" depth="1">
+ <transform>
+ <Transform transX="0" transY="0"/>
+ </transform>
+ </Button>
+ <Button hitTest="0" down="0" over="0" up="0"/>
+ </buttons>
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="this"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <Trace/>
+ <EndAction/>
+ </actions>
+ </DefineButton>
+ <PlaceObject2 replace="0" depth="1" objectID="4" />
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </Header>
+</swf>
diff --git a/test/custom/mouse-addProperty-relevant-5.swf b/test/custom/mouse-addProperty-relevant-5.swf
new file mode 100644
index 0000000..b1b6ab1
Binary files /dev/null and b/test/custom/mouse-addProperty-relevant-5.swf differ
diff --git a/test/custom/mouse-addProperty-relevant-5.swf.act b/test/custom/mouse-addProperty-relevant-5.swf.act
new file mode 100644
index 0000000..80749b5
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-5.swf.act
@@ -0,0 +1,9 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/mouse-addProperty-relevant-5.swf.trace b/test/custom/mouse-addProperty-relevant-5.swf.trace
new file mode 100644
index 0000000..1062378
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-5.swf.trace
@@ -0,0 +1 @@
+Check if addProperty proeprties make movies sensitive to mouse events
diff --git a/test/custom/mouse-addProperty-relevant-6.swf b/test/custom/mouse-addProperty-relevant-6.swf
new file mode 100644
index 0000000..0465358
Binary files /dev/null and b/test/custom/mouse-addProperty-relevant-6.swf differ
diff --git a/test/custom/mouse-addProperty-relevant-6.swf.act b/test/custom/mouse-addProperty-relevant-6.swf.act
new file mode 100644
index 0000000..80749b5
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-6.swf.act
@@ -0,0 +1,9 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/mouse-addProperty-relevant-6.swf.trace b/test/custom/mouse-addProperty-relevant-6.swf.trace
new file mode 100644
index 0000000..d235e29
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-6.swf.trace
@@ -0,0 +1,3 @@
+Check if addProperty proeprties make movies sensitive to mouse events
+onRollOver: _level0.b
+onRollOver: _level0.a
diff --git a/test/custom/mouse-addProperty-relevant-7.swf b/test/custom/mouse-addProperty-relevant-7.swf
new file mode 100644
index 0000000..194d5df
Binary files /dev/null and b/test/custom/mouse-addProperty-relevant-7.swf differ
diff --git a/test/custom/mouse-addProperty-relevant-7.swf.act b/test/custom/mouse-addProperty-relevant-7.swf.act
new file mode 100644
index 0000000..80749b5
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-7.swf.act
@@ -0,0 +1,9 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/mouse-addProperty-relevant-7.swf.trace b/test/custom/mouse-addProperty-relevant-7.swf.trace
new file mode 100644
index 0000000..d235e29
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-7.swf.trace
@@ -0,0 +1,3 @@
+Check if addProperty proeprties make movies sensitive to mouse events
+onRollOver: _level0.b
+onRollOver: _level0.a
diff --git a/test/custom/mouse-addProperty-relevant-8.swf b/test/custom/mouse-addProperty-relevant-8.swf
new file mode 100644
index 0000000..64e4382
Binary files /dev/null and b/test/custom/mouse-addProperty-relevant-8.swf differ
diff --git a/test/custom/mouse-addProperty-relevant-8.swf.act b/test/custom/mouse-addProperty-relevant-8.swf.act
new file mode 100644
index 0000000..80749b5
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-8.swf.act
@@ -0,0 +1,9 @@
+wait 1000
+move 50, 50
+wait 1000
+down
+wait 1000
+move 140, 140
+wait 1000
+up
+wait 1000
diff --git a/test/custom/mouse-addProperty-relevant-8.swf.trace b/test/custom/mouse-addProperty-relevant-8.swf.trace
new file mode 100644
index 0000000..d235e29
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant-8.swf.trace
@@ -0,0 +1,3 @@
+Check if addProperty proeprties make movies sensitive to mouse events
+onRollOver: _level0.b
+onRollOver: _level0.a
diff --git a/test/custom/mouse-addProperty-relevant.as b/test/custom/mouse-addProperty-relevant.as
new file mode 100644
index 0000000..a96d29e
--- /dev/null
+++ b/test/custom/mouse-addProperty-relevant.as
@@ -0,0 +1,23 @@
+// makeswf -v 7 -s 200x150 -r 1 -o mouse-addProperty-relevant.swf mouse-addProperty-relevant.as
+
+trace ("Check if addProperty proeprties make movies sensitive to mouse events");
+
+rectangle = function (mc, color, x, y, w, h) {
+ mc.beginFill (color);
+ mc.moveTo (x, y);
+ mc.lineTo (x, y + h);
+ mc.lineTo (x + w, y + h);
+ mc.lineTo (x + w, y);
+ mc.lineTo (x, y);
+ mc.endFill ();
+};
+
+install = function (mc) {
+ mc.addProperty ("onRollOver", function () { trace ("onRollOver: " + this); }, null);
+};
+
+install (Object.prototype);
+createEmptyMovieClip ("a", 0);
+createEmptyMovieClip ("b", 1);
+rectangle (a, 0, 0, 0, 200, 150);
+rectangle (b, 0xFF, 25, 25, 100, 100);
diff --git a/test/custom/mouse-movie-below-movie-5.swf b/test/custom/mouse-movie-below-movie-5.swf
new file mode 100644
index 0000000..c1dc29a
Binary files /dev/null and b/test/custom/mouse-movie-below-movie-5.swf differ
diff --git a/test/custom/mouse-movie-below-movie-5.swf.act b/test/custom/mouse-movie-below-movie-5.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie-5.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-movie-5.swf.trace b/test/custom/mouse-movie-below-movie-5.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/custom/mouse-movie-below-movie-6.swf b/test/custom/mouse-movie-below-movie-6.swf
new file mode 100644
index 0000000..f4d0029
Binary files /dev/null and b/test/custom/mouse-movie-below-movie-6.swf differ
diff --git a/test/custom/mouse-movie-below-movie-6.swf.act b/test/custom/mouse-movie-below-movie-6.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie-6.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-movie-6.swf.trace b/test/custom/mouse-movie-below-movie-6.swf.trace
new file mode 100644
index 0000000..e00b5f3
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie-6.swf.trace
@@ -0,0 +1,9 @@
+onRollOver: _level0.b
+onPress: _level0.b
+onDragOut: _level0.b
+onDragOver: _level0.b
+onRelease: _level0.b
+onPress: _level0.b
+onDragOut: _level0.b
+onReleaseOutside: _level0.b
+onRollOver: _level0.a
diff --git a/test/custom/mouse-movie-below-movie-7.swf b/test/custom/mouse-movie-below-movie-7.swf
new file mode 100644
index 0000000..360c233
Binary files /dev/null and b/test/custom/mouse-movie-below-movie-7.swf differ
diff --git a/test/custom/mouse-movie-below-movie-7.swf.act b/test/custom/mouse-movie-below-movie-7.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie-7.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-movie-7.swf.trace b/test/custom/mouse-movie-below-movie-7.swf.trace
new file mode 100644
index 0000000..e00b5f3
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie-7.swf.trace
@@ -0,0 +1,9 @@
+onRollOver: _level0.b
+onPress: _level0.b
+onDragOut: _level0.b
+onDragOver: _level0.b
+onRelease: _level0.b
+onPress: _level0.b
+onDragOut: _level0.b
+onReleaseOutside: _level0.b
+onRollOver: _level0.a
diff --git a/test/custom/mouse-movie-below-movie-8.swf b/test/custom/mouse-movie-below-movie-8.swf
new file mode 100644
index 0000000..db943f2
Binary files /dev/null and b/test/custom/mouse-movie-below-movie-8.swf differ
diff --git a/test/custom/mouse-movie-below-movie-8.swf.act b/test/custom/mouse-movie-below-movie-8.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie-8.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-movie-8.swf.trace b/test/custom/mouse-movie-below-movie-8.swf.trace
new file mode 100644
index 0000000..e00b5f3
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie-8.swf.trace
@@ -0,0 +1,9 @@
+onRollOver: _level0.b
+onPress: _level0.b
+onDragOut: _level0.b
+onDragOver: _level0.b
+onRelease: _level0.b
+onPress: _level0.b
+onDragOut: _level0.b
+onReleaseOutside: _level0.b
+onRollOver: _level0.a
diff --git a/test/custom/mouse-movie-below-movie.as b/test/custom/mouse-movie-below-movie.as
new file mode 100644
index 0000000..29d83b5
--- /dev/null
+++ b/test/custom/mouse-movie-below-movie.as
@@ -0,0 +1,27 @@
+// makeswf -v 7 -s 200x150 -r 1 -o mouse-movie-below-movie.swf mouse-movie-below-movie.as
+
+rectangle = function (mc, color, x, y, w, h) {
+ mc.beginFill (color);
+ mc.moveTo (x, y);
+ mc.lineTo (x, y + h);
+ mc.lineTo (x + w, y + h);
+ mc.lineTo (x + w, y);
+ mc.lineTo (x, y);
+ mc.endFill ();
+};
+
+install = function (mc) {
+ mc.onRollOver = function () { trace ("onRollOver: " + this); };
+ mc.onRollOut = function () { trace ("onRollOut: " + this); };
+ mc.onDragOut = function () { trace ("onDragOut: " + this); };
+ mc.onDragOver = function () { trace ("onDragOver: " + this); };
+ mc.onPress = function () { trace ("onPress: " + this); };
+ mc.onRelease = function () { trace ("onRelease: " + this); };
+ mc.onReleaseOutside = function () { trace ("onReleaseOutside: " + this); };
+};
+
+createEmptyMovieClip ("a", 0);
+install (MovieClip.prototype);
+createEmptyMovieClip ("b", 1);
+rectangle (a, 0, 0, 0, 200, 150);
+rectangle (b, 0xFF, 25, 25, 100, 100);
diff --git a/test/custom/mouse-movie-below-nonevent-movie-5.swf b/test/custom/mouse-movie-below-nonevent-movie-5.swf
new file mode 100644
index 0000000..587cc3d
Binary files /dev/null and b/test/custom/mouse-movie-below-nonevent-movie-5.swf differ
diff --git a/test/custom/mouse-movie-below-nonevent-movie-5.swf.act b/test/custom/mouse-movie-below-nonevent-movie-5.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie-5.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-5.swf.trace b/test/custom/mouse-movie-below-nonevent-movie-5.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/custom/mouse-movie-below-nonevent-movie-6.swf b/test/custom/mouse-movie-below-nonevent-movie-6.swf
new file mode 100644
index 0000000..b95bc02
Binary files /dev/null and b/test/custom/mouse-movie-below-nonevent-movie-6.swf differ
diff --git a/test/custom/mouse-movie-below-nonevent-movie-6.swf.act b/test/custom/mouse-movie-below-nonevent-movie-6.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie-6.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-6.swf.trace b/test/custom/mouse-movie-below-nonevent-movie-6.swf.trace
new file mode 100644
index 0000000..0e55f00
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie-6.swf.trace
@@ -0,0 +1,5 @@
+onRollOver: _level0.a
+onPress: _level0.a
+onRelease: _level0.a
+onPress: _level0.a
+onRelease: _level0.a
diff --git a/test/custom/mouse-movie-below-nonevent-movie-7.swf b/test/custom/mouse-movie-below-nonevent-movie-7.swf
new file mode 100644
index 0000000..f6aed05
Binary files /dev/null and b/test/custom/mouse-movie-below-nonevent-movie-7.swf differ
diff --git a/test/custom/mouse-movie-below-nonevent-movie-7.swf.act b/test/custom/mouse-movie-below-nonevent-movie-7.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie-7.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-7.swf.trace b/test/custom/mouse-movie-below-nonevent-movie-7.swf.trace
new file mode 100644
index 0000000..0e55f00
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie-7.swf.trace
@@ -0,0 +1,5 @@
+onRollOver: _level0.a
+onPress: _level0.a
+onRelease: _level0.a
+onPress: _level0.a
+onRelease: _level0.a
diff --git a/test/custom/mouse-movie-below-nonevent-movie-8.swf b/test/custom/mouse-movie-below-nonevent-movie-8.swf
new file mode 100644
index 0000000..2065974
Binary files /dev/null and b/test/custom/mouse-movie-below-nonevent-movie-8.swf differ
diff --git a/test/custom/mouse-movie-below-nonevent-movie-8.swf.act b/test/custom/mouse-movie-below-nonevent-movie-8.swf.act
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie-8.swf.act
@@ -0,0 +1,17 @@
+wait 300
+move 50, 50
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+move 50, 50
+wait 300
+up
+wait 300
+down
+wait 300
+move 140, 140
+wait 300
+up
+wait 300
diff --git a/test/custom/mouse-movie-below-nonevent-movie-8.swf.trace b/test/custom/mouse-movie-below-nonevent-movie-8.swf.trace
new file mode 100644
index 0000000..0e55f00
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie-8.swf.trace
@@ -0,0 +1,5 @@
+onRollOver: _level0.a
+onPress: _level0.a
+onRelease: _level0.a
+onPress: _level0.a
+onRelease: _level0.a
diff --git a/test/custom/mouse-movie-below-nonevent-movie.as b/test/custom/mouse-movie-below-nonevent-movie.as
new file mode 100644
index 0000000..6654cf1
--- /dev/null
+++ b/test/custom/mouse-movie-below-nonevent-movie.as
@@ -0,0 +1,27 @@
+// makeswf -v 7 -s 200x150 -r 1 -o mouse-movie-below-nonevent-movie.swf mouse-movie-below-nonevent-movie.as
+
+rectangle = function (mc, color, x, y, w, h) {
+ mc.beginFill (color);
+ mc.moveTo (x, y);
+ mc.lineTo (x, y + h);
+ mc.lineTo (x + w, y + h);
+ mc.lineTo (x + w, y);
+ mc.lineTo (x, y);
+ mc.endFill ();
+};
+
+install = function (mc) {
+ mc.onRollOver = function () { trace ("onRollOver: " + this); };
+ mc.onRollOut = function () { trace ("onRollOut: " + this); };
+ mc.onDragOut = function () { trace ("onRollOut: " + this); };
+ mc.onDragOver = function () { trace ("onDragOver: " + this); };
+ mc.onPress = function () { trace ("onPress: " + this); };
+ mc.onRelease = function () { trace ("onRelease: " + this); };
+ mc.onReleaseOutside = function () { trace ("onReleaseOutside: " + this); };
+};
+
+createEmptyMovieClip ("a", 0);
+install (a);
+createEmptyMovieClip ("b", 1);
+rectangle (a, 0, 0, 0, 200, 150);
+rectangle (b, 0xFF, 25, 25, 100, 100);
diff --git a/test/custom/mouse-scaled-5.swf b/test/custom/mouse-scaled-5.swf
new file mode 100644
index 0000000..2f38580
Binary files /dev/null and b/test/custom/mouse-scaled-5.swf differ
diff --git a/test/custom/mouse-scaled-5.swf.act b/test/custom/mouse-scaled-5.swf.act
new file mode 100644
index 0000000..83d4379
--- /dev/null
+++ b/test/custom/mouse-scaled-5.swf.act
@@ -0,0 +1,9 @@
+wait 500
+move 50, 50
+wait 500
+down
+wait 500
+move 100, 100
+wait 500
+up
+wait 1000
diff --git a/test/custom/mouse-scaled-5.swf.trace b/test/custom/mouse-scaled-5.swf.trace
new file mode 100644
index 0000000..fbd32bf
--- /dev/null
+++ b/test/custom/mouse-scaled-5.swf.trace
@@ -0,0 +1 @@
+Simple check for mouse movements on scaled movie
diff --git a/test/custom/mouse-scaled-6.swf b/test/custom/mouse-scaled-6.swf
new file mode 100644
index 0000000..df47efa
Binary files /dev/null and b/test/custom/mouse-scaled-6.swf differ
diff --git a/test/custom/mouse-scaled-6.swf.act b/test/custom/mouse-scaled-6.swf.act
new file mode 100644
index 0000000..83d4379
--- /dev/null
+++ b/test/custom/mouse-scaled-6.swf.act
@@ -0,0 +1,9 @@
+wait 500
+move 50, 50
+wait 500
+down
+wait 500
+move 100, 100
+wait 500
+up
+wait 1000
diff --git a/test/custom/mouse-scaled-6.swf.trace b/test/custom/mouse-scaled-6.swf.trace
new file mode 100644
index 0000000..9ff816c
--- /dev/null
+++ b/test/custom/mouse-scaled-6.swf.trace
@@ -0,0 +1,9 @@
+Simple check for mouse movements on scaled movie
+500
+5
+500
+5
+1000
+10
+1000
+10
diff --git a/test/custom/mouse-scaled-6.swf.trace.org b/test/custom/mouse-scaled-6.swf.trace.org
new file mode 100644
index 0000000..ed03da3
--- /dev/null
+++ b/test/custom/mouse-scaled-6.swf.trace.org
@@ -0,0 +1,9 @@
+Simple check for mouse movements on scaled movie
+499.5
+5
+499.5
+5
+999
+10
+999
+10
diff --git a/test/custom/mouse-scaled-7.swf b/test/custom/mouse-scaled-7.swf
new file mode 100644
index 0000000..329b235
Binary files /dev/null and b/test/custom/mouse-scaled-7.swf differ
diff --git a/test/custom/mouse-scaled-7.swf.act b/test/custom/mouse-scaled-7.swf.act
new file mode 100644
index 0000000..83d4379
--- /dev/null
+++ b/test/custom/mouse-scaled-7.swf.act
@@ -0,0 +1,9 @@
+wait 500
+move 50, 50
+wait 500
+down
+wait 500
+move 100, 100
+wait 500
+up
+wait 1000
diff --git a/test/custom/mouse-scaled-7.swf.trace b/test/custom/mouse-scaled-7.swf.trace
new file mode 100644
index 0000000..9ff816c
--- /dev/null
+++ b/test/custom/mouse-scaled-7.swf.trace
@@ -0,0 +1,9 @@
+Simple check for mouse movements on scaled movie
+500
+5
+500
+5
+1000
+10
+1000
+10
diff --git a/test/custom/mouse-scaled-7.swf.trace.org b/test/custom/mouse-scaled-7.swf.trace.org
new file mode 100644
index 0000000..ed03da3
--- /dev/null
+++ b/test/custom/mouse-scaled-7.swf.trace.org
@@ -0,0 +1,9 @@
+Simple check for mouse movements on scaled movie
+499.5
+5
+499.5
+5
+999
+10
+999
+10
diff --git a/test/custom/mouse-scaled.as b/test/custom/mouse-scaled.as
new file mode 100644
index 0000000..ce4d650
--- /dev/null
+++ b/test/custom/mouse-scaled.as
@@ -0,0 +1,17 @@
+// makeswf -v 7 -s 200x150 -r 1 -o mouse-scaled.swf mouse-scaled.as
+
+trace ("Simple check for mouse movements on scaled movie");
+
+dump = function () {
+ trace (_xmouse);
+ trace (_ymouse);
+};
+Mouse.addListener ({ onMouseMove: dump, onMouseDown: dump, onMouseUp: dump });
+
+_xscale = 10;
+_yscale = 1000;
+
+function quit () {
+ loadMovie ("FSCommand:quit", "");
+};
+setInterval (quit, 3000);
diff --git a/test/trace/button-events-button-5.swf b/test/trace/button-events-button-5.swf
deleted file mode 100644
index c669574..0000000
Binary files a/test/trace/button-events-button-5.swf and /dev/null differ
diff --git a/test/trace/button-events-button-5.swf.act b/test/trace/button-events-button-5.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-button-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-button-5.swf.trace b/test/trace/button-events-button-5.swf.trace
deleted file mode 100644
index 65a55a8..0000000
--- a/test/trace/button-events-button-5.swf.trace
+++ /dev/null
@@ -1,60 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance11.over4
-load _level0.button.instance12.over2
-load _level0.button.instance13.up_over
-button OverDown => OutDown: _level0
-unload _level0.button.instance11.over4
-unload _level0.button.instance12.over2
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.up_down
-button OutDown => OverDown: _level0
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance16.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance22.up_down
-load _level0.button.instance23.over4
-load _level0.button.instance24.over2
-load _level0.button.instance25.up_over
-button OverDown => OutDown: _level0
-unload _level0.button.instance23.over4
-unload _level0.button.instance24.over2
-unload _level0.button.instance7.over_down
-load _level0.button.instance26.up2
-load _level0.button.instance27.up3
-load _level0.button.instance28.up_down
-button OutDown => Idle: _level0
diff --git a/test/trace/button-events-button-6.swf b/test/trace/button-events-button-6.swf
deleted file mode 100644
index 820fb33..0000000
Binary files a/test/trace/button-events-button-6.swf and /dev/null differ
diff --git a/test/trace/button-events-button-6.swf.act b/test/trace/button-events-button-6.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-button-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-button-6.swf.trace b/test/trace/button-events-button-6.swf.trace
deleted file mode 100644
index 752c2fc..0000000
--- a/test/trace/button-events-button-6.swf.trace
+++ /dev/null
@@ -1,68 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-onRollOver: _level0.button
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance11.over4
-load _level0.button.instance12.over2
-load _level0.button.instance13.up_over
-button OverDown => OutDown: _level0
-onDragOut: _level0.button
-unload _level0.button.instance11.over4
-unload _level0.button.instance12.over2
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.up_down
-button OutDown => OverDown: _level0
-onDragOver: _level0.button
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance16.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-onRelease: _level0.button
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance22.up_down
-load _level0.button.instance23.over4
-load _level0.button.instance24.over2
-load _level0.button.instance25.up_over
-button OverDown => OutDown: _level0
-onDragOut: _level0.button
-unload _level0.button.instance23.over4
-unload _level0.button.instance24.over2
-unload _level0.button.instance7.over_down
-load _level0.button.instance26.up2
-load _level0.button.instance27.up3
-load _level0.button.instance28.up_down
-button OutDown => Idle: _level0
-onReleaseOutside: _level0.button
diff --git a/test/trace/button-events-button-7.swf b/test/trace/button-events-button-7.swf
deleted file mode 100644
index 2dadd1d..0000000
Binary files a/test/trace/button-events-button-7.swf and /dev/null differ
diff --git a/test/trace/button-events-button-7.swf.act b/test/trace/button-events-button-7.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-button-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-button-7.swf.trace b/test/trace/button-events-button-7.swf.trace
deleted file mode 100644
index 752c2fc..0000000
--- a/test/trace/button-events-button-7.swf.trace
+++ /dev/null
@@ -1,68 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-onRollOver: _level0.button
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance11.over4
-load _level0.button.instance12.over2
-load _level0.button.instance13.up_over
-button OverDown => OutDown: _level0
-onDragOut: _level0.button
-unload _level0.button.instance11.over4
-unload _level0.button.instance12.over2
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.up_down
-button OutDown => OverDown: _level0
-onDragOver: _level0.button
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance16.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-onRelease: _level0.button
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance22.up_down
-load _level0.button.instance23.over4
-load _level0.button.instance24.over2
-load _level0.button.instance25.up_over
-button OverDown => OutDown: _level0
-onDragOut: _level0.button
-unload _level0.button.instance23.over4
-unload _level0.button.instance24.over2
-unload _level0.button.instance7.over_down
-load _level0.button.instance26.up2
-load _level0.button.instance27.up3
-load _level0.button.instance28.up_down
-button OutDown => Idle: _level0
-onReleaseOutside: _level0.button
diff --git a/test/trace/button-events-button-8.swf b/test/trace/button-events-button-8.swf
deleted file mode 100644
index cbc15ee..0000000
Binary files a/test/trace/button-events-button-8.swf and /dev/null differ
diff --git a/test/trace/button-events-button-8.swf.act b/test/trace/button-events-button-8.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-button-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-button-8.swf.trace b/test/trace/button-events-button-8.swf.trace
deleted file mode 100644
index 752c2fc..0000000
--- a/test/trace/button-events-button-8.swf.trace
+++ /dev/null
@@ -1,68 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-onRollOver: _level0.button
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance11.over4
-load _level0.button.instance12.over2
-load _level0.button.instance13.up_over
-button OverDown => OutDown: _level0
-onDragOut: _level0.button
-unload _level0.button.instance11.over4
-unload _level0.button.instance12.over2
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.up_down
-button OutDown => OverDown: _level0
-onDragOver: _level0.button
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance16.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-onRelease: _level0.button
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance22.up_down
-load _level0.button.instance23.over4
-load _level0.button.instance24.over2
-load _level0.button.instance25.up_over
-button OverDown => OutDown: _level0
-onDragOut: _level0.button
-unload _level0.button.instance23.over4
-unload _level0.button.instance24.over2
-unload _level0.button.instance7.over_down
-load _level0.button.instance26.up2
-load _level0.button.instance27.up3
-load _level0.button.instance28.up_down
-button OutDown => Idle: _level0
-onReleaseOutside: _level0.button
diff --git a/test/trace/button-events-menu-5.swf b/test/trace/button-events-menu-5.swf
deleted file mode 100644
index 2892fda..0000000
Binary files a/test/trace/button-events-menu-5.swf and /dev/null differ
diff --git a/test/trace/button-events-menu-5.swf.act b/test/trace/button-events-menu-5.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-menu-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-menu-5.swf.trace b/test/trace/button-events-menu-5.swf.trace
deleted file mode 100644
index 10f1ff0..0000000
--- a/test/trace/button-events-menu-5.swf.trace
+++ /dev/null
@@ -1,53 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance7.over_down
-load _level0.button.instance11.up2
-load _level0.button.instance12.up3
-load _level0.button.instance13.up_over
-button OverDown => Idle: _level0
-unload _level0.button.instance11.up2
-unload _level0.button.instance12.up3
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.over_down
-button Idle => OutDown: _level0
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance16.over_down
-load _level0.button.instance23.up2
-load _level0.button.instance24.up3
-load _level0.button.instance25.up_over
-button OverDown => Idle: _level0
diff --git a/test/trace/button-events-menu-6.swf b/test/trace/button-events-menu-6.swf
deleted file mode 100644
index f535879..0000000
Binary files a/test/trace/button-events-menu-6.swf and /dev/null differ
diff --git a/test/trace/button-events-menu-6.swf.act b/test/trace/button-events-menu-6.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-menu-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-menu-6.swf.trace b/test/trace/button-events-menu-6.swf.trace
deleted file mode 100644
index 6f9f001..0000000
--- a/test/trace/button-events-menu-6.swf.trace
+++ /dev/null
@@ -1,60 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-onRollOver: _level0.button
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance7.over_down
-load _level0.button.instance11.up2
-load _level0.button.instance12.up3
-load _level0.button.instance13.up_over
-button OverDown => Idle: _level0
-onDragOut: _level0.button
-unload _level0.button.instance11.up2
-unload _level0.button.instance12.up3
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.over_down
-button Idle => OutDown: _level0
-onDragOver: _level0.button
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-onRelease: _level0.button
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance16.over_down
-load _level0.button.instance23.up2
-load _level0.button.instance24.up3
-load _level0.button.instance25.up_over
-button OverDown => Idle: _level0
-onDragOut: _level0.button
diff --git a/test/trace/button-events-menu-7.swf b/test/trace/button-events-menu-7.swf
deleted file mode 100644
index 04c3b27..0000000
Binary files a/test/trace/button-events-menu-7.swf and /dev/null differ
diff --git a/test/trace/button-events-menu-7.swf.act b/test/trace/button-events-menu-7.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-menu-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-menu-7.swf.trace b/test/trace/button-events-menu-7.swf.trace
deleted file mode 100644
index 6f9f001..0000000
--- a/test/trace/button-events-menu-7.swf.trace
+++ /dev/null
@@ -1,60 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-onRollOver: _level0.button
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance7.over_down
-load _level0.button.instance11.up2
-load _level0.button.instance12.up3
-load _level0.button.instance13.up_over
-button OverDown => Idle: _level0
-onDragOut: _level0.button
-unload _level0.button.instance11.up2
-unload _level0.button.instance12.up3
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.over_down
-button Idle => OutDown: _level0
-onDragOver: _level0.button
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-onRelease: _level0.button
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance16.over_down
-load _level0.button.instance23.up2
-load _level0.button.instance24.up3
-load _level0.button.instance25.up_over
-button OverDown => Idle: _level0
-onDragOut: _level0.button
diff --git a/test/trace/button-events-menu-8.swf b/test/trace/button-events-menu-8.swf
deleted file mode 100644
index b13d0d0..0000000
Binary files a/test/trace/button-events-menu-8.swf and /dev/null differ
diff --git a/test/trace/button-events-menu-8.swf.act b/test/trace/button-events-menu-8.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/button-events-menu-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/button-events-menu-8.swf.trace b/test/trace/button-events-menu-8.swf.trace
deleted file mode 100644
index 6f9f001..0000000
--- a/test/trace/button-events-menu-8.swf.trace
+++ /dev/null
@@ -1,60 +0,0 @@
-load _level0.button.instance1.up2
-load _level0.button.instance2.up3
-load _level0.button.instance3.up_down
-load _level0.button.instance4.up_over
-unload _level0.button.instance1.up2
-unload _level0.button.instance2.up3
-unload _level0.button.instance3.up_down
-load _level0.button.instance5.over4
-load _level0.button.instance6.over2
-load _level0.button.instance7.over_down
-button Idle => OverUp: _level0
-onRollOver: _level0.button
-unload _level0.button.instance5.over4
-unload _level0.button.instance6.over2
-unload _level0.button.instance4.up_over
-load _level0.button.instance8.down2
-load _level0.button.instance9.down5
-load _level0.button.instance10.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance8.down2
-unload _level0.button.instance9.down5
-unload _level0.button.instance7.over_down
-load _level0.button.instance11.up2
-load _level0.button.instance12.up3
-load _level0.button.instance13.up_over
-button OverDown => Idle: _level0
-onDragOut: _level0.button
-unload _level0.button.instance11.up2
-unload _level0.button.instance12.up3
-unload _level0.button.instance13.up_over
-load _level0.button.instance14.down2
-load _level0.button.instance15.down5
-load _level0.button.instance16.over_down
-button Idle => OutDown: _level0
-onDragOver: _level0.button
-unload _level0.button.instance14.down2
-unload _level0.button.instance15.down5
-unload _level0.button.instance10.up_down
-load _level0.button.instance17.over4
-load _level0.button.instance18.over2
-load _level0.button.instance19.up_over
-button OverDown => OverUp: _level0
-onRelease: _level0.button
-unload _level0.button.instance17.over4
-unload _level0.button.instance18.over2
-unload _level0.button.instance19.up_over
-load _level0.button.instance20.down2
-load _level0.button.instance21.down5
-load _level0.button.instance22.up_down
-button OverUp => OverDown: _level0
-onPress: _level0.button
-unload _level0.button.instance20.down2
-unload _level0.button.instance21.down5
-unload _level0.button.instance16.over_down
-load _level0.button.instance23.up2
-load _level0.button.instance24.up3
-load _level0.button.instance25.up_over
-button OverDown => Idle: _level0
-onDragOut: _level0.button
diff --git a/test/trace/button-events.c b/test/trace/button-events.c
deleted file mode 100644
index dad2eb0..0000000
--- a/test/trace/button-events.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* gcc `pkg-config --libs --cflags libming` button-events.c -o button-events && ./button-events
- */
-
-#include <ming.h>
-
-static const char *events[] = { "Press", "Release", "ReleaseOutside", "RollOver", "RollOut", "DragOver", "DragOut" };
-static const char *button_events[] = { "Idle => OverUp", "OverUp => Idle", "OverUp => OverDown", "OverDown => OverUp", "OverDown => OutDown", "OutDown => OverDown", "OutDown => Idle", "Idle => OutDown", "OverDown => Idle" };
-
-static void
-add_button_events (SWFButton button)
-{
- char script[100];
- unsigned int i;
-
- for (i = 0; i < sizeof (button_events) / sizeof (button_events[0]); i++) {
- sprintf (script, "trace (\"button %s: \" + this);", button_events[i]);
- SWFButton_addAction (button, newSWFAction (script), (1 << i));
- }
-}
-
-static SWFCharacter
-get_clip_events_movie (const char *name)
-{
- SWFMovieClip clip;
- SWFDisplayItem item;
-
- clip = newSWFMovieClip ();
- item = SWFMovieClip_add (clip, (SWFBlock) newSWFMovieClip ());
- SWFDisplayItem_addAction (item, newSWFAction ("trace (\"load \" + this);"), SWFACTION_ONLOAD);
- SWFDisplayItem_addAction (item, newSWFAction ("trace (\"unload \" + this);"), SWFACTION_UNLOAD);
- SWFDisplayItem_setName (item, name);
- SWFMovieClip_nextFrame (clip);
- return (SWFCharacter) clip;
-}
-
-static void
-add_item_events (SWFDisplayItem item)
-{
- char script[100];
- unsigned int i;
-
- for (i = 0; i < sizeof (events) / sizeof (events[0]); i++) {
- sprintf (script, "trace (\"place %s: \" + this);", events[i]);
- SWFDisplayItem_addAction (item, newSWFAction (script), 1 << (10 + i));
- }
-}
-
-static SWFCharacter
-get_rectangle (int r, int g, int b)
-{
- SWFShape shape;
- SWFFillStyle fill;
-
- shape = newSWFShape ();
- fill = SWFShape_addSolidFillStyle (shape, r, g, b, 255);
- SWFShape_setRightFillStyle (shape, fill);
- SWFShape_drawLineTo (shape, 100, 0);
- SWFShape_drawLineTo (shape, 100, 100);
- SWFShape_drawLineTo (shape, 0, 100);
- SWFShape_drawLineTo (shape, 0, 0);
-
- return (SWFCharacter) shape;
-}
-
-static void
-do_movie (int version, int menu)
-{
- char name[100];
- SWFMovie movie;
- SWFDisplayItem item;
- SWFButton button;
- SWFButtonRecord rec;
-
- movie = newSWFMovieWithVersion (version);
- SWFMovie_setRate (movie, 10);
- SWFMovie_setDimension (movie, 200, 150);
-
- SWFMovie_add (movie, newSWFInitAction (newSWFAction (
- "button.onPress = function () { trace (\"onPress: \" + this); };"
- "button.onRelease = function () { trace (\"onRelease: \" + this); };"
- "button.onReleaseOutside = function () { trace (\"onReleaseOutside: \" + this); };"
- "button.onRollOver = function () { trace (\"onRollOver: \" + this); };"
- "button.onRollOut = function () { trace (\"onRollOut: \" + this); };"
- "button.onDragOver = function () { trace (\"onDragOver: \" + this); };"
- "button.onDragOut = function () { trace (\"onDragOut: \" + this); };"
- )));
- button = newSWFButton ();
- SWFButton_setMenu (button, menu);
- rec = SWFButton_addCharacter (button, get_rectangle (255, 0, 0), SWFBUTTON_UP | SWFBUTTON_HIT);
- SWFButtonRecord_setDepth (rec, 1);
- rec = SWFButton_addCharacter (button, get_rectangle (0, 255, 0), SWFBUTTON_OVER);
- SWFButtonRecord_setDepth (rec, 1);
- rec = SWFButton_addCharacter (button, get_rectangle (0, 0, 255), SWFBUTTON_DOWN);
- SWFButtonRecord_setDepth (rec, 1);
-
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("up2"), SWFBUTTON_UP);
- SWFButtonRecord_setDepth (rec, 2);
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("up3"), SWFBUTTON_UP);
- SWFButtonRecord_setDepth (rec, 3);
-
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("over4"), SWFBUTTON_OVER);
- SWFButtonRecord_setDepth (rec, 4);
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("over2"), SWFBUTTON_OVER);
- SWFButtonRecord_setDepth (rec, 2);
-
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("down2"), SWFBUTTON_DOWN);
- SWFButtonRecord_setDepth (rec, 2);
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("down5"), SWFBUTTON_DOWN);
- SWFButtonRecord_setDepth (rec, 5);
-
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("up_down"), SWFBUTTON_UP | SWFBUTTON_DOWN);
- SWFButtonRecord_setDepth (rec, 6);
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("up_over"), SWFBUTTON_UP | SWFBUTTON_OVER);
- SWFButtonRecord_setDepth (rec, 7);
- rec = SWFButton_addCharacter (button, get_clip_events_movie ("over_down"), SWFBUTTON_DOWN | SWFBUTTON_OVER);
- SWFButtonRecord_setDepth (rec, 8);
-
- add_button_events (button);
- item = SWFMovie_add (movie, button);
- add_item_events (item);
- SWFDisplayItem_setDepth (item, 0);
- SWFDisplayItem_setName (item, "button");
-
- SWFMovie_nextFrame (movie);
-
- sprintf (name, "button-events-%s-%d.swf", menu ? "menu" : "button", version);
- SWFMovie_save (movie, name);
-}
-
-int
-main (int argc, char **argv)
-{
- int i;
-
- if (Ming_init ())
- return 1;
-
- for (i = 8; i >= 5; i--) {
- do_movie (i, 0);
- do_movie (i, 1);
- }
-
- return 0;
-}
diff --git a/test/trace/definebutton-5.swf b/test/trace/definebutton-5.swf
deleted file mode 100644
index 6ab33d2..0000000
Binary files a/test/trace/definebutton-5.swf and /dev/null differ
diff --git a/test/trace/definebutton-5.swf.act b/test/trace/definebutton-5.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/definebutton-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/definebutton-5.swf.trace b/test/trace/definebutton-5.swf.trace
deleted file mode 100644
index 49d341d..0000000
--- a/test/trace/definebutton-5.swf.trace
+++ /dev/null
@@ -1,18 +0,0 @@
-load _level0.instance1.instance2.instance3
-unload _level0.instance1.instance2.instance3
-load _level0.instance1.instance4.instance5
-unload _level0.instance1.instance4.instance5
-load _level0.instance1.instance6.instance7
-unload _level0.instance1.instance6.instance7
-load _level0.instance1.instance8.instance9
-unload _level0.instance1.instance8.instance9
-load _level0.instance1.instance10.instance11
-unload _level0.instance1.instance10.instance11
-load _level0.instance1.instance12.instance13
-_level0
-unload _level0.instance1.instance12.instance13
-load _level0.instance1.instance14.instance15
-unload _level0.instance1.instance14.instance15
-load _level0.instance1.instance16.instance17
-unload _level0.instance1.instance16.instance17
-load _level0.instance1.instance18.instance19
diff --git a/test/trace/definebutton-6.swf b/test/trace/definebutton-6.swf
deleted file mode 100644
index 6e1444b..0000000
Binary files a/test/trace/definebutton-6.swf and /dev/null differ
diff --git a/test/trace/definebutton-6.swf.act b/test/trace/definebutton-6.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/definebutton-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/definebutton-6.swf.trace b/test/trace/definebutton-6.swf.trace
deleted file mode 100644
index 49d341d..0000000
--- a/test/trace/definebutton-6.swf.trace
+++ /dev/null
@@ -1,18 +0,0 @@
-load _level0.instance1.instance2.instance3
-unload _level0.instance1.instance2.instance3
-load _level0.instance1.instance4.instance5
-unload _level0.instance1.instance4.instance5
-load _level0.instance1.instance6.instance7
-unload _level0.instance1.instance6.instance7
-load _level0.instance1.instance8.instance9
-unload _level0.instance1.instance8.instance9
-load _level0.instance1.instance10.instance11
-unload _level0.instance1.instance10.instance11
-load _level0.instance1.instance12.instance13
-_level0
-unload _level0.instance1.instance12.instance13
-load _level0.instance1.instance14.instance15
-unload _level0.instance1.instance14.instance15
-load _level0.instance1.instance16.instance17
-unload _level0.instance1.instance16.instance17
-load _level0.instance1.instance18.instance19
diff --git a/test/trace/definebutton-7.swf b/test/trace/definebutton-7.swf
deleted file mode 100644
index 067ce1a..0000000
Binary files a/test/trace/definebutton-7.swf and /dev/null differ
diff --git a/test/trace/definebutton-7.swf.act b/test/trace/definebutton-7.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/definebutton-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/definebutton-7.swf.trace b/test/trace/definebutton-7.swf.trace
deleted file mode 100644
index 49d341d..0000000
--- a/test/trace/definebutton-7.swf.trace
+++ /dev/null
@@ -1,18 +0,0 @@
-load _level0.instance1.instance2.instance3
-unload _level0.instance1.instance2.instance3
-load _level0.instance1.instance4.instance5
-unload _level0.instance1.instance4.instance5
-load _level0.instance1.instance6.instance7
-unload _level0.instance1.instance6.instance7
-load _level0.instance1.instance8.instance9
-unload _level0.instance1.instance8.instance9
-load _level0.instance1.instance10.instance11
-unload _level0.instance1.instance10.instance11
-load _level0.instance1.instance12.instance13
-_level0
-unload _level0.instance1.instance12.instance13
-load _level0.instance1.instance14.instance15
-unload _level0.instance1.instance14.instance15
-load _level0.instance1.instance16.instance17
-unload _level0.instance1.instance16.instance17
-load _level0.instance1.instance18.instance19
diff --git a/test/trace/definebutton-8.swf b/test/trace/definebutton-8.swf
deleted file mode 100644
index 7a445b7..0000000
Binary files a/test/trace/definebutton-8.swf and /dev/null differ
diff --git a/test/trace/definebutton-8.swf.act b/test/trace/definebutton-8.swf.act
deleted file mode 100644
index 352902b..0000000
--- a/test/trace/definebutton-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-move 50, 50
-wait 1000
-up
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/definebutton-8.swf.trace b/test/trace/definebutton-8.swf.trace
deleted file mode 100644
index 49d341d..0000000
--- a/test/trace/definebutton-8.swf.trace
+++ /dev/null
@@ -1,18 +0,0 @@
-load _level0.instance1.instance2.instance3
-unload _level0.instance1.instance2.instance3
-load _level0.instance1.instance4.instance5
-unload _level0.instance1.instance4.instance5
-load _level0.instance1.instance6.instance7
-unload _level0.instance1.instance6.instance7
-load _level0.instance1.instance8.instance9
-unload _level0.instance1.instance8.instance9
-load _level0.instance1.instance10.instance11
-unload _level0.instance1.instance10.instance11
-load _level0.instance1.instance12.instance13
-_level0
-unload _level0.instance1.instance12.instance13
-load _level0.instance1.instance14.instance15
-unload _level0.instance1.instance14.instance15
-load _level0.instance1.instance16.instance17
-unload _level0.instance1.instance16.instance17
-load _level0.instance1.instance18.instance19
diff --git a/test/trace/definebutton.xml b/test/trace/definebutton.xml
deleted file mode 100644
index e07514d..0000000
--- a/test/trace/definebutton.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0"?>
-<swf version="8" compressed="0">
- <Header framerate="1" frames="1">
- <size>
- <Rectangle left="0" right="4000" top="0" bottom="3000"/>
- </size>
- <tags>
- <SetBackgroundColor>
- <color>
- <Color red="255" green="255" blue="255"/>
- </color>
- </SetBackgroundColor>
- <DefineShape objectID="1">
- <bounds>
- <Rectangle left="0" right="1200" top="0" bottom="1200"/>
- </bounds>
- <styles>
- <StyleList>
- <fillStyles>
- <Solid>
- <color>
- <Color red="255" green="0" blue="0"/>
- </color>
- </Solid>
- </fillStyles>
- <lineStyles />
- </StyleList>
- </styles>
- <shapes>
- <Shape>
- <edges>
- <ShapeSetup x="0" y="0" fillStyle1="1"/>
- <LineTo x="0" y="1200"/>
- <LineTo x="1200" y="0"/>
- <LineTo x="0" y="-1200"/>
- <LineTo x="-1200" y="0"/>
- <ShapeSetup/>
- </edges>
- </Shape>
- </shapes>
- </DefineShape>
- <DefineSprite objectID="2" frames="1">
- <tags>
- <PlaceObject2 replace="0" depth="1" objectID="1" />
- <ShowFrame/>
- </tags>
- </DefineSprite>
- <DefineSprite objectID="3" frames="1">
- <tags>
- <PlaceObject2 replace="0" depth="1" objectID="2" allflags1="5" allflags2="0">
- <events>
- <Event flags1="1" flags2="0">
- <actions>
- <Dictionary>
- <strings>
- <String value="load "/>
- <String value="this"/>
- </strings>
- </Dictionary>
- <PushData>
- <items>
- <StackDictionaryLookup index="0"/>
- <StackDictionaryLookup index="1"/>
- </items>
- </PushData>
- <GetVariable/>
- <AddTyped/>
- <Trace/>
- <EndAction/>
- </actions>
- </Event>
- <Event flags1="4" flags2="0">
- <actions>
- <Dictionary>
- <strings>
- <String value="unload "/>
- <String value="this"/>
- </strings>
- </Dictionary>
- <PushData>
- <items>
- <StackDictionaryLookup index="0"/>
- <StackDictionaryLookup index="1"/>
- </items>
- </PushData>
- <GetVariable/>
- <AddTyped/>
- <Trace/>
- <EndAction/>
- </actions>
- </Event>
- <Event flags1="0" flags2="0"/>
- </events>
- </PlaceObject2>
- <ShowFrame/>
- </tags>
- </DefineSprite>
- <DefineButton objectID="4">
- <buttons>
- <Button hitTest="0" down="0" over="0" up="1" objectID="3" depth="1">
- <transform>
- <Transform transX="1200" transY="0"/>
- </transform>
- </Button>
- <Button hitTest="0" down="0" over="1" up="0" objectID="3" depth="1">
- <transform>
- <Transform transX="1200" transY="1200"/>
- </transform>
- </Button>
- <Button hitTest="0" down="1" over="0" up="0" objectID="3" depth="1">
- <transform>
- <Transform transX="0" transY="1200"/>
- </transform>
- </Button>
- <Button hitTest="1" down="0" over="0" up="0" objectID="1" depth="1">
- <transform>
- <Transform transX="0" transY="0"/>
- </transform>
- </Button>
- <Button hitTest="0" down="0" over="0" up="0"/>
- </buttons>
- <actions>
- <PushData>
- <items>
- <StackString value="this"/>
- </items>
- </PushData>
- <GetVariable/>
- <Trace/>
- <EndAction/>
- </actions>
- </DefineButton>
- <PlaceObject2 replace="0" depth="1" objectID="4" />
- <ShowFrame/>
- <End/>
- </tags>
- </Header>
-</swf>
diff --git a/test/trace/mouse-addProperty-relevant-5.swf b/test/trace/mouse-addProperty-relevant-5.swf
deleted file mode 100644
index b1b6ab1..0000000
Binary files a/test/trace/mouse-addProperty-relevant-5.swf and /dev/null differ
diff --git a/test/trace/mouse-addProperty-relevant-5.swf.act b/test/trace/mouse-addProperty-relevant-5.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/trace/mouse-addProperty-relevant-5.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/mouse-addProperty-relevant-5.swf.trace b/test/trace/mouse-addProperty-relevant-5.swf.trace
deleted file mode 100644
index 1062378..0000000
--- a/test/trace/mouse-addProperty-relevant-5.swf.trace
+++ /dev/null
@@ -1 +0,0 @@
-Check if addProperty proeprties make movies sensitive to mouse events
diff --git a/test/trace/mouse-addProperty-relevant-6.swf b/test/trace/mouse-addProperty-relevant-6.swf
deleted file mode 100644
index 0465358..0000000
Binary files a/test/trace/mouse-addProperty-relevant-6.swf and /dev/null differ
diff --git a/test/trace/mouse-addProperty-relevant-6.swf.act b/test/trace/mouse-addProperty-relevant-6.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/trace/mouse-addProperty-relevant-6.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/mouse-addProperty-relevant-6.swf.trace b/test/trace/mouse-addProperty-relevant-6.swf.trace
deleted file mode 100644
index d235e29..0000000
--- a/test/trace/mouse-addProperty-relevant-6.swf.trace
+++ /dev/null
@@ -1,3 +0,0 @@
-Check if addProperty proeprties make movies sensitive to mouse events
-onRollOver: _level0.b
-onRollOver: _level0.a
diff --git a/test/trace/mouse-addProperty-relevant-7.swf b/test/trace/mouse-addProperty-relevant-7.swf
deleted file mode 100644
index 194d5df..0000000
Binary files a/test/trace/mouse-addProperty-relevant-7.swf and /dev/null differ
diff --git a/test/trace/mouse-addProperty-relevant-7.swf.act b/test/trace/mouse-addProperty-relevant-7.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/trace/mouse-addProperty-relevant-7.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/mouse-addProperty-relevant-7.swf.trace b/test/trace/mouse-addProperty-relevant-7.swf.trace
deleted file mode 100644
index d235e29..0000000
--- a/test/trace/mouse-addProperty-relevant-7.swf.trace
+++ /dev/null
@@ -1,3 +0,0 @@
-Check if addProperty proeprties make movies sensitive to mouse events
-onRollOver: _level0.b
-onRollOver: _level0.a
diff --git a/test/trace/mouse-addProperty-relevant-8.swf b/test/trace/mouse-addProperty-relevant-8.swf
deleted file mode 100644
index 64e4382..0000000
Binary files a/test/trace/mouse-addProperty-relevant-8.swf and /dev/null differ
diff --git a/test/trace/mouse-addProperty-relevant-8.swf.act b/test/trace/mouse-addProperty-relevant-8.swf.act
deleted file mode 100644
index 80749b5..0000000
--- a/test/trace/mouse-addProperty-relevant-8.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 1000
-move 50, 50
-wait 1000
-down
-wait 1000
-move 140, 140
-wait 1000
-up
-wait 1000
diff --git a/test/trace/mouse-addProperty-relevant-8.swf.trace b/test/trace/mouse-addProperty-relevant-8.swf.trace
deleted file mode 100644
index d235e29..0000000
--- a/test/trace/mouse-addProperty-relevant-8.swf.trace
+++ /dev/null
@@ -1,3 +0,0 @@
-Check if addProperty proeprties make movies sensitive to mouse events
-onRollOver: _level0.b
-onRollOver: _level0.a
diff --git a/test/trace/mouse-addProperty-relevant.as b/test/trace/mouse-addProperty-relevant.as
deleted file mode 100644
index a96d29e..0000000
--- a/test/trace/mouse-addProperty-relevant.as
+++ /dev/null
@@ -1,23 +0,0 @@
-// makeswf -v 7 -s 200x150 -r 1 -o mouse-addProperty-relevant.swf mouse-addProperty-relevant.as
-
-trace ("Check if addProperty proeprties make movies sensitive to mouse events");
-
-rectangle = function (mc, color, x, y, w, h) {
- mc.beginFill (color);
- mc.moveTo (x, y);
- mc.lineTo (x, y + h);
- mc.lineTo (x + w, y + h);
- mc.lineTo (x + w, y);
- mc.lineTo (x, y);
- mc.endFill ();
-};
-
-install = function (mc) {
- mc.addProperty ("onRollOver", function () { trace ("onRollOver: " + this); }, null);
-};
-
-install (Object.prototype);
-createEmptyMovieClip ("a", 0);
-createEmptyMovieClip ("b", 1);
-rectangle (a, 0, 0, 0, 200, 150);
-rectangle (b, 0xFF, 25, 25, 100, 100);
diff --git a/test/trace/mouse-movie-below-movie-5.swf b/test/trace/mouse-movie-below-movie-5.swf
deleted file mode 100644
index c1dc29a..0000000
Binary files a/test/trace/mouse-movie-below-movie-5.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-movie-5.swf.act b/test/trace/mouse-movie-below-movie-5.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-movie-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-movie-5.swf.trace b/test/trace/mouse-movie-below-movie-5.swf.trace
deleted file mode 100644
index e69de29..0000000
diff --git a/test/trace/mouse-movie-below-movie-6.swf b/test/trace/mouse-movie-below-movie-6.swf
deleted file mode 100644
index f4d0029..0000000
Binary files a/test/trace/mouse-movie-below-movie-6.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-movie-6.swf.act b/test/trace/mouse-movie-below-movie-6.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-movie-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-movie-6.swf.trace b/test/trace/mouse-movie-below-movie-6.swf.trace
deleted file mode 100644
index e00b5f3..0000000
--- a/test/trace/mouse-movie-below-movie-6.swf.trace
+++ /dev/null
@@ -1,9 +0,0 @@
-onRollOver: _level0.b
-onPress: _level0.b
-onDragOut: _level0.b
-onDragOver: _level0.b
-onRelease: _level0.b
-onPress: _level0.b
-onDragOut: _level0.b
-onReleaseOutside: _level0.b
-onRollOver: _level0.a
diff --git a/test/trace/mouse-movie-below-movie-7.swf b/test/trace/mouse-movie-below-movie-7.swf
deleted file mode 100644
index 360c233..0000000
Binary files a/test/trace/mouse-movie-below-movie-7.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-movie-7.swf.act b/test/trace/mouse-movie-below-movie-7.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-movie-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-movie-7.swf.trace b/test/trace/mouse-movie-below-movie-7.swf.trace
deleted file mode 100644
index e00b5f3..0000000
--- a/test/trace/mouse-movie-below-movie-7.swf.trace
+++ /dev/null
@@ -1,9 +0,0 @@
-onRollOver: _level0.b
-onPress: _level0.b
-onDragOut: _level0.b
-onDragOver: _level0.b
-onRelease: _level0.b
-onPress: _level0.b
-onDragOut: _level0.b
-onReleaseOutside: _level0.b
-onRollOver: _level0.a
diff --git a/test/trace/mouse-movie-below-movie-8.swf b/test/trace/mouse-movie-below-movie-8.swf
deleted file mode 100644
index db943f2..0000000
Binary files a/test/trace/mouse-movie-below-movie-8.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-movie-8.swf.act b/test/trace/mouse-movie-below-movie-8.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-movie-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-movie-8.swf.trace b/test/trace/mouse-movie-below-movie-8.swf.trace
deleted file mode 100644
index e00b5f3..0000000
--- a/test/trace/mouse-movie-below-movie-8.swf.trace
+++ /dev/null
@@ -1,9 +0,0 @@
-onRollOver: _level0.b
-onPress: _level0.b
-onDragOut: _level0.b
-onDragOver: _level0.b
-onRelease: _level0.b
-onPress: _level0.b
-onDragOut: _level0.b
-onReleaseOutside: _level0.b
-onRollOver: _level0.a
diff --git a/test/trace/mouse-movie-below-movie.as b/test/trace/mouse-movie-below-movie.as
deleted file mode 100644
index 29d83b5..0000000
--- a/test/trace/mouse-movie-below-movie.as
+++ /dev/null
@@ -1,27 +0,0 @@
-// makeswf -v 7 -s 200x150 -r 1 -o mouse-movie-below-movie.swf mouse-movie-below-movie.as
-
-rectangle = function (mc, color, x, y, w, h) {
- mc.beginFill (color);
- mc.moveTo (x, y);
- mc.lineTo (x, y + h);
- mc.lineTo (x + w, y + h);
- mc.lineTo (x + w, y);
- mc.lineTo (x, y);
- mc.endFill ();
-};
-
-install = function (mc) {
- mc.onRollOver = function () { trace ("onRollOver: " + this); };
- mc.onRollOut = function () { trace ("onRollOut: " + this); };
- mc.onDragOut = function () { trace ("onDragOut: " + this); };
- mc.onDragOver = function () { trace ("onDragOver: " + this); };
- mc.onPress = function () { trace ("onPress: " + this); };
- mc.onRelease = function () { trace ("onRelease: " + this); };
- mc.onReleaseOutside = function () { trace ("onReleaseOutside: " + this); };
-};
-
-createEmptyMovieClip ("a", 0);
-install (MovieClip.prototype);
-createEmptyMovieClip ("b", 1);
-rectangle (a, 0, 0, 0, 200, 150);
-rectangle (b, 0xFF, 25, 25, 100, 100);
diff --git a/test/trace/mouse-movie-below-nonevent-movie-5.swf b/test/trace/mouse-movie-below-nonevent-movie-5.swf
deleted file mode 100644
index 587cc3d..0000000
Binary files a/test/trace/mouse-movie-below-nonevent-movie-5.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-nonevent-movie-5.swf.act b/test/trace/mouse-movie-below-nonevent-movie-5.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie-5.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-nonevent-movie-5.swf.trace b/test/trace/mouse-movie-below-nonevent-movie-5.swf.trace
deleted file mode 100644
index e69de29..0000000
diff --git a/test/trace/mouse-movie-below-nonevent-movie-6.swf b/test/trace/mouse-movie-below-nonevent-movie-6.swf
deleted file mode 100644
index b95bc02..0000000
Binary files a/test/trace/mouse-movie-below-nonevent-movie-6.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-nonevent-movie-6.swf.act b/test/trace/mouse-movie-below-nonevent-movie-6.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie-6.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-nonevent-movie-6.swf.trace b/test/trace/mouse-movie-below-nonevent-movie-6.swf.trace
deleted file mode 100644
index 0e55f00..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie-6.swf.trace
+++ /dev/null
@@ -1,5 +0,0 @@
-onRollOver: _level0.a
-onPress: _level0.a
-onRelease: _level0.a
-onPress: _level0.a
-onRelease: _level0.a
diff --git a/test/trace/mouse-movie-below-nonevent-movie-7.swf b/test/trace/mouse-movie-below-nonevent-movie-7.swf
deleted file mode 100644
index f6aed05..0000000
Binary files a/test/trace/mouse-movie-below-nonevent-movie-7.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-nonevent-movie-7.swf.act b/test/trace/mouse-movie-below-nonevent-movie-7.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie-7.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-nonevent-movie-7.swf.trace b/test/trace/mouse-movie-below-nonevent-movie-7.swf.trace
deleted file mode 100644
index 0e55f00..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie-7.swf.trace
+++ /dev/null
@@ -1,5 +0,0 @@
-onRollOver: _level0.a
-onPress: _level0.a
-onRelease: _level0.a
-onPress: _level0.a
-onRelease: _level0.a
diff --git a/test/trace/mouse-movie-below-nonevent-movie-8.swf b/test/trace/mouse-movie-below-nonevent-movie-8.swf
deleted file mode 100644
index 2065974..0000000
Binary files a/test/trace/mouse-movie-below-nonevent-movie-8.swf and /dev/null differ
diff --git a/test/trace/mouse-movie-below-nonevent-movie-8.swf.act b/test/trace/mouse-movie-below-nonevent-movie-8.swf.act
deleted file mode 100644
index e1639d5..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie-8.swf.act
+++ /dev/null
@@ -1,17 +0,0 @@
-wait 300
-move 50, 50
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-move 50, 50
-wait 300
-up
-wait 300
-down
-wait 300
-move 140, 140
-wait 300
-up
-wait 300
diff --git a/test/trace/mouse-movie-below-nonevent-movie-8.swf.trace b/test/trace/mouse-movie-below-nonevent-movie-8.swf.trace
deleted file mode 100644
index 0e55f00..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie-8.swf.trace
+++ /dev/null
@@ -1,5 +0,0 @@
-onRollOver: _level0.a
-onPress: _level0.a
-onRelease: _level0.a
-onPress: _level0.a
-onRelease: _level0.a
diff --git a/test/trace/mouse-movie-below-nonevent-movie.as b/test/trace/mouse-movie-below-nonevent-movie.as
deleted file mode 100644
index 6654cf1..0000000
--- a/test/trace/mouse-movie-below-nonevent-movie.as
+++ /dev/null
@@ -1,27 +0,0 @@
-// makeswf -v 7 -s 200x150 -r 1 -o mouse-movie-below-nonevent-movie.swf mouse-movie-below-nonevent-movie.as
-
-rectangle = function (mc, color, x, y, w, h) {
- mc.beginFill (color);
- mc.moveTo (x, y);
- mc.lineTo (x, y + h);
- mc.lineTo (x + w, y + h);
- mc.lineTo (x + w, y);
- mc.lineTo (x, y);
- mc.endFill ();
-};
-
-install = function (mc) {
- mc.onRollOver = function () { trace ("onRollOver: " + this); };
- mc.onRollOut = function () { trace ("onRollOut: " + this); };
- mc.onDragOut = function () { trace ("onRollOut: " + this); };
- mc.onDragOver = function () { trace ("onDragOver: " + this); };
- mc.onPress = function () { trace ("onPress: " + this); };
- mc.onRelease = function () { trace ("onRelease: " + this); };
- mc.onReleaseOutside = function () { trace ("onReleaseOutside: " + this); };
-};
-
-createEmptyMovieClip ("a", 0);
-install (a);
-createEmptyMovieClip ("b", 1);
-rectangle (a, 0, 0, 0, 200, 150);
-rectangle (b, 0xFF, 25, 25, 100, 100);
diff --git a/test/trace/mouse-scaled-5.swf b/test/trace/mouse-scaled-5.swf
deleted file mode 100644
index 2f38580..0000000
Binary files a/test/trace/mouse-scaled-5.swf and /dev/null differ
diff --git a/test/trace/mouse-scaled-5.swf.act b/test/trace/mouse-scaled-5.swf.act
deleted file mode 100644
index 83d4379..0000000
--- a/test/trace/mouse-scaled-5.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 500
-move 50, 50
-wait 500
-down
-wait 500
-move 100, 100
-wait 500
-up
-wait 1000
diff --git a/test/trace/mouse-scaled-5.swf.trace b/test/trace/mouse-scaled-5.swf.trace
deleted file mode 100644
index fbd32bf..0000000
--- a/test/trace/mouse-scaled-5.swf.trace
+++ /dev/null
@@ -1 +0,0 @@
-Simple check for mouse movements on scaled movie
diff --git a/test/trace/mouse-scaled-6.swf b/test/trace/mouse-scaled-6.swf
deleted file mode 100644
index df47efa..0000000
Binary files a/test/trace/mouse-scaled-6.swf and /dev/null differ
diff --git a/test/trace/mouse-scaled-6.swf.act b/test/trace/mouse-scaled-6.swf.act
deleted file mode 100644
index 83d4379..0000000
--- a/test/trace/mouse-scaled-6.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 500
-move 50, 50
-wait 500
-down
-wait 500
-move 100, 100
-wait 500
-up
-wait 1000
diff --git a/test/trace/mouse-scaled-6.swf.trace b/test/trace/mouse-scaled-6.swf.trace
deleted file mode 100644
index 9ff816c..0000000
--- a/test/trace/mouse-scaled-6.swf.trace
+++ /dev/null
@@ -1,9 +0,0 @@
-Simple check for mouse movements on scaled movie
-500
-5
-500
-5
-1000
-10
-1000
-10
diff --git a/test/trace/mouse-scaled-6.swf.trace.org b/test/trace/mouse-scaled-6.swf.trace.org
deleted file mode 100644
index ed03da3..0000000
--- a/test/trace/mouse-scaled-6.swf.trace.org
+++ /dev/null
@@ -1,9 +0,0 @@
-Simple check for mouse movements on scaled movie
-499.5
-5
-499.5
-5
-999
-10
-999
-10
diff --git a/test/trace/mouse-scaled-7.swf b/test/trace/mouse-scaled-7.swf
deleted file mode 100644
index 329b235..0000000
Binary files a/test/trace/mouse-scaled-7.swf and /dev/null differ
diff --git a/test/trace/mouse-scaled-7.swf.act b/test/trace/mouse-scaled-7.swf.act
deleted file mode 100644
index 83d4379..0000000
--- a/test/trace/mouse-scaled-7.swf.act
+++ /dev/null
@@ -1,9 +0,0 @@
-wait 500
-move 50, 50
-wait 500
-down
-wait 500
-move 100, 100
-wait 500
-up
-wait 1000
diff --git a/test/trace/mouse-scaled-7.swf.trace b/test/trace/mouse-scaled-7.swf.trace
deleted file mode 100644
index 9ff816c..0000000
--- a/test/trace/mouse-scaled-7.swf.trace
+++ /dev/null
@@ -1,9 +0,0 @@
-Simple check for mouse movements on scaled movie
-500
-5
-500
-5
-1000
-10
-1000
-10
diff --git a/test/trace/mouse-scaled-7.swf.trace.org b/test/trace/mouse-scaled-7.swf.trace.org
deleted file mode 100644
index ed03da3..0000000
--- a/test/trace/mouse-scaled-7.swf.trace.org
+++ /dev/null
@@ -1,9 +0,0 @@
-Simple check for mouse movements on scaled movie
-499.5
-5
-499.5
-5
-999
-10
-999
-10
diff --git a/test/trace/mouse-scaled.as b/test/trace/mouse-scaled.as
deleted file mode 100644
index ce4d650..0000000
--- a/test/trace/mouse-scaled.as
+++ /dev/null
@@ -1,17 +0,0 @@
-// makeswf -v 7 -s 200x150 -r 1 -o mouse-scaled.swf mouse-scaled.as
-
-trace ("Simple check for mouse movements on scaled movie");
-
-dump = function () {
- trace (_xmouse);
- trace (_ymouse);
-};
-Mouse.addListener ({ onMouseMove: dump, onMouseDown: dump, onMouseUp: dump });
-
-_xscale = 10;
-_yscale = 1000;
-
-function quit () {
- loadMovie ("FSCommand:quit", "");
-};
-setInterval (quit, 3000);
commit 048e6ae14a7eb31a4b1e41168f84fe803fd1f112
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 12:42:45 2008 +0100
add script to execute
diff --git a/test/trace/default.as b/test/trace/default.as
new file mode 100644
index 0000000..3f31797
--- /dev/null
+++ b/test/trace/default.as
@@ -0,0 +1,49 @@
+/* Swfdec
+ * Copyright (C) 2008 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+run_test = function (t, file) {
+ var e;
+ print ("Testing " + file);
+ try {
+ t.reset (file);
+ t.trace (file + ".trace");
+ t.advance (0);
+ t.advance (Math.ceil (10000 / t.rate));
+ t.trace ();
+ } catch (e) {
+ if (e) {
+ error (e);
+ return false;
+ }
+ };
+ Native.print (" OK\n");
+ return true;
+};
+
+filenames.sort ();
+t = new Test ();
+fail = [];
+for (var i = 0; i < filenames.length; i++) {
+ if (!run_test (t, filenames[i]))
+ fail.push (filenames[i]);
+};
+if (fail.length > 0) {
+ error (fail.join ("\n "));
+ throw (fail.length + " failures");
+}
diff --git a/test/trace/default.sts b/test/trace/default.sts
new file mode 100644
index 0000000..5e8dbaa
Binary files /dev/null and b/test/trace/default.sts differ
commit 4d21ccc3c5e15ea5c0cd5f47b54e7ff26af4faf6
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jan 8 12:42:22 2008 +0100
switch trace directory to use the new test interface
diff --git a/test/trace/.gitignore b/test/trace/.gitignore
index 8840a6f..282522d 100644
--- a/test/trace/.gitignore
+++ b/test/trace/.gitignore
@@ -1,12 +1,2 @@
-*~
-CVS
-.cvsignore
-.deps
-.libs
-
Makefile
Makefile.in
-*.o
-
-tmp
-trace
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 6c6e128..4bd6a30 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1,16 +1,5 @@
-check_PROGRAMS = trace
-
-TESTS = $(check_PROGRAMS)
-
-trace_SOURCES = \
- swfdec_interaction.c \
- trace.c
-
-noinst_HEADERS = \
- swfdec_interaction.h
-
-trace_CFLAGS = $(GLOBAL_CFLAGS) $(SWFDEC_CFLAGS) $(CAIRO_CFLAGS)
-trace_LDFLAGS = $(SWFDEC_LIBS) $(CAIRO_LIBS)
+check-local:
+ ../test $(srcdir)/*.swf
EXTRA_DIST = \
README \
@@ -3214,5 +3203,3 @@ EXTRA_DIST = \
xml-socket-properties-8.swf.trace \
xscale.swf \
xscale.swf.trace
-
-glow = tmp
diff --git a/test/trace/swfdec_interaction.c b/test/trace/swfdec_interaction.c
deleted file mode 100644
index cb940b9..0000000
--- a/test/trace/swfdec_interaction.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_interaction.h"
-
-static const GScannerConfig scanner_config = {
- (char *) ",; \t\n",
- (char *) G_CSET_a_2_z G_CSET_A_2_Z,
- (char *) G_CSET_a_2_z G_CSET_A_2_Z,
- (char *) "#\n",
- FALSE,
- FALSE, TRUE, FALSE, TRUE, TRUE, FALSE,
- TRUE, FALSE, FALSE, FALSE, FALSE, FALSE,
- TRUE, TRUE, TRUE, FALSE, FALSE,
- FALSE, TRUE, FALSE, FALSE,
- 0
-};
-
-void
-swfdec_interaction_free (SwfdecInteraction *inter)
-{
- g_return_if_fail (inter != NULL);
-
- g_array_free (inter->commands, TRUE);
- g_free (inter);
-}
-
-void
-swfdec_interaction_reset (SwfdecInteraction *inter)
-{
- g_return_if_fail (inter != NULL);
-
- inter->mouse_x = 0;
- inter->mouse_y = 0;
- inter->mouse_button = 0;
- inter->cur_idx = 0;
- inter->time_elapsed = 0;
-}
-
-static void
-swfdec_interaction_scanner_message (GScanner *scanner, gchar *message, gboolean error)
-{
- if (!error)
- g_printerr ("warning: %s\n", message);
- g_set_error (scanner->user_data, G_FILE_ERROR, G_FILE_ERROR_FAILED, "%s", message);
-}
-
-static void
-swfdec_command_append_mouse (SwfdecInteraction *inter, SwfdecCommandType type, int x, int y, int button)
-{
- SwfdecCommand command;
-
- command.command = type;
- command.args.mouse.x = x;
- command.args.mouse.y = y;
- command.args.mouse.button = button;
- inter->mouse_x = x;
- inter->mouse_y = y;
- inter->mouse_button = button;
- g_array_append_val (inter->commands, command);
-}
-
-static void
-swfdec_command_append_key (SwfdecInteraction *inter, SwfdecKey code, guint ascii, SwfdecCommandType type)
-{
- SwfdecCommand command;
-
- command.command = type;
- command.args.key.code = code;
- command.args.key.ascii = ascii;
- g_array_append_val (inter->commands, command);
-}
-
-static void
-swfdec_command_append_wait (SwfdecInteraction *inter, int msecs)
-{
- SwfdecCommand command;
-
- command.command = SWFDEC_COMMAND_WAIT;
- command.args.time = msecs;
- g_array_append_val (inter->commands, command);
-}
-
-SwfdecInteraction *
-swfdec_interaction_new (const char *data, guint length, GError **error)
-{
- GScanner *scanner;
- GTokenType token;
- SwfdecInteraction *inter;
- int i, j;
-
- g_return_val_if_fail (data != NULL || length == 0, NULL);
-
- /* setup scanner */
- scanner = g_scanner_new (&scanner_config);
- scanner->user_data = error;
- scanner->msg_handler = swfdec_interaction_scanner_message;
- g_scanner_scope_add_symbol (scanner, 0, "wait", GINT_TO_POINTER (SWFDEC_COMMAND_WAIT));
- g_scanner_scope_add_symbol (scanner, 0, "move", GINT_TO_POINTER (SWFDEC_COMMAND_MOVE));
- g_scanner_scope_add_symbol (scanner, 0, "down", GINT_TO_POINTER (SWFDEC_COMMAND_DOWN));
- g_scanner_scope_add_symbol (scanner, 0, "up", GINT_TO_POINTER (SWFDEC_COMMAND_UP));
- g_scanner_scope_add_symbol (scanner, 0, "press", GINT_TO_POINTER (SWFDEC_COMMAND_PRESS));
- g_scanner_scope_add_symbol (scanner, 0, "release", GINT_TO_POINTER (SWFDEC_COMMAND_RELEASE));
- g_scanner_input_text (scanner, data, length);
-
- /* setup inter */
- inter = g_new0 (SwfdecInteraction, 1);
- inter->commands = g_array_new (FALSE, FALSE, sizeof (SwfdecCommand));
-
- while ((token = g_scanner_get_next_token (scanner)) != G_TOKEN_EOF) {
- switch ((SwfdecCommandType)token) {
- case SWFDEC_COMMAND_WAIT:
- token = g_scanner_get_next_token (scanner);
- if (token != G_TOKEN_INT) {
- g_scanner_unexp_token (scanner, G_TOKEN_INT, NULL, NULL, NULL, NULL, TRUE);
- goto error;
- }
- i = scanner->value.v_int;
- swfdec_command_append_wait (inter, i);
- break;
- case SWFDEC_COMMAND_MOVE:
- token = g_scanner_get_next_token (scanner);
- if (token != G_TOKEN_INT) {
- g_scanner_unexp_token (scanner, G_TOKEN_INT, NULL, NULL, NULL, NULL, TRUE);
- goto error;
- }
- i = scanner->value.v_int;
- token = g_scanner_get_next_token (scanner);
- if (token != G_TOKEN_INT) {
- g_scanner_unexp_token (scanner, G_TOKEN_INT, NULL, NULL, NULL, NULL, TRUE);
- goto error;
- }
- j = scanner->value.v_int;
- swfdec_command_append_mouse (inter, SWFDEC_COMMAND_MOVE, i, j, inter->mouse_button);
- break;
- case SWFDEC_COMMAND_DOWN:
- swfdec_command_append_mouse (inter, SWFDEC_COMMAND_DOWN, inter->mouse_x, inter->mouse_y, 1);
- break;
- case SWFDEC_COMMAND_UP:
- swfdec_command_append_mouse (inter, SWFDEC_COMMAND_UP, inter->mouse_x, inter->mouse_y, 1);
- break;
- case SWFDEC_COMMAND_PRESS:
- case SWFDEC_COMMAND_RELEASE:
- j = token;
- token = g_scanner_get_next_token (scanner);
- if (token != G_TOKEN_INT) {
- g_scanner_unexp_token (scanner, G_TOKEN_INT, NULL, NULL, NULL, NULL, TRUE);
- goto error;
- }
- i = scanner->value.v_int;
- if (i >= 256) {
- g_scanner_unexp_token (scanner, G_TOKEN_INT, NULL, NULL, NULL, NULL, TRUE);
- goto error;
- }
- /* FIXME: allow string here and convert first char */
- token = g_scanner_get_next_token (scanner);
- if (token != G_TOKEN_INT) {
- g_scanner_unexp_token (scanner, G_TOKEN_INT, NULL, NULL, NULL, NULL, TRUE);
- goto error;
- }
- swfdec_command_append_key (inter, i, scanner->value.v_int, j);
- break;
- default:
- g_scanner_unexp_token (scanner, SWFDEC_COMMAND_WAIT, NULL, NULL, NULL, NULL, TRUE);
- goto error;
- }
- }
- swfdec_interaction_reset (inter);
- g_scanner_destroy (scanner);
- return inter;
-
-error:
- swfdec_interaction_free (inter);
- g_scanner_destroy (scanner);
- return NULL;
-}
-
-SwfdecInteraction *
-swfdec_interaction_new_from_file (const char *filename, GError **error)
-{
- char *contents;
- gsize length;
- SwfdecInteraction *ret;
-
- g_return_val_if_fail (filename != NULL, NULL);
-
- if (!g_file_get_contents (filename, &contents, &length, error))
- return NULL;
-
- ret = swfdec_interaction_new (contents, length, error);
- g_free (contents);
- return ret;
-}
-
-/* returns time until next event in msecs or -1 if none */
-int
-swfdec_interaction_get_next_event (SwfdecInteraction *inter)
-{
- SwfdecCommand *command;
-
- g_return_val_if_fail (inter != NULL, -1);
-
- if (inter->cur_idx >= inter->commands->len)
- return -1;
- command = &g_array_index (inter->commands, SwfdecCommand, inter->cur_idx);
- if (command->command != SWFDEC_COMMAND_WAIT)
- return 0;
- g_assert (command->args.time > inter->time_elapsed);
- return command->args.time - inter->time_elapsed;
-}
-
-void
-swfdec_interaction_advance (SwfdecInteraction *inter, SwfdecPlayer *player, guint msecs)
-{
- SwfdecCommand *command;
-
- g_return_if_fail (inter != NULL);
-
- inter->time_elapsed += msecs;
- while (inter->cur_idx < inter->commands->len) {
- command = &g_array_index (inter->commands, SwfdecCommand, inter->cur_idx);
- switch (command->command) {
- case SWFDEC_COMMAND_WAIT:
- if (inter->time_elapsed < command->args.time)
- return;
- inter->time_elapsed -= command->args.time;
- break;
- case SWFDEC_COMMAND_MOVE:
- swfdec_player_mouse_move (player, command->args.mouse.x,
- command->args.mouse.y);
- break;
- case SWFDEC_COMMAND_PRESS:
- swfdec_player_key_press (player, command->args.key.code, command->args.key.ascii);
- break;
- case SWFDEC_COMMAND_RELEASE:
- swfdec_player_key_release (player, command->args.key.code, command->args.key.ascii);
- break;
- case SWFDEC_COMMAND_DOWN:
- swfdec_player_mouse_press (player, command->args.mouse.x,
- command->args.mouse.y, command->args.mouse.button);
- break;
- case SWFDEC_COMMAND_UP:
- swfdec_player_mouse_release (player, command->args.mouse.x,
- command->args.mouse.y, command->args.mouse.button);
- break;
- default:
- g_assert_not_reached ();
- return;
- }
- inter->cur_idx++;
- }
-}
-
-guint
-swfdec_interaction_get_duration (SwfdecInteraction *inter)
-{
- guint i, duration;
-
- g_return_val_if_fail (inter != NULL, 0);
-
- duration = 0;
- for (i = 0; i < inter->commands->len; i++) {
- SwfdecCommand *command = &g_array_index (inter->commands, SwfdecCommand, i);
- if (command->command == SWFDEC_COMMAND_WAIT)
- duration += command->args.time;
- }
- return duration;
-}
-
diff --git a/test/trace/swfdec_interaction.h b/test/trace/swfdec_interaction.h
deleted file mode 100644
index 5b627de..0000000
--- a/test/trace/swfdec_interaction.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#include <libswfdec/swfdec.h>
-#include <glib.h>
-
-#ifndef __SWFDEC_INTERACTION_H__
-#define __SWFDEC_INTERACTION_H__
-
-
-typedef enum {
- /* wait (int msecs) */
- SWFDEC_COMMAND_WAIT = G_TOKEN_LAST + 1,
- /* move (int x, int y) */
- SWFDEC_COMMAND_MOVE,
- /* mouse press (void) */
- SWFDEC_COMMAND_DOWN,
- /* mouse release (void) */
- SWFDEC_COMMAND_UP,
- /* key press (int key) */
- SWFDEC_COMMAND_PRESS,
- /* key release (int key) */
- SWFDEC_COMMAND_RELEASE
-} SwfdecCommandType;
-
-typedef struct _SwfdecCommand SwfdecCommand;
-struct _SwfdecCommand {
- SwfdecCommandType command;
- union {
- struct {
- int x;
- int y;
- int button;
- } mouse;
- guint time;
- struct {
- SwfdecKey code;
- guint ascii;
- } key;
- } args;
-};
-
-typedef struct _SwfdecInteraction SwfdecInteraction;
-struct _SwfdecInteraction {
- GArray * commands;
-
- /* current state */
- int mouse_x;
- int mouse_y;
- int mouse_button;
- /* current advancement state */
- guint cur_idx; /* current index into array (can be array->len if done) */
- guint time_elapsed; /* msecs elapsed in current wait event */
-};
-
-SwfdecInteraction * swfdec_interaction_new (const char * data,
- guint length,
- GError ** error);
-SwfdecInteraction * swfdec_interaction_new_from_file (const char * filename,
- GError ** error);
-void swfdec_interaction_free (SwfdecInteraction * inter);
-void swfdec_interaction_reset (SwfdecInteraction * inter);
-
-guint swfdec_interaction_get_duration (SwfdecInteraction * inter);
-int swfdec_interaction_get_next_event (SwfdecInteraction * inter);
-void swfdec_interaction_advance (SwfdecInteraction * inter,
- SwfdecPlayer * player,
- guint msecs);
-
-
-#endif /* __SWFDEC_INTERACTION_H__ */
diff --git a/test/trace/trace.c b/test/trace/trace.c
deleted file mode 100644
index 40f96af..0000000
--- a/test/trace/trace.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libswfdec/swfdec.h>
-#include "swfdec_interaction.h"
-
-typedef struct _Test Test;
-struct _Test {
- char * filename; /* name of the file to be tested */
- char * output; /* test result */
- gboolean success; /* TRUE if test was successful, FALSE on error */
- GMutex * mutex; /* NULL or mutex for protecting output */
- GCond * cond; /* NULL or cond to signal after setting output */
-};
-
-static Test *
-test_new (char *filename)
-{
- Test *test;
-
- test = g_slice_new0 (Test);
- test->filename = filename;
- return test;
-}
-
-static void
-test_free (Test *test)
-{
- g_free (test->filename);
- g_free (test->output);
- g_slice_free (Test, test);
-}
-
-static int
-test_compare (gconstpointer a, gconstpointer b)
-{
- const Test *ta = (const Test *) a;
- const Test *tb = (const Test *) b;
-
- return strcmp (ta->filename, tb->filename);
-}
-
-static void
-trace_cb (SwfdecPlayer *player, const char *message, GString *string)
-{
- g_string_append_printf (string, "%s\n", message);
-}
-
-static void
-fscommand_cb (SwfdecPlayer *player, const char *command, const char *parameter, gpointer data)
-{
- gboolean *quit = data;
-
- if (g_str_equal (command, "quit")) {
- *quit = TRUE;
- }
-}
-
-static void
-initialized_cb (SwfdecPlayer *player, GParamSpec *pspec, gulong *time_left)
-{
- *time_left = ceil (10000 / swfdec_player_get_rate (player));
-}
-
-static void
-run_test (gpointer testp, gpointer unused)
-{
- Test *test = testp;
- SwfdecLoader *loader;
- SwfdecPlayer *player;
- SwfdecBuffer *buffer;
- gulong time_left = G_MAXULONG;
- char *str;
- GString *string, *output;
- GError *error = NULL;
- gboolean quit = FALSE;
- SwfdecInteraction *inter = NULL;
-
- output = g_string_new ("");
- g_string_append_printf (output, "Testing %s:\n", test->filename);
- loader = swfdec_file_loader_new (test->filename);
- if (loader->error) {
- g_string_append_printf (output, " ERROR: %s\n", loader->error);
- goto fail;
- }
- string = g_string_new ("");
- player = swfdec_player_new (NULL);
- g_object_set (player, "memory-until-gc", (gulong) 0, NULL);
- g_signal_connect (player, "trace", G_CALLBACK (trace_cb), string);
- g_signal_connect (player, "fscommand", G_CALLBACK (fscommand_cb), &quit);
- swfdec_player_set_loader (player, loader);
- str = g_strdup_printf ("%s.act", test->filename);
- if (g_file_test (str, G_FILE_TEST_EXISTS)) {
- inter = swfdec_interaction_new_from_file (str, &error);
- if (inter == NULL) {
- g_string_append_printf (output, " ERROR: %s\n", error->message);
- g_object_unref (player);
- g_error_free (error);
- g_free (str);
- goto fail;
- }
- time_left = swfdec_interaction_get_duration (inter);
- } else {
- g_signal_connect (player, "notify::initialized", G_CALLBACK (initialized_cb), &time_left);
- inter = NULL;
- }
- g_free (str);
-
- /* FIXME: Make the number of iterations configurable? */
- while (quit == FALSE) {
- /* FIXME: will not do 10 iterations if there's other stuff loaded */
- glong advance = swfdec_player_get_next_event (player);
-
- if (inter) {
- int t = swfdec_interaction_get_next_event (inter);
- g_assert (t >= 0);
- if (advance < 0)
- advance = t;
- else
- advance = MIN (advance, t);
- }
- if (advance < 0 || (guint) advance > time_left)
- break;
- time_left -= advance;
- swfdec_player_advance (player, advance);
- if (inter) {
- swfdec_interaction_advance (inter, player, advance);
- if (time_left == 0)
- break;
- }
- }
- g_signal_handlers_disconnect_by_func (player, trace_cb, string);
- g_object_unref (player);
-
- str = g_strdup_printf ("%s.trace", test->filename);
- buffer = swfdec_buffer_new_from_file (str, &error);
- if (buffer == NULL) {
- g_string_append_printf (output, " ERROR: %s\n", error->message);
- g_error_free (error);
- g_string_free (string, TRUE);
- g_free (str);
- goto fail;
- }
- if (string->len != buffer->length ||
- memcmp (buffer->data, string->str, buffer->length) != 0) {
- g_string_append (output, " ERROR: unexpected trace output\n");
- if (g_file_set_contents ("tmp", string->str, string->len, NULL)) {
- const char *command[] = { "diff", "-u", str, "tmp", NULL };
- char *result;
- if (!g_spawn_sync (NULL, (char **) command, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
- &result, NULL, NULL, &error)) {
- g_string_append_printf (output,
- " ERROR: Could not spawn diff to compare the results: %s\n",
- error->message);
- g_error_free (error);
- } else {
- g_string_append (output, result);
- g_free (result);
- }
- }
- g_string_free (string, TRUE);
- swfdec_buffer_unref (buffer);
- g_free (str);
- goto fail;
- }
- g_free (str);
- g_string_free (string, TRUE);
- swfdec_buffer_unref (buffer);
- g_string_append (output, " OK\n");
- test->success = TRUE;
-fail:
- if (inter)
- swfdec_interaction_free (inter);
- if (test->mutex)
- g_mutex_lock (test->mutex);
- test->output = g_string_free (output, FALSE);
- if (test->mutex) {
- g_cond_signal (test->cond);
- g_mutex_unlock (test->mutex);
- }
-}
-
-int
-main (int argc, char **argv)
-{
- GList *walk, *tests = NULL;
- GString *failed_tests;
- guint failures = 0;
- GThreadPool *pool;
- GError *error = NULL;
-
- g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
- g_thread_init (NULL);
- /* by default get rid of the loads of warnings the tests produce */
- g_setenv ("SWFDEC_DEBUG", "2", FALSE);
- swfdec_init ();
- failed_tests = g_string_new ("");
-
- /* collect all tests into the tests list */
- if (argc > 1) {
- int i;
- for (i = 1; i < argc; i++) {
- tests = g_list_append (tests, test_new (g_strdup (argv[i])));
- }
- } else {
- GDir *dir;
- char *name;
- const char *path, *file;
- /* automake defines this */
- path = g_getenv ("srcdir");
- if (path == NULL)
- path = ".";
- dir = g_dir_open (path, 0, NULL);
- while ((file = g_dir_read_name (dir))) {
- if (!g_str_has_suffix (file, ".swf"))
- continue;
- name = g_build_filename (path, file, NULL);
- tests = g_list_append (tests, test_new (name));
- }
- g_dir_close (dir);
- }
-
- /* sort the tests by filename */
- tests = g_list_sort (tests, test_compare);
-
- /* run them and put failed ones in failed_tests */
- if (g_getenv ("SWFDEC_TEST_THREADS")) {
- pool = g_thread_pool_new (run_test, NULL, -1, FALSE, &error);
- if (pool == NULL) {
- g_print (" WARNING: Could not start thread pool: %s\n", error->message);
- g_print (" WARNING: testing unthreaded\n");
- g_error_free (error);
- error = NULL;
- }
- } else {
- pool = NULL;
- }
- if (pool == NULL) {
- for (walk = tests; walk; walk = walk->next) {
- Test *test = walk->data;
-
- run_test (test, NULL);
- g_print ("%s", test->output);
- if (!test->success) {
- failures++;
- g_string_append_printf (failed_tests,
- " %s\n", test->filename);
- }
- test_free (test);
- }
- } else {
- GMutex *mutex = g_mutex_new ();
- GCond *cond = g_cond_new ();
- for (walk = tests; walk; walk = walk->next) {
- Test *test = walk->data;
- test->mutex = mutex;
- test->cond = cond;
- g_thread_pool_push (pool, test, &error);
- if (error) {
- /* huh? */
- g_assert_not_reached ();
- g_error_free (error);
- error = NULL;
- }
- }
- g_mutex_lock (mutex);
- for (walk = tests; walk; walk = walk->next) {
- Test *test = walk->data;
- while (test->output == NULL)
- g_cond_wait (cond, mutex);
- g_print ("%s", test->output);
- if (!test->success) {
- failures++;
- g_string_append_printf (failed_tests,
- " %s\n", test->filename);
- }
- test_free (test);
- }
- g_mutex_unlock (mutex);
- g_cond_free (cond);
- g_mutex_free (mutex);
- }
- g_list_free (tests);
-
- /* report failures and exit */
- if (failures > 0) {
- g_print ("\nFAILURES: %u\n", failures);
- g_print ("%s", failed_tests->str);
- g_string_free (failed_tests, TRUE);
- return EXIT_FAILURE;
- } else {
- g_print ("\nEVERYTHING OK\n");
- g_string_free (failed_tests, TRUE);
- return EXIT_SUCCESS;
- }
-}
-
More information about the Swfdec
mailing list