[Swfdec-commits] 28 commits - configure.ac swfdec/swfdec_as_frame.c swfdec/swfdec_as_object.c swfdec/swfdec_as_object.h swfdec/swfdec_as_string.c swfdec/swfdec_as_strings.c swfdec/swfdec_as_super.c swfdec/swfdec_as_types.c swfdec/swfdec_movie.c swfdec/swfdec_net_stream.c swfdec/swfdec_sprite_movie_as.c swfdec/swfdec_video_movie.c test/gnash test/trace
Pekka Lampila
medar at kemper.freedesktop.org
Sun Jul 13 05:14:14 PDT 2008
configure.ac | 2
dev/null |binary
swfdec/swfdec_as_frame.c | 30
swfdec/swfdec_as_object.c | 63
swfdec/swfdec_as_object.h | 3
swfdec/swfdec_as_string.c | 32
swfdec/swfdec_as_strings.c | 5
swfdec/swfdec_as_super.c | 9
swfdec/swfdec_as_types.c | 8
swfdec/swfdec_movie.c | 20
swfdec/swfdec_net_stream.c | 69
swfdec/swfdec_sprite_movie_as.c | 35
swfdec/swfdec_video_movie.c | 55
test/gnash/Makefile.am | 2
test/gnash/actionscript.all/Makefile.am | 9
test/gnash/actionscript.all/String-5.swf |binary
test/gnash/actionscript.all/String-5.swf.trace | 259 ++
test/gnash/actionscript.all/String-6.swf |binary
test/gnash/actionscript.all/String-6.swf.trace | 275 +++
test/gnash/actionscript.all/String-7.swf |binary
test/gnash/actionscript.all/String-7.swf.trace | 275 +++
test/gnash/actionscript.all/String-8.swf |binary
test/gnash/actionscript.all/String-8.swf.trace | 275 +++
test/gnash/actionscript.all/String.as | 905 ++++++++++
test/gnash/actionscript.all/pending/String-5.swf.trace | 259 --
test/gnash/actionscript.all/pending/String-6.swf.trace | 275 ---
test/gnash/actionscript.all/pending/String-7.swf.trace | 275 ---
test/gnash/actionscript.all/pending/String-8.swf.trace | 275 ---
test/gnash/actionscript.all/pending/String.as | 905 ----------
test/gnash/misc-swfc.all/Dejagnu.sc | 183 ++
test/gnash/misc-swfc.all/Dejagnu.sc.original | 183 ++
test/gnash/misc-swfc.all/Makefile.am | 46
test/gnash/misc-swfc.all/README | 19
test/gnash/misc-swfc.all/REMOVED | 3
test/gnash/misc-swfc.all/UPDATED | 1
test/gnash/misc-swfc.all/check.sc | 53
test/gnash/misc-swfc.all/default.stas | 55
test/gnash/misc-swfc.all/default.sts |binary
test/gnash/misc-swfc.all/edittext_test1.sc | 212 ++
test/gnash/misc-swfc.all/edittext_test1.swf |binary
test/gnash/misc-swfc.all/edittext_test1.swf.trace | 47
test/gnash/misc-swfc.all/gotoFrameFromInterval2.sc | 85
test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf |binary
test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf.trace | 23
test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.sc | 47
test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf |binary
test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf.trace | 6
test/gnash/misc-swfc.all/hello.sc | 18
test/gnash/misc-swfc.all/hello.swf |binary
test/gnash/misc-swfc.all/hello.swf.trace | 4
test/gnash/misc-swfc.all/mouse_drag_test.sc | 84
test/gnash/misc-swfc.all/mouse_drag_test.swf |binary
test/gnash/misc-swfc.all/mouse_drag_test.swf.trace | 12
test/gnash/misc-swfc.all/movieclip_destruction_test2.sc | 194 ++
test/gnash/misc-swfc.all/movieclip_destruction_test2.swf |binary
test/gnash/misc-swfc.all/movieclip_destruction_test2.swf.trace | 56
test/gnash/misc-swfc.all/movieclip_destruction_test4.sc | 180 +
test/gnash/misc-swfc.all/movieclip_destruction_test4.swf |binary
test/gnash/misc-swfc.all/movieclip_destruction_test4.swf.trace | 40
test/gnash/misc-swfc.all/opcode_guard_test2.sc | 210 ++
test/gnash/misc-swfc.all/opcode_guard_test2.swf |binary
test/gnash/misc-swfc.all/opcode_guard_test2.swf.trace | 26
test/gnash/misc-swfc.all/pending/action_execution_order_test10.sc | 244 ++
test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf |binary
test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf.trace | 17
test/gnash/misc-swfc.all/pending/action_execution_order_test12.sc | 211 ++
test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf |binary
test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf.trace | 22
test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.sc | 128 +
test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf |binary
test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf.trace | 23
test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.sc | 88
test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf |binary
test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf.trace | 19
test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.sc | 300 +++
test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf |binary
test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf.trace | 53
test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.sc | 148 +
test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf |binary
test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf.trace | 17
test/gnash/misc-swfc.all/registerclass_test3.sc | 168 +
test/gnash/misc-swfc.all/registerclass_test3.swf |binary
test/gnash/misc-swfc.all/registerclass_test3.swf.trace | 27
test/gnash/misc-swfc.all/soft_reference_test1.sc | 171 +
test/gnash/misc-swfc.all/soft_reference_test1.swf |binary
test/gnash/misc-swfc.all/soft_reference_test1.swf.trace | 45
test/gnash/misc-swfc.all/swf4opcode.sc | 213 ++
test/gnash/misc-swfc.all/swf4opcode.sc.original | 212 ++
test/gnash/misc-swfc.all/swf4opcode.swf |binary
test/gnash/misc-swfc.all/swf4opcode.swf.trace | 56
test/gnash/misc-swfmill.all/Makefile.am | 22
test/gnash/misc-swfmill.all/README | 14
test/gnash/misc-swfmill.all/REMOVED | 1
test/gnash/misc-swfmill.all/UPDATED | 1
test/gnash/misc-swfmill.all/default.stas | 54
test/gnash/misc-swfmill.all/default.sts |binary
test/gnash/misc-swfmill.all/dict_override.swf |binary
test/gnash/misc-swfmill.all/dict_override.swf.trace | 2
test/gnash/misc-swfmill.all/dict_override.xml | 155 +
test/gnash/misc-swfmill.all/dict_override.xml.original | 148 +
test/gnash/misc-swfmill.all/hello.swf |binary
test/gnash/misc-swfmill.all/hello.swf.trace | 1
test/gnash/misc-swfmill.all/hello.xml | 52
test/gnash/misc-swfmill.all/hello.xml.original | 45
test/gnash/misc-swfmill.all/initaction_in_definesprite.swf |binary
test/gnash/misc-swfmill.all/initaction_in_definesprite.swf.trace | 2
test/gnash/misc-swfmill.all/initaction_in_definesprite.xml | 107 +
test/gnash/misc-swfmill.all/initaction_in_definesprite.xml.original | 100 +
test/gnash/misc-swfmill.all/pending/jump_after_end.swf |binary
test/gnash/misc-swfmill.all/pending/jump_after_end.swf.trace | 3
test/gnash/misc-swfmill.all/pending/jump_after_end.xml | 84
test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf |binary
test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf.trace | 3
test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml | 321 +++
test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml.original | 314 +++
test/trace/Makefile.am | 62
test/trace/addProperty-with-5.swf.trace | 2
test/trace/addProperty-with-6.swf.trace | 4
test/trace/addProperty-with-7.swf.trace | 4
test/trace/addProperty-with-8.swf.trace | 4
test/trace/addProperty-with.as | 34
test/trace/arguments-properties-5.swf |binary
test/trace/arguments-properties-5.swf.trace | 13
test/trace/arguments-properties-6.swf |binary
test/trace/arguments-properties-6.swf.trace | 13
test/trace/arguments-properties-7.swf |binary
test/trace/arguments-properties-7.swf.trace | 13
test/trace/arguments-properties-8.swf |binary
test/trace/arguments-properties-8.swf.trace | 13
test/trace/arguments-properties.as | 11
test/trace/createEmptyMovieClip-events.sc | 45
test/trace/createEmptyMovieClip-events.swf |binary
test/trace/createEmptyMovieClip-events.swf.trace | 16
test/trace/instance-of-5.swf |binary
test/trace/instance-of-5.swf.trace | 58
test/trace/instance-of-6.swf |binary
test/trace/instance-of-7.swf |binary
test/trace/instance-of-8.swf |binary
test/trace/instance-of.as | 5
test/trace/movieclip-swap-depths-range-5.swf |binary
test/trace/movieclip-swap-depths-range-5.swf.trace | 18
test/trace/movieclip-swap-depths-range-6.swf |binary
test/trace/movieclip-swap-depths-range-6.swf.trace | 18
test/trace/movieclip-swap-depths-range-7.swf |binary
test/trace/movieclip-swap-depths-range-7.swf.trace | 18
test/trace/movieclip-swap-depths-range-8.swf |binary
test/trace/movieclip-swap-depths-range-8.swf.trace | 18
test/trace/movieclip-swap-depths-range.as | 46
test/trace/object-properties-5.swf |binary
test/trace/object-properties-5.swf.trace | 10
test/trace/object-properties-6.swf |binary
test/trace/object-properties-6.swf.trace | 10
test/trace/object-properties-7.swf |binary
test/trace/object-properties-7.swf.trace | 10
test/trace/object-properties-8.swf |binary
test/trace/object-properties-8.swf.trace | 10
test/trace/object-properties.as | 13
test/trace/settarget-remove-5.swf |binary
test/trace/settarget-remove-5.swf.trace | 4
test/trace/settarget-remove-6.swf |binary
test/trace/settarget-remove-6.swf.trace | 4
test/trace/settarget-remove-7.swf |binary
test/trace/settarget-remove-7.swf.trace | 4
test/trace/settarget-remove-8.swf |binary
test/trace/settarget-remove-8.swf.trace | 4
test/trace/settarget-remove.as | 20
test/trace/string-non-ascii-5.swf |binary
test/trace/string-non-ascii-5.swf.trace | 11
test/trace/string-non-ascii-6.swf |binary
test/trace/string-non-ascii-6.swf.trace | 11
test/trace/string-non-ascii-7.swf |binary
test/trace/string-non-ascii-7.swf.trace | 11
test/trace/string-non-ascii-8.swf |binary
test/trace/string-non-ascii-8.swf.trace | 11
test/trace/string-non-ascii.as | 17
test/trace/string-split-empty-5.swf |binary
test/trace/string-split-empty-5.swf.trace | 14
test/trace/string-split-empty-6.swf |binary
test/trace/string-split-empty-6.swf.trace | 14
test/trace/string-split-empty-7.swf |binary
test/trace/string-split-empty-7.swf.trace | 14
test/trace/string-split-empty-8.swf |binary
test/trace/string-split-empty-8.swf.trace | 25
test/trace/string-split-empty.as | 30
test/trace/string-split.as | 2
test/trace/string-valueof-5.swf |binary
test/trace/string-valueof-5.swf.trace | 316 +++
test/trace/string-valueof-6.swf |binary
test/trace/string-valueof-6.swf.trace | 317 +++
test/trace/string-valueof-7.swf |binary
test/trace/string-valueof-7.swf.trace | 317 +++
test/trace/string-valueof-8.swf |binary
test/trace/string-valueof-8.swf.trace | 317 +++
test/trace/string-valueof.as | 31
test/trace/version4-global.sc | 73
test/trace/version4-global.swf |binary
test/trace/version4-global.swf.trace | 65
197 files changed, 9562 insertions(+), 2236 deletions(-)
New commits:
commit 0c294bcff427ee4dc1da296bd7c94cb621f3596f
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Sun Jul 13 15:10:12 2008 +0300
Revert commit 05e56fd252d962f2ed7e522aa7091649110fa53b (get vfunc stuff)
Didn't mean to push that, and it broke netstream-dimensions test
Also reverted the commit that added addProperty-with test:
00a293ad7bc39152ac655c4ad1449daac80aa017
diff --git a/swfdec/swfdec_as_object.c b/swfdec/swfdec_as_object.c
index 6303b19..b2dbb96 100644
--- a/swfdec/swfdec_as_object.c
+++ b/swfdec/swfdec_as_object.c
@@ -237,8 +237,7 @@ swfdec_as_object_variable_enabled_in_version (SwfdecAsVariable *var,
static gboolean
swfdec_as_object_do_get (SwfdecAsObject *object, SwfdecAsObject *orig,
- const char *variable, SwfdecAsValue *val, guint *flags,
- gboolean *ignore_pobject)
+ const char *variable, SwfdecAsValue *val, guint *flags)
{
SwfdecAsVariable *var = swfdec_as_object_hash_lookup (object, variable);
@@ -250,19 +249,14 @@ swfdec_as_object_do_get (SwfdecAsObject *object, SwfdecAsObject *orig,
object->context->version))
return FALSE;
- // only run get function, if we are getting the value
- if (val != NULL) {
- if (var->get) {
- swfdec_as_function_call (var->get, orig, 0, NULL, val);
- swfdec_as_context_run (object->context);
- } else {
- *val = var->value;
- }
+ if (var->get) {
+ swfdec_as_function_call (var->get, orig, 0, NULL, val);
+ swfdec_as_context_run (object->context);
+ *flags = var->flags;
+ } else {
+ *val = var->value;
+ *flags = var->flags;
}
-
- *flags = var->flags;
- *ignore_pobject = var->get != NULL;
-
return TRUE;
}
@@ -939,40 +933,38 @@ swfdec_as_object_get_variable_and_flags (SwfdecAsObject *object,
{
SwfdecAsObjectClass *klass;
guint i;
+ SwfdecAsValue tmp_val;
guint tmp_flags;
SwfdecAsObject *tmp_pobject, *cur;
- gboolean ignore_pobject;
g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
g_return_val_if_fail (variable != NULL, FALSE);
+ if (value == NULL)
+ value = &tmp_val;
if (flags == NULL)
flags = &tmp_flags;
if (pobject == NULL)
pobject = &tmp_pobject;
- *pobject = object;
cur = object;
for (i = 0; i <= SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT && cur != NULL; i++) {
klass = SWFDEC_AS_OBJECT_GET_CLASS (cur);
- if (klass->get (cur, object, variable, value, flags, &ignore_pobject)) {
- if (!ignore_pobject)
- *pobject = cur;
+ if (klass->get (cur, object, variable, value, flags)) {
+ *pobject = cur;
return TRUE;
}
cur = swfdec_as_object_get_prototype_internal (cur);
}
if (i > SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT) {
swfdec_as_context_abort (object->context, "Prototype recursion limit exceeded");
- if (value != NULL)
- SWFDEC_AS_VALUE_SET_UNDEFINED (value);
+ SWFDEC_AS_VALUE_SET_UNDEFINED (value);
*flags = 0;
*pobject = NULL;
return FALSE;
}
//SWFDEC_WARNING ("no such variable %s", variable);
- if (value != NULL)
- SWFDEC_AS_VALUE_SET_UNDEFINED (value);
+ SWFDEC_AS_VALUE_SET_UNDEFINED (value);
*flags = 0;
*pobject = NULL;
return FALSE;
diff --git a/swfdec/swfdec_as_object.h b/swfdec/swfdec_as_object.h
index dc68987..cd84e5d 100644
--- a/swfdec/swfdec_as_object.h
+++ b/swfdec/swfdec_as_object.h
@@ -81,8 +81,7 @@ struct _SwfdecAsObjectClass {
SwfdecAsObject * orig,
const char * variable,
SwfdecAsValue * val,
- guint * flags,
- gboolean * ignore_pobject);
+ guint * flags);
/* set the variable - and return it (or NULL on error) */
void (* set) (SwfdecAsObject * object,
const char * variable,
diff --git a/swfdec/swfdec_as_super.c b/swfdec/swfdec_as_super.c
index 2023467..9e67b40 100644
--- a/swfdec/swfdec_as_super.c
+++ b/swfdec/swfdec_as_super.c
@@ -69,8 +69,7 @@ swfdec_as_super_call (SwfdecAsFunction *function)
static gboolean
swfdec_as_super_get (SwfdecAsObject *object, SwfdecAsObject *orig,
- const char *variable, SwfdecAsValue *val, guint *flags,
- gboolean *ignore_pobject)
+ const char *variable, SwfdecAsValue *val, guint *flags)
{
SwfdecAsSuper *super = SWFDEC_AS_SUPER (object);
SwfdecAsObjectClass *klass;
@@ -85,17 +84,15 @@ swfdec_as_super_get (SwfdecAsObject *object, SwfdecAsObject *orig,
for (i = 0; i <= SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT && cur != NULL; i++) {
klass = SWFDEC_AS_OBJECT_GET_CLASS (cur);
/* FIXME: is the orig pointer correct? */
- if (klass->get (cur, super->object, variable, val, flags, ignore_pobject))
+ if (klass->get (cur, super->object, variable, val, flags))
return TRUE;
/* FIXME: need get_prototype_internal here? */
cur = swfdec_as_object_get_prototype (cur);
}
if (i > SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT)
swfdec_as_context_abort (object->context, "Prototype recursion limit exceeded");
- if (val != NULL)
- SWFDEC_AS_VALUE_SET_UNDEFINED (val);
+ SWFDEC_AS_VALUE_SET_UNDEFINED (val);
*flags = 0;
- *ignore_pobject = FALSE;
return FALSE;
}
diff --git a/swfdec/swfdec_movie.c b/swfdec/swfdec_movie.c
index fde8766..1ac3f7d 100644
--- a/swfdec/swfdec_movie.c
+++ b/swfdec/swfdec_movie.c
@@ -1005,8 +1005,7 @@ swfdec_movie_get_root (SwfdecMovie *movie)
static gboolean
swfdec_movie_get_variable (SwfdecAsObject *object, SwfdecAsObject *orig,
- const char *variable, SwfdecAsValue *val, guint *flags,
- gboolean *ignore_pobject)
+ const char *variable, SwfdecAsValue *val, guint *flags)
{
SwfdecMovie *movie, *ret;
guint prop_id;
@@ -1017,30 +1016,27 @@ swfdec_movie_get_variable (SwfdecAsObject *object, SwfdecAsObject *orig,
return FALSE;
object = SWFDEC_AS_OBJECT (movie);
- if (SWFDEC_AS_OBJECT_CLASS (swfdec_movie_parent_class)->get (object, orig, variable, val, flags, ignore_pobject))
+ if (SWFDEC_AS_OBJECT_CLASS (swfdec_movie_parent_class)->get (object, orig, variable, val, flags))
return TRUE;
- *flags = 0;
- *ignore_pobject = FALSE;
-
/* FIXME: check that this is correct */
if (object->context->version > 5 && variable == SWFDEC_AS_STR__global) {
- if (val != NULL)
- SWFDEC_AS_VALUE_SET_OBJECT (val, SWFDEC_AS_OBJECT (movie->resource->sandbox));
+ SWFDEC_AS_VALUE_SET_OBJECT (val, SWFDEC_AS_OBJECT (movie->resource->sandbox));
+ *flags = 0;
return TRUE;
}
ret = swfdec_movie_get_by_name (movie, variable, FALSE);
if (ret) {
- if (val != NULL)
- SWFDEC_AS_VALUE_SET_OBJECT (val, SWFDEC_AS_OBJECT (ret));
+ SWFDEC_AS_VALUE_SET_OBJECT (val, SWFDEC_AS_OBJECT (ret));
+ *flags = 0;
return TRUE;
}
prop_id = swfdec_movie_property_lookup (variable);
if (prop_id != G_MAXUINT) {
- if (val != NULL)
- swfdec_movie_property_get (movie, prop_id, val);
+ swfdec_movie_property_get (movie, prop_id, val);
+ *flags = 0;
return TRUE;
}
diff --git a/swfdec/swfdec_net_stream.c b/swfdec/swfdec_net_stream.c
index e72e0c3..3687436 100644
--- a/swfdec/swfdec_net_stream.c
+++ b/swfdec/swfdec_net_stream.c
@@ -464,54 +464,47 @@ swfdec_net_stream_dispose (GObject *object)
static gboolean
swfdec_net_stream_get_variable (SwfdecAsObject *object, SwfdecAsObject *orig,
- const char *variable, SwfdecAsValue *val, guint *flags,
- gboolean *ignore_pobject)
+ const char *variable, SwfdecAsValue *val, guint *flags)
{
SwfdecNetStream *stream;
- if (SWFDEC_AS_OBJECT_CLASS (swfdec_net_stream_parent_class)->get (object, orig, variable, val, flags, ignore_pobject))
+ if (SWFDEC_AS_OBJECT_CLASS (swfdec_net_stream_parent_class)->get (object, orig, variable, val, flags))
return TRUE;
- *flags = 0;
- *ignore_pobject = FALSE;
-
stream = SWFDEC_NET_STREAM (object);
/* FIXME: need case insensitive comparisons? */
if (variable == SWFDEC_AS_STR_time) {
guint msecs;
- if (val != NULL) {
- if (stream->flvdecoder == NULL ||
- !swfdec_flv_decoder_get_video_info (stream->flvdecoder, &msecs, NULL)) {
- SWFDEC_AS_VALUE_SET_INT (val, 0);
- } else {
- if (msecs >= stream->current_time)
- msecs = 0;
- else
- msecs = stream->current_time - msecs;
- SWFDEC_AS_VALUE_SET_NUMBER (val, msecs / 1000.);
- }
+ if (stream->flvdecoder == NULL ||
+ !swfdec_flv_decoder_get_video_info (stream->flvdecoder, &msecs, NULL)) {
+ SWFDEC_AS_VALUE_SET_INT (val, 0);
+ } else {
+ if (msecs >= stream->current_time)
+ msecs = 0;
+ else
+ msecs = stream->current_time - msecs;
+ SWFDEC_AS_VALUE_SET_NUMBER (val, msecs / 1000.);
}
+ *flags = 0;
return TRUE;
} else if (variable == SWFDEC_AS_STR_bytesLoaded) {
- if (val != NULL) {
- if (stream->loader == NULL)
- SWFDEC_AS_VALUE_SET_INT (val, 0);
- else
- SWFDEC_AS_VALUE_SET_NUMBER (val, swfdec_loader_get_loaded (stream->loader));
- }
+ if (stream->loader == NULL)
+ SWFDEC_AS_VALUE_SET_INT (val, 0);
+ else
+ SWFDEC_AS_VALUE_SET_NUMBER (val, swfdec_loader_get_loaded (stream->loader));
+ *flags = 0;
return TRUE;
} else if (variable == SWFDEC_AS_STR_bytesTotal) {
- if (val != NULL) {
- glong bytes;
- if (stream->loader == NULL) {
- bytes = 0;
- } else {
- bytes = swfdec_loader_get_size (stream->loader);
- if (bytes < 0)
- bytes = swfdec_loader_get_loaded (stream->loader);
- }
- SWFDEC_AS_VALUE_SET_NUMBER (val, bytes);
+ glong bytes;
+ if (stream->loader == NULL) {
+ bytes = 0;
+ } else {
+ bytes = swfdec_loader_get_size (stream->loader);
+ if (bytes < 0)
+ bytes = swfdec_loader_get_loaded (stream->loader);
}
+ SWFDEC_AS_VALUE_SET_NUMBER (val, bytes);
+ *flags = 0;
return TRUE;
} else if (variable == SWFDEC_AS_STR_bufferLength) {
SWFDEC_STUB ("Netstream.bufferLength (get)");
diff --git a/swfdec/swfdec_video_movie.c b/swfdec/swfdec_video_movie.c
index d7d409b..897aa8c 100644
--- a/swfdec/swfdec_video_movie.c
+++ b/swfdec/swfdec_video_movie.c
@@ -104,58 +104,43 @@ swfdec_video_movie_set_ratio (SwfdecMovie *movie)
static gboolean
swfdec_video_movie_get_variable (SwfdecAsObject *object, SwfdecAsObject *orig,
- const char *variable, SwfdecAsValue *val, guint *flags,
- gboolean *ignore_pobject)
+ const char *variable, SwfdecAsValue *val, guint *flags)
{
guint version = object->context->version;
SwfdecVideoMovie *video;
- if (SWFDEC_AS_OBJECT_CLASS (swfdec_video_movie_parent_class)->get (
- object, orig, variable, val, flags, ignore_pobject))
- return TRUE;
-
- *flags = 0;
- *ignore_pobject = FALSE;
-
video = SWFDEC_VIDEO_MOVIE (object);
if (swfdec_strcmp (version, variable, SWFDEC_AS_STR_width) == 0) {
- if (val != NULL) {
- guint w;
- if (video->provider) {
- w = swfdec_video_provider_get_width (video->provider);
- } else {
- w = 0;
- }
- SWFDEC_AS_VALUE_SET_INT (val, w);
+ guint w;
+ if (video->provider) {
+ w = swfdec_video_provider_get_width (video->provider);
+ } else {
+ w = 0;
}
+ SWFDEC_AS_VALUE_SET_INT (val, w);
return TRUE;
} else if (swfdec_strcmp (version, variable, SWFDEC_AS_STR_height) == 0) {
- if (val != NULL) {
- guint h;
- if (video->provider) {
- h = swfdec_video_provider_get_height (video->provider);
- } else {
- h = 0;
- }
- SWFDEC_AS_VALUE_SET_INT (val, h);
+ guint h;
+ if (video->provider) {
+ h = swfdec_video_provider_get_height (video->provider);
+ } else {
+ h = 0;
}
+ SWFDEC_AS_VALUE_SET_INT (val, h);
return TRUE;
} else if (swfdec_strcmp (version, variable, SWFDEC_AS_STR_deblocking) == 0) {
- if (val != NULL) {
- SWFDEC_STUB ("Video.deblocking (get)");
- SWFDEC_AS_VALUE_SET_NUMBER (val, 0);
- }
+ SWFDEC_STUB ("Video.deblocking (get)");
+ SWFDEC_AS_VALUE_SET_NUMBER (val, 0);
return TRUE;
} else if (swfdec_strcmp (version, variable, SWFDEC_AS_STR_smoothing) == 0) {
- if (val != NULL) {
- SWFDEC_STUB ("Video.smoothing (get)");
- SWFDEC_AS_VALUE_SET_BOOLEAN (val, FALSE);
- }
+ SWFDEC_STUB ("Video.smoothing (get)");
+ SWFDEC_AS_VALUE_SET_BOOLEAN (val, FALSE);
return TRUE;
+ } else {
+ return SWFDEC_AS_OBJECT_CLASS (swfdec_video_movie_parent_class)->get (
+ object, orig, variable, val, flags);
}
-
- return FALSE;
}
static void
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 9d2ca99..a4beb40 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -84,15 +84,6 @@ EXTRA_DIST = \
addProperty-set-prototypes-7.swf.trace \
addProperty-set-prototypes-8.swf \
addProperty-set-prototypes-8.swf.trace \
- addProperty-with.as \
- addProperty-with-5.swf \
- addProperty-with-5.swf.trace \
- addProperty-with-6.swf \
- addProperty-with-6.swf.trace \
- addProperty-with-7.swf \
- addProperty-with-7.swf.trace \
- addProperty-with-8.swf \
- addProperty-with-8.swf.trace \
and-or-5.swf \
and-or-5.swf.trace \
and-or-6.swf \
diff --git a/test/trace/addProperty-with-5.swf b/test/trace/addProperty-with-5.swf
deleted file mode 100644
index fc0e875..0000000
Binary files a/test/trace/addProperty-with-5.swf and /dev/null differ
diff --git a/test/trace/addProperty-with-5.swf.trace b/test/trace/addProperty-with-5.swf.trace
deleted file mode 100644
index 0c3efcd..0000000
--- a/test/trace/addProperty-with-5.swf.trace
+++ /dev/null
@@ -1,2 +0,0 @@
-Properties with get and set functions in the scope chain
-undefined
diff --git a/test/trace/addProperty-with-6.swf b/test/trace/addProperty-with-6.swf
deleted file mode 100644
index b6b792e..0000000
Binary files a/test/trace/addProperty-with-6.swf and /dev/null differ
diff --git a/test/trace/addProperty-with-6.swf.trace b/test/trace/addProperty-with-6.swf.trace
deleted file mode 100644
index c7ece05..0000000
--- a/test/trace/addProperty-with-6.swf.trace
+++ /dev/null
@@ -1,4 +0,0 @@
-Properties with get and set functions in the scope chain
-set_a: hello1
-set_b: hello2
-undefined
diff --git a/test/trace/addProperty-with-7.swf b/test/trace/addProperty-with-7.swf
deleted file mode 100644
index fb57a91..0000000
Binary files a/test/trace/addProperty-with-7.swf and /dev/null differ
diff --git a/test/trace/addProperty-with-7.swf.trace b/test/trace/addProperty-with-7.swf.trace
deleted file mode 100644
index c7ece05..0000000
--- a/test/trace/addProperty-with-7.swf.trace
+++ /dev/null
@@ -1,4 +0,0 @@
-Properties with get and set functions in the scope chain
-set_a: hello1
-set_b: hello2
-undefined
diff --git a/test/trace/addProperty-with-8.swf b/test/trace/addProperty-with-8.swf
deleted file mode 100644
index af8b5f8..0000000
Binary files a/test/trace/addProperty-with-8.swf and /dev/null differ
diff --git a/test/trace/addProperty-with-8.swf.trace b/test/trace/addProperty-with-8.swf.trace
deleted file mode 100644
index c7ece05..0000000
--- a/test/trace/addProperty-with-8.swf.trace
+++ /dev/null
@@ -1,4 +0,0 @@
-Properties with get and set functions in the scope chain
-set_a: hello1
-set_b: hello2
-undefined
diff --git a/test/trace/addProperty-with.as b/test/trace/addProperty-with.as
deleted file mode 100644
index 3889205..0000000
--- a/test/trace/addProperty-with.as
+++ /dev/null
@@ -1,34 +0,0 @@
-// makeswf -v 7 -r 15 -o addProperty-with.swf addProperty-with.as
-
-trace ("Properties with get and set functions in the scope chain");
-
-function get_a () { trace ("get_a"); return "a"; };
-function set_a () { trace ("set_a: " + arguments); };
-
-function get_b () { trace ("get_b"); return "b"; };
-function set_b () { trace ("set_b: " + arguments); };
-
-function get_c () { trace ("get_c"); return "c"; };
-
-var a = { b: {}, c: {} };
-a.addProperty ("test", get_a, set_a);
-a.b.__proto__ = {};
-a.b.__proto__.addProperty ("test", get_b, set_b);
-with (a) {
- test = "hello1";
- with (b) {
- test = "hello2";
- }
-}
-
-a.c.__proto__.addProperty ("test", get_c, null);
-with (a) {
- with (c) {
- test = "hello3";
- }
-}
-ASSetPropFlags (a.c, "__proto__", 0, 7);
-a.c.__proto__ = null;
-trace (a.c.test);
-
-getURL ("FSCommand:quit", "");
commit c302e8fe99a4821da5e2aefcc57a8f5db40f5718
Merge: 00a293a... 84de359...
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Sun Jul 13 14:30:46 2008 +0300
Merge commit '84de3593281c66118d3fe88a045e63565b44dd96'
commit 84de3593281c66118d3fe88a045e63565b44dd96
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 16:03:53 2008 +0300
Enable small disabled part of instance-of test, since it works now
diff --git a/test/trace/instance-of-5.swf b/test/trace/instance-of-5.swf
index 8efa11e..1ace88d 100644
Binary files a/test/trace/instance-of-5.swf and b/test/trace/instance-of-5.swf differ
diff --git a/test/trace/instance-of-5.swf.trace b/test/trace/instance-of-5.swf.trace
index c10f962..3558d03 100644
--- a/test/trace/instance-of-5.swf.trace
+++ b/test/trace/instance-of-5.swf.trace
@@ -25,32 +25,34 @@
24: MovieClip
25: this
26: TextField
+27: createTextField (...)
- 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
- 0
- 1
- 2 0
- 3
- 4 0
- 5
- 6 0
- 7
- 8 0
- 9 0 7
-10
-11
-12
-13 0
-14 0 12
-15
-16
-17
-18 0
-19 0 17
-20 0 17
-21 0 17
-22 0 17
-23
-24
-25 0 24
-26
+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
+ 0
+ 1
+ 2 0
+ 3
+ 4 0
+ 5
+ 6 0
+ 7
+ 8 0
+ 9 0 7
+10
+11
+12
+13 0
+14 0 12
+15
+16
+17
+18 0
+19 0 17
+20 0 17
+21 0 17
+22 0 17
+23
+24
+25 0 24
+26
+27 0 24
diff --git a/test/trace/instance-of-6.swf b/test/trace/instance-of-6.swf
index c28ea4c..28f434f 100644
Binary files a/test/trace/instance-of-6.swf and b/test/trace/instance-of-6.swf differ
diff --git a/test/trace/instance-of-7.swf b/test/trace/instance-of-7.swf
index 51cd6c3..c704999 100644
Binary files a/test/trace/instance-of-7.swf and b/test/trace/instance-of-7.swf differ
diff --git a/test/trace/instance-of-8.swf b/test/trace/instance-of-8.swf
index e91f063..9fa0644 100644
Binary files a/test/trace/instance-of-8.swf and b/test/trace/instance-of-8.swf differ
diff --git a/test/trace/instance-of.as b/test/trace/instance-of.as
index 436da43..7f88161 100644
--- a/test/trace/instance-of.as
+++ b/test/trace/instance-of.as
@@ -42,10 +42,7 @@ objects.push ({ o: XML, n: "XML" });
objects.push ({ o: MovieClip, n: "MovieClip" });
objects.push ({ o: this, n: "this" });
objects.push ({ o: TextField, n: "TextField" });
-// FIXME
-#if __SWF_VERSION__ > 5
objects.push ({ o: t, n: "createTextField (...)" });
-#endif
for (var i = 0; i < objects.length; i++) {
trace (i + ": " + objects[i].n);
@@ -79,4 +76,4 @@ for (var i = 0; i < objects.length; i++) {
trace (str);
}
-loadMovie ("FSCommand:quit", "");
+getURL ("FSCommand:quit", "");
commit bceccc5fe1e76bdd3ae6adbe082fa7d3be32f61b
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 15:33:44 2008 +0300
Import misc-swfmill.all tests from Gnash
diff --git a/configure.ac b/configure.ac
index 6174d3a..89b47f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,6 +296,7 @@ test/gnash/Makefile
test/gnash/media/Makefile
test/gnash/actionscript.all/Makefile
test/gnash/misc-swfc.all/Makefile
+test/gnash/misc-swfmill.all/Makefile
test/image/Makefile
test/sound/Makefile
test/trace/Makefile
diff --git a/test/gnash/Makefile.am b/test/gnash/Makefile.am
index 6623dcc..44c1e88 100644
--- a/test/gnash/Makefile.am
+++ b/test/gnash/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = actionscript.all media misc-swfc.all
+SUBDIRS = actionscript.all media misc-swfc.all misc-swfmill.all
EXTRA_DIST = \
COPYING \
diff --git a/test/gnash/misc-swfmill.all/Makefile.am b/test/gnash/misc-swfmill.all/Makefile.am
new file mode 100644
index 0000000..9174b5a
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/Makefile.am
@@ -0,0 +1,22 @@
+check-local: ../../swfdec-test
+ ../../swfdec-test --script $(srcdir)/default.sts $(srcdir)/*.swf
+
+EXTRA_DIST = \
+ README \
+ REMOVED \
+ UPDATED \
+ default.stas \
+ default.sts \
+ dict_override.swf \
+ dict_override.swf.trace \
+ dict_override.xml \
+ dict_override.xml.original \
+ hello.swf \
+ hello.swf.trace \
+ hello.xml \
+ hello.xml.original \
+ initaction_in_definesprite.swf \
+ initaction_in_definesprite.swf.trace \
+ initaction_in_definesprite.xml \
+ initaction_in_definesprite.xml.original \
+ Makefile.am
diff --git a/test/gnash/misc-swfmill.all/README b/test/gnash/misc-swfmill.all/README
new file mode 100644
index 0000000..316984b
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/README
@@ -0,0 +1,14 @@
+The .xml files, from Gnash's test suite's directory with same name, have been
+imported here and compiled using the following command line:
+ swfmill xml2swf test.xml test.swf
+
+Most tests have been slightly modified so that they issue fscommand:quit at the
+end. The unmodified version of each .xml file is available as .xml.original
+
+The .xml files that were not imported are listed in REMOVED
+
+Tests that are not working in Swfdec yet are in pending directory and are not
+included in make check
+
+The date when the tests were last imported/updated from Gnash's CVS repository
+can be found from UPDATED
diff --git a/test/gnash/misc-swfmill.all/REMOVED b/test/gnash/misc-swfmill.all/REMOVED
new file mode 100644
index 0000000..9ac3778
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/REMOVED
@@ -0,0 +1 @@
+background.xml Image test
diff --git a/test/gnash/misc-swfmill.all/UPDATED b/test/gnash/misc-swfmill.all/UPDATED
new file mode 100644
index 0000000..c63db71
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/UPDATED
@@ -0,0 +1 @@
+2008-07-10
diff --git a/test/gnash/misc-swfmill.all/default.stas b/test/gnash/misc-swfmill.all/default.stas
new file mode 100644
index 0000000..844990a
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/default.stas
@@ -0,0 +1,54 @@
+/* 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);
+ var expected = Buffer.load (file + ".trace");
+ t.advance (0);
+ t.advance (Math.ceil (10000 / t.rate));
+ var diff = t.trace.diff (expected);
+ if (diff) {
+ error ("different trace output");
+ Native.print (diff);
+ return false;
+ }
+ } 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/gnash/misc-swfmill.all/default.sts b/test/gnash/misc-swfmill.all/default.sts
new file mode 100644
index 0000000..279dcda
Binary files /dev/null and b/test/gnash/misc-swfmill.all/default.sts differ
diff --git a/test/gnash/misc-swfmill.all/dict_override.swf b/test/gnash/misc-swfmill.all/dict_override.swf
new file mode 100644
index 0000000..3239144
Binary files /dev/null and b/test/gnash/misc-swfmill.all/dict_override.swf differ
diff --git a/test/gnash/misc-swfmill.all/dict_override.swf.trace b/test/gnash/misc-swfmill.all/dict_override.swf.trace
new file mode 100644
index 0000000..835e50e
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/dict_override.swf.trace
@@ -0,0 +1,2 @@
+PASSED: overridden dictionary used
+END OF TEST
diff --git a/test/gnash/misc-swfmill.all/dict_override.xml b/test/gnash/misc-swfmill.all/dict_override.xml
new file mode 100644
index 0000000..009ef43
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/dict_override.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+
+ This file test that constants can be overridden by later ActionConstantPool
+
+-->
+
+ <Header framerate="12" frames="1">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+ <tags>
+ <SetBackgroundColor>
+ <color>
+ <Color red="255" green="255" blue="255"/>
+ </color>
+ </SetBackgroundColor>
+ <DoAction>
+ <actions>
+
+ // Declare dict 0:a 1:b
+ <Dictionary>
+ <strings>
+ <String value="a"/>
+ <String value="b"/>
+ </strings>
+ </Dictionary>
+
+ // Push 'result' to stack, will be assigned
+ // concatenation of dict[0],dict[1],dict[0],dict[1]
+ <PushData>
+ <items>
+ <StackString value="result"/>
+ </items>
+ </PushData>
+
+ // Set 'a' to 'A'
+ <PushData>
+ <items>
+ <StackString value="a"/>
+ <StackString value="A"/>
+ </items>
+ </PushData>
+ <SetVariable/>
+
+ // Set 'b' to 'B'
+ <PushData>
+ <items>
+ <StackString value="b"/>
+ <StackString value="B"/>
+ </items>
+ </PushData>
+ <SetVariable/>
+
+ // Get dict[0], expect A
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ </items>
+ </PushData>
+ <GetVariable/> // EXPECT A_value
+
+ // Get dict[1] and add, expect AB
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="1"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/> // EXPECT AB
+
+ // Declare dict 0:b 1:a (OVERRIDE!)
+ <Dictionary>
+ <strings>
+ <String value="b"/>
+ <String value="a"/>
+ </strings>
+ </Dictionary>
+
+ // Get dict[0] and add
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/> // EXPECT ABB
+
+ // Get dict[1] and add
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="1"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/> // EXPECT ABBA
+
+ // Assign all to result
+ <SetVariable/>
+
+ // Verify (here we should print FAILED/PASSED)
+ <PushData>
+ <items>
+ <StackString value="ABBA"/>
+ <StackString value="result"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <EqualTyped/>
+
+ // If true, jump to PASSED tracing
+ <BranchIfTrue byteOffset="49"/>
+
+ // Else, trace FAILED
+ <PushData>
+ <items>
+ <StackString value="FAILED: overridden dictionary not used"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <BranchAlways byteOffset="40"/> // get to end
+
+ // PASSED tracing
+ <PushData>
+ <items>
+ <StackString value="PASSED: overridden dictionary used"/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ // END OF TEST tag
+ <PushData>
+ <items>
+ <StackString value="END OF TEST"/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ <PushData>
+ <items>
+ <StackString value="FSCommand:quit"/>
+ <StackString value=""/>
+ </items>
+ </PushData>
+ <GetURL2 method="0"/>
+ <EndAction/>
+ </actions>
+ </DoAction>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/dict_override.xml.original b/test/gnash/misc-swfmill.all/dict_override.xml.original
new file mode 100644
index 0000000..0c0dd2b
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/dict_override.xml.original
@@ -0,0 +1,148 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+
+ This file test that constants can be overridden by later ActionConstantPool
+
+-->
+
+ <Header framerate="12" frames="1">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+ <tags>
+ <SetBackgroundColor>
+ <color>
+ <Color red="255" green="255" blue="255"/>
+ </color>
+ </SetBackgroundColor>
+ <DoAction>
+ <actions>
+
+ // Declare dict 0:a 1:b
+ <Dictionary>
+ <strings>
+ <String value="a"/>
+ <String value="b"/>
+ </strings>
+ </Dictionary>
+
+ // Push 'result' to stack, will be assigned
+ // concatenation of dict[0],dict[1],dict[0],dict[1]
+ <PushData>
+ <items>
+ <StackString value="result"/>
+ </items>
+ </PushData>
+
+ // Set 'a' to 'A'
+ <PushData>
+ <items>
+ <StackString value="a"/>
+ <StackString value="A"/>
+ </items>
+ </PushData>
+ <SetVariable/>
+
+ // Set 'b' to 'B'
+ <PushData>
+ <items>
+ <StackString value="b"/>
+ <StackString value="B"/>
+ </items>
+ </PushData>
+ <SetVariable/>
+
+ // Get dict[0], expect A
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ </items>
+ </PushData>
+ <GetVariable/> // EXPECT A_value
+
+ // Get dict[1] and add, expect AB
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="1"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/> // EXPECT AB
+
+ // Declare dict 0:b 1:a (OVERRIDE!)
+ <Dictionary>
+ <strings>
+ <String value="b"/>
+ <String value="a"/>
+ </strings>
+ </Dictionary>
+
+ // Get dict[0] and add
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/> // EXPECT ABB
+
+ // Get dict[1] and add
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="1"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <AddTyped/> // EXPECT ABBA
+
+ // Assign all to result
+ <SetVariable/>
+
+ // Verify (here we should print FAILED/PASSED)
+ <PushData>
+ <items>
+ <StackString value="ABBA"/>
+ <StackString value="result"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <EqualTyped/>
+
+ // If true, jump to PASSED tracing
+ <BranchIfTrue byteOffset="49"/>
+
+ // Else, trace FAILED
+ <PushData>
+ <items>
+ <StackString value="FAILED: overridden dictionary not used"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <BranchAlways byteOffset="40"/> // get to end
+
+ // PASSED tracing
+ <PushData>
+ <items>
+ <StackString value="PASSED: overridden dictionary used"/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ // END OF TEST tag
+ <PushData>
+ <items>
+ <StackString value="END OF TEST"/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ <EndAction/>
+ </actions>
+ </DoAction>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/hello.swf b/test/gnash/misc-swfmill.all/hello.swf
new file mode 100644
index 0000000..9f61af7
Binary files /dev/null and b/test/gnash/misc-swfmill.all/hello.swf differ
diff --git a/test/gnash/misc-swfmill.all/hello.swf.trace b/test/gnash/misc-swfmill.all/hello.swf.trace
new file mode 100644
index 0000000..3b18e51
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/hello.swf.trace
@@ -0,0 +1 @@
+hello world
diff --git a/test/gnash/misc-swfmill.all/hello.xml b/test/gnash/misc-swfmill.all/hello.xml
new file mode 100644
index 0000000..5662f95
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/hello.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+Simple source code example for swfmill.
+Build with 'swfmill xml2swf hello.xml hello.swf'.
+When in gnash testsuite, 'make hello.swf' is enough.
+
+TODO:
+ - Find out how to embed the Dejagnu.swf lib
+ - Find out how to call the Dejagnu.swf interfaces
+-->
+
+ <Header width="12800" height="9600" framerate="12" frames="1">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+
+ <tags>
+
+ <background color="#ffffff"/>
+
+ <DoAction>
+ <actions>
+ <Dictionary>
+ <strings>
+ <String value="hello world"/>
+ </strings>
+ </Dictionary>
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <PushData>
+ <items>
+ <StackString value="FSCommand:quit"/>
+ <StackString value=""/>
+ </items>
+ </PushData>
+ <GetURL2 method="0"/>
+ <EndAction/>
+ </actions>
+ </DoAction>
+
+ <ShowFrame/>
+ <End/>
+ </tags>
+
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/hello.xml.original b/test/gnash/misc-swfmill.all/hello.xml.original
new file mode 100644
index 0000000..18c9c0b
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/hello.xml.original
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+Simple source code example for swfmill.
+Build with 'swfmill xml2swf hello.xml hello.swf'.
+When in gnash testsuite, 'make hello.swf' is enough.
+
+TODO:
+ - Find out how to embed the Dejagnu.swf lib
+ - Find out how to call the Dejagnu.swf interfaces
+-->
+
+ <Header width="12800" height="9600" framerate="12" frames="1">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+
+ <tags>
+
+ <background color="#ffffff"/>
+
+ <DoAction>
+ <actions>
+ <Dictionary>
+ <strings>
+ <String value="hello world"/>
+ </strings>
+ </Dictionary>
+ <PushData>
+ <items>
+ <StackDictionaryLookup index="0"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <EndAction/>
+ </actions>
+ </DoAction>
+
+ <ShowFrame/>
+ <End/>
+ </tags>
+
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/initaction_in_definesprite.swf b/test/gnash/misc-swfmill.all/initaction_in_definesprite.swf
new file mode 100644
index 0000000..cb69126
Binary files /dev/null and b/test/gnash/misc-swfmill.all/initaction_in_definesprite.swf differ
diff --git a/test/gnash/misc-swfmill.all/initaction_in_definesprite.swf.trace b/test/gnash/misc-swfmill.all/initaction_in_definesprite.swf.trace
new file mode 100644
index 0000000..9205da8
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/initaction_in_definesprite.swf.trace
@@ -0,0 +1,2 @@
+PASSED: executing init actions defined in sprite2 and targetting sprite1
+END OF TEST
diff --git a/test/gnash/misc-swfmill.all/initaction_in_definesprite.xml b/test/gnash/misc-swfmill.all/initaction_in_definesprite.xml
new file mode 100644
index 0000000..a67176a
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/initaction_in_definesprite.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+ |
+ | This file test that DOINITACTION tag inside a DEFINESPRITE is allowed
+ | and results in the action to be executed only once and only if the
+ | defined sprite is placed.
+ |
+ | Also, this file tests that of multiple DOINITACTION tags referring to
+ | the *same* character only the first executed gets trough, no matter in
+ | which timeline the DOINITACTION tag is.
+ |
+ | Expected output is just an 'END OF TEST' trace.
+ |
+ | The test could be improved a lot but it ain't easy to do AS coding
+ | in swfmill....
+ |
+-->
+ <Header framerate="12" frames="1">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+ <tags>
+
+ <DefineSprite objectID="1" frames="1">
+ <tags>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <DefineSprite objectID="3" frames="1">
+ <tags>
+ <DoInitAction sprite="1">
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="FAILED: init actions targetting sprite 1 executed again (defined in sprite3)"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <EndAction/>
+ </actions>
+ </DoInitAction>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <DefineSprite objectID="2" frames="1">
+ <tags>
+ <DoInitAction sprite="1">
+ <actions>
+ <!-- TODO: automate test for these actions to being only executed once -->
+ <PushData>
+ <items>
+ <StackString value="END OF TEST"/>
+ <StackString value="PASSED: executing init actions defined in sprite2 and targetting sprite1"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <Trace/>
+ <PushData>
+ <items>
+ <StackString value="FSCommand:quit"/>
+ <StackString value=""/>
+ </items>
+ </PushData>
+ <GetURL2 method="0"/>
+ <EndAction/>
+ </actions>
+ </DoInitAction>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Place the sprite2 containing DOINITACTION block
+ | referring to object2
+ -->
+ <PlaceObject2 replace="0" depth="1" objectID="2">
+ </PlaceObject2>
+
+ <!--
+ | Place the sprite2 containing DOINITACTION block
+ | referring to object2 *again* at a different depth.
+ | Init actions won't be executed again
+ -->
+ <PlaceObject2 replace="0" depth="2" objectID="2">
+ </PlaceObject2>
+
+ <!--
+ | Place the sprite3 containing DOINITACTION block
+ | referring to object2, for which init actions where
+ | already executed !
+ -->
+ <PlaceObject2 replace="0" depth="3" objectID="3">
+ </PlaceObject2>
+
+ <ShowFrame/>
+ <End/>
+
+ </tags>
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/initaction_in_definesprite.xml.original b/test/gnash/misc-swfmill.all/initaction_in_definesprite.xml.original
new file mode 100644
index 0000000..7730d44
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/initaction_in_definesprite.xml.original
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+ |
+ | This file test that DOINITACTION tag inside a DEFINESPRITE is allowed
+ | and results in the action to be executed only once and only if the
+ | defined sprite is placed.
+ |
+ | Also, this file tests that of multiple DOINITACTION tags referring to
+ | the *same* character only the first executed gets trough, no matter in
+ | which timeline the DOINITACTION tag is.
+ |
+ | Expected output is just an 'END OF TEST' trace.
+ |
+ | The test could be improved a lot but it ain't easy to do AS coding
+ | in swfmill....
+ |
+-->
+ <Header framerate="12" frames="1">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+ <tags>
+
+ <DefineSprite objectID="1" frames="1">
+ <tags>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <DefineSprite objectID="3" frames="1">
+ <tags>
+ <DoInitAction sprite="1">
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="FAILED: init actions targetting sprite 1 executed again (defined in sprite3)"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <EndAction/>
+ </actions>
+ </DoInitAction>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <DefineSprite objectID="2" frames="1">
+ <tags>
+ <DoInitAction sprite="1">
+ <actions>
+ <!-- TODO: automate test for these actions to being only executed once -->
+ <PushData>
+ <items>
+ <StackString value="END OF TEST"/>
+ <StackString value="PASSED: executing init actions defined in sprite2 and targetting sprite1"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <Trace/>
+ <EndAction/>
+ </actions>
+ </DoInitAction>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Place the sprite2 containing DOINITACTION block
+ | referring to object2
+ -->
+ <PlaceObject2 replace="0" depth="1" objectID="2">
+ </PlaceObject2>
+
+ <!--
+ | Place the sprite2 containing DOINITACTION block
+ | referring to object2 *again* at a different depth.
+ | Init actions won't be executed again
+ -->
+ <PlaceObject2 replace="0" depth="2" objectID="2">
+ </PlaceObject2>
+
+ <!--
+ | Place the sprite3 containing DOINITACTION block
+ | referring to object2, for which init actions where
+ | already executed !
+ -->
+ <PlaceObject2 replace="0" depth="3" objectID="3">
+ </PlaceObject2>
+
+ <ShowFrame/>
+ <End/>
+
+ </tags>
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/pending/jump_after_end.swf b/test/gnash/misc-swfmill.all/pending/jump_after_end.swf
new file mode 100644
index 0000000..472ec73
Binary files /dev/null and b/test/gnash/misc-swfmill.all/pending/jump_after_end.swf differ
diff --git a/test/gnash/misc-swfmill.all/pending/jump_after_end.swf.trace b/test/gnash/misc-swfmill.all/pending/jump_after_end.swf.trace
new file mode 100644
index 0000000..f3c53ab
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/pending/jump_after_end.swf.trace
@@ -0,0 +1,3 @@
+Check if branch after end is allowed
+PASSED: jump after end ALLOWED
+END OF TEST
diff --git a/test/gnash/misc-swfmill.all/pending/jump_after_end.xml b/test/gnash/misc-swfmill.all/pending/jump_after_end.xml
new file mode 100644
index 0000000..bdb2307
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/pending/jump_after_end.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+
+ This file wants to test if branch after END opcode is allowed.
+
+ It is hard to make it self-contained as if the branch fails
+ we'll loose control over the execution so nothing will be
+ traced. Tracing successes is fined.
+
+ The only solution I found was making the test *runner*
+ aware of what signals end of test, and verify the end of test
+ is reached. The "end-of-test" patter is set in the Makefile.am
+ so if you change last trace from this test please update that
+ as well.
+
+ The best way I found to modify this file is to use flasm, edit
+ the code there, then change back to XML and add the END tag when
+ needed (flasm is unable to add END tags in the middle of an action)
+
+-->
+
+ <Header framerate="12" frames="1">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+ <tags>
+ <SetBackgroundColor>
+ <color>
+ <Color red="255" green="255" blue="255"/>
+ </color>
+ </SetBackgroundColor>
+ <DoAction>
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="Check if branch after end is allowed"/>
+ </items>
+ </PushData>
+ <Trace/>
+ <PushData>
+ <items>
+ <StackString value="jumpval"/>
+ <!-- NOTE: we'll never get to trace this in a real failure.. -->
+ <StackString value="FAILED: jump after NOT allowed"/>
+ </items>
+ </PushData>
+ <SetVariable/>
+
+ <!-- NOTE:
+ If the branch fails here (not allowed to jump after END opcode)
+ we'll never get to a FAILED trace. To handle such cases we'll check
+ for a final 'end-of-test' message to be seeked-for by the test
+ runner.
+ -->
+ <BranchAlways byteOffset="29"/> <!-- 16 +13 for the push -->
+
+ <PushData>
+ <items>
+ <StackString value="END OF TEST"/>
+ <StackString value="jumpval"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+ <Trace/>
+ <Trace/>
+ <EndAction/>
+ <PushData>
+ <items>
+ <StackString value="jumpval"/>
+ <StackString value="PASSED: jump after end ALLOWED"/>
+ </items>
+ </PushData>
+ <SetVariable/>
+ <BranchAlways byteOffset="-79"/> <!-- 66 +13 for the push -->
+ <EndAction/>
+ </actions>
+ </DoAction>
+ <ShowFrame/>
+ <End/>
+ </tags>
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf
new file mode 100644
index 0000000..9d95a16
Binary files /dev/null and b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf differ
diff --git a/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf.trace b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf.trace
new file mode 100644
index 0000000..a4c0a38
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.swf.trace
@@ -0,0 +1,3 @@
+a00b11c22d000
+PASSED: got a00b11c22d000
+END OF TEST
diff --git a/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml
new file mode 100644
index 0000000..6d34d2f
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml
@@ -0,0 +1,321 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+ |
+ | Test how a define sprite tags with no SHOWFRAME tags in them are dealt with.
+ | In particular we test that:
+ | - onClipLoad is always invoked even if 0 frames are advertised
+ | - _framesloaded is never less then _totalframes
+ | - _totalframes reflects what's advertised, no matter number of SHOWFRAME
+ |
+ | NOTE: the SWF resulting from this source will be malformed, having
+ | a short tag size count for PlaceObject tags. We'll keep as is
+ | so it tests robustness in addition to the rest..
+ |
+-->
+ <Header framerate="12" frames="2">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+ <tags>
+
+ <!--
+ | Definition of a 0-advertised frames, with NO SHOWFRAME tag
+ -->
+ <DefineSprite objectID="1" frames="0">
+ <tags>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Definition of a 1-advertised frames, with NO SHOWFRAME tag
+ -->
+ <DefineSprite objectID="2" frames="1">
+ <tags>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Definition of a 2-advertised frames, with NO SHOWFRAME tag
+ -->
+ <DefineSprite objectID="3" frames="2">
+ <tags>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Definition of a 0-advertised frames, with NO SHOWFRAME tag
+ | but an action in it
+ -->
+ <DefineSprite objectID="4" frames="0">
+ <tags>
+ <DoAction>
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[movieclip:_root],[string:summary] -->
+ <GetMember/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22] -->
+ <PushData>
+ <items>
+ <StackString value="d"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d],[string:_framesloaded] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d0] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d0],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d0],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d00] -->
+ <PushData>
+ <items>
+ <StackString value="_currentframe"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d00],[string:_currentframe] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d00],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d000] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22d000] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </DoAction>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Place the zero-frames no-showframe sprite
+ -->
+ <PlaceObject2 replace="0" depth="1" objectID="1" name="zero_zero" allflags1="1" allflags2="0">
+ <events>
+ <Event flags1="1" flags2="0"> <!-- onClipLoad -->
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData>
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="a"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData>
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a0] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a0],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a0],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="0" flags2="0"/>
+ </events>
+ </PlaceObject2>
+
+ <!--
+ | Place the one-frames no-showframe sprite
+ -->
+ <PlaceObject2 replace="0" depth="2" objectID="2" name="one_zero" allflags1="1" allflags2="0">
+ <events>
+ <Event flags1="1" flags2="0"> <!-- onClipLoad -->
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[movieclip:_root],[string:summary] -->
+ <GetMember/> <!-- [movieclip:_root],[string:summary],[string:a00] -->
+ <PushData>
+ <items>
+ <StackString value="b"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b],[string:_framesloaded] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b],[number:1] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b1] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b1],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b1],[number:1] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b11] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="0" flags2="0"/>
+ </events>
+ </PlaceObject2>
+
+ <!--
+ | Place the two-frames no-showframe sprite
+ -->
+ <PlaceObject2 replace="0" depth="3" objectID="3" name="two_zero" allflags1="1" allflags2="0">
+ <events>
+ <Event flags1="1" flags2="0"> <!-- onClipLoad -->
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[movieclip:_root],[string:summary] -->
+ <GetMember/> <!-- [movieclip:_root],[string:summary],[string:a00b11] -->
+ <PushData>
+ <items>
+ <StackString value="c"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c],[string:_framesloaded] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c],[number:2] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c2] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c2],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c2],[number:2] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c22] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="0" flags2="0"/>
+ </events>
+ </PlaceObject2>
+
+ <!--
+ | Place the zero-frames no-showframe sprite but action tag in it
+ -->
+ <PlaceObject2 replace="0" depth="4" objectID="4" name="zero_zero_doaction" allflags1="0" allflags2="0">
+ </PlaceObject2>
+
+ <!-- Let a frame go by, so actions in object 4 (zero_zero_doaction) are executed before we check here -->
+ <ShowFrame/>
+
+ <DoAction>
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="a00b11c22d000"/>
+ <StackString value="summary"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+
+ <Duplicate/> <!-- .. debugging .. -->
+ <Trace/> <!-- expect a00b11c22d000 -->
+
+ <EqualTyped/>
+
+ // If true, jump to PASSED tracing
+ <BranchIfTrue byteOffset="49"/>
+
+ // Else, trace FAILED
+ <PushData>
+ <items>
+ <!--
+ // NOTE: the number of characters in the next string push
+ // DOES matter in the BranchIfTrue tag above, so keep it constant
+ -->
+ <StackString value="FAILED: expected a00b11c22d000 "/>
+ </items>
+ </PushData>
+ <Trace/>
+ <BranchAlways byteOffset="37"/> // get to end
+
+ // PASSED tracing
+ <PushData>
+ <items>
+ <StackString value="PASSED: got a00b11c22d000 "/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ // END OF TEST tag
+ <PushData>
+ <items>
+ <StackString value="END OF TEST"/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ // don't loop forever..
+ <Stop/>
+
+ <PushData>
+ <items>
+ <StackString value="FSCommand:quit"/>
+ <StackString value=""/>
+ </items>
+ </PushData>
+ <GetURL2 method="0"/>
+ <EndAction/>
+ </actions>
+ </DoAction>
+
+ <ShowFrame/>
+
+ <End/>
+
+ </tags>
+ </Header>
+</swf>
diff --git a/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml.original b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml.original
new file mode 100644
index 0000000..a33deff
--- /dev/null
+++ b/test/gnash/misc-swfmill.all/pending/zeroframe_definesprite.xml.original
@@ -0,0 +1,314 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="1">
+
+<!--
+ |
+ | Test how a define sprite tags with no SHOWFRAME tags in them are dealt with.
+ | In particular we test that:
+ | - onClipLoad is always invoked even if 0 frames are advertised
+ | - _framesloaded is never less then _totalframes
+ | - _totalframes reflects what's advertised, no matter number of SHOWFRAME
+ |
+ | NOTE: the SWF resulting from this source will be malformed, having
+ | a short tag size count for PlaceObject tags. We'll keep as is
+ | so it tests robustness in addition to the rest..
+ |
+-->
+ <Header framerate="12" frames="2">
+ <size>
+ <Rectangle left="0" right="12800" top="0" bottom="9600"/>
+ </size>
+ <tags>
+
+ <!--
+ | Definition of a 0-advertised frames, with NO SHOWFRAME tag
+ -->
+ <DefineSprite objectID="1" frames="0">
+ <tags>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Definition of a 1-advertised frames, with NO SHOWFRAME tag
+ -->
+ <DefineSprite objectID="2" frames="1">
+ <tags>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Definition of a 2-advertised frames, with NO SHOWFRAME tag
+ -->
+ <DefineSprite objectID="3" frames="2">
+ <tags>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Definition of a 0-advertised frames, with NO SHOWFRAME tag
+ | but an action in it
+ -->
+ <DefineSprite objectID="4" frames="0">
+ <tags>
+ <DoAction>
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[movieclip:_root],[string:summary] -->
+ <GetMember/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22] -->
+ <PushData>
+ <items>
+ <StackString value="d"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d],[string:_framesloaded] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d0] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d0],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d0],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d00] -->
+ <PushData>
+ <items>
+ <StackString value="_currentframe"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d00],[string:_currentframe] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d00],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22],[string:d000] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22d000] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </DoAction>
+ <End/>
+ </tags>
+ </DefineSprite>
+
+ <!--
+ | Place the zero-frames no-showframe sprite
+ -->
+ <PlaceObject2 replace="0" depth="1" objectID="1" name="zero_zero" allflags1="1" allflags2="0">
+ <events>
+ <Event flags1="1" flags2="0"> <!-- onClipLoad -->
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData>
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="a"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData>
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a0] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a0],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a0],[number:0] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="0" flags2="0"/>
+ </events>
+ </PlaceObject2>
+
+ <!--
+ | Place the one-frames no-showframe sprite
+ -->
+ <PlaceObject2 replace="0" depth="2" objectID="2" name="one_zero" allflags1="1" allflags2="0">
+ <events>
+ <Event flags1="1" flags2="0"> <!-- onClipLoad -->
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[movieclip:_root],[string:summary] -->
+ <GetMember/> <!-- [movieclip:_root],[string:summary],[string:a00] -->
+ <PushData>
+ <items>
+ <StackString value="b"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b],[string:_framesloaded] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b],[number:1] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b1] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b1],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b1],[number:1] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00],[string:b11] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="0" flags2="0"/>
+ </events>
+ </PlaceObject2>
+
+ <!--
+ | Place the two-frames no-showframe sprite
+ -->
+ <PlaceObject2 replace="0" depth="3" objectID="3" name="two_zero" allflags1="1" allflags2="0">
+ <events>
+ <Event flags1="1" flags2="0"> <!-- onClipLoad -->
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ <StackString value="_root"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:_root] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[movieclip:_root] -->
+ <PushData>
+ <items>
+ <StackString value="summary"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[movieclip:_root],[string:summary] -->
+ <GetMember/> <!-- [movieclip:_root],[string:summary],[string:a00b11] -->
+ <PushData>
+ <items>
+ <StackString value="c"/>
+ <StackString value="_framesloaded"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c],[string:_framesloaded] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c],[number:2] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c2] -->
+ <PushData>
+ <items>
+ <StackString value="_totalframes"/>
+ </items>
+ </PushData> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c2],[string:_totalframes] -->
+ <GetVariable/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c2],[number:2] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11],[string:c22] -->
+ <AddTyped/> <!-- [movieclip:_root],[string:summary],[string:a00b11c22] -->
+ <SetMember/> <!-- EMPTY STACK -->
+ <EndAction/>
+ </actions>
+ </Event>
+ <Event flags1="0" flags2="0"/>
+ </events>
+ </PlaceObject2>
+
+ <!--
+ | Place the zero-frames no-showframe sprite but action tag in it
+ -->
+ <PlaceObject2 replace="0" depth="4" objectID="4" name="zero_zero_doaction" allflags1="0" allflags2="0">
+ </PlaceObject2>
+
+ <!-- Let a frame go by, so actions in object 4 (zero_zero_doaction) are executed before we check here -->
+ <ShowFrame/>
+
+ <DoAction>
+ <actions>
+ <PushData>
+ <items>
+ <StackString value="a00b11c22d000"/>
+ <StackString value="summary"/>
+ </items>
+ </PushData>
+ <GetVariable/>
+
+ <Duplicate/> <!-- .. debugging .. -->
+ <Trace/> <!-- expect a00b11c22d000 -->
+
+ <EqualTyped/>
+
+ // If true, jump to PASSED tracing
+ <BranchIfTrue byteOffset="49"/>
+
+ // Else, trace FAILED
+ <PushData>
+ <items>
+ <!--
+ // NOTE: the number of characters in the next string push
+ // DOES matter in the BranchIfTrue tag above, so keep it constant
+ -->
+ <StackString value="FAILED: expected a00b11c22d000 "/>
+ </items>
+ </PushData>
+ <Trace/>
+ <BranchAlways byteOffset="37"/> // get to end
+
+ // PASSED tracing
+ <PushData>
+ <items>
+ <StackString value="PASSED: got a00b11c22d000 "/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ // END OF TEST tag
+ <PushData>
+ <items>
+ <StackString value="END OF TEST"/>
+ </items>
+ </PushData>
+ <Trace/>
+
+ // don't loop forever..
+ <Stop/>
+
+ <EndAction/>
+ </actions>
+ </DoAction>
+
+ <ShowFrame/>
+
+ <End/>
+
+ </tags>
+ </Header>
+</swf>
commit 317b312064dedd4cc61e46b6df5e88e89ac81470
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 14:37:57 2008 +0300
Move soft_reference_test1 Gnash test from pending, it passes now
Also fixed some duplication and wrong ordering in misc-swfc.all/Makefile.am
diff --git a/test/gnash/misc-swfc.all/Makefile.am b/test/gnash/misc-swfc.all/Makefile.am
index dcea8aa..3fffebb 100644
--- a/test/gnash/misc-swfc.all/Makefile.am
+++ b/test/gnash/misc-swfc.all/Makefile.am
@@ -22,11 +22,6 @@ EXTRA_DIST = \
hello.sc \
hello.swf \
hello.swf.trace \
- opcode_guard_test2.sc \
- opcode_guard_test2.swf \
- opcode_guard_test2.swf.trace \
- hello.swf \
- hello.swf.trace \
mouse_drag_test.sc \
mouse_drag_test.swf \
mouse_drag_test.swf.trace \
@@ -36,9 +31,15 @@ EXTRA_DIST = \
movieclip_destruction_test4.sc \
movieclip_destruction_test4.swf \
movieclip_destruction_test4.swf.trace \
+ opcode_guard_test2.sc \
+ opcode_guard_test2.swf \
+ opcode_guard_test2.swf.trace \
registerclass_test3.sc \
registerclass_test3.swf \
registerclass_test3.swf.trace \
+ soft_reference_test1.sc \
+ soft_reference_test1.swf \
+ soft_reference_test1.swf.trace \
swf4opcode.sc \
swf4opcode.sc.original \
swf4opcode.swf \
diff --git a/test/gnash/misc-swfc.all/pending/soft_reference_test1.sc b/test/gnash/misc-swfc.all/pending/soft_reference_test1.sc
deleted file mode 100644
index 47bf694..0000000
--- a/test/gnash/misc-swfc.all/pending/soft_reference_test1.sc
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * Tests about soft reference to sprites.
- *
- * Description:
- * frame1: create an movieclip and rename it;
- * frame3: remove the movieclip;
- * frame5: re-create an movieclip with the original name.
- */
-
-
-.flash bbox=800x600 filename="soft_reference_test1.swf" background=white version=6 fps=12
-
-.frame 1
- .action:
- #include "Dejagnu.sc"
-
- //create a movieclip
- mcRef = this.createEmptyMovieClip("mc", 10);
- check(typeof(mc)=='movieclip');
- check(typeof(mcRef)=='movieclip');
- check(mc == _level0.mc);
- check(mcRef == _level0.mc);
-
- //change the "_name" property
- mc._name = 'changed';
- .end
-
-.frame 3
- .action:
- check(typeof(mc)=='undefined');
- check(typeof(mcRef)=='movieclip');
- check(mc == undefined);
- check(mcRef == _level0.changed);
-
- // remove the created moiveclip in frame1
- changed.removeMovieClip();
- .end
-
-.frame 5
- .action:
- check(typeof(mc) == 'undefined');
- check(typeof(mcRef) == 'movieclip');
- check(mc == undefined);
- check(mcRef.valueOf() == null);
-
- //re-create a movieclip again, mcRef connects to the newly created movieclip
- this.createEmptyMovieClip("mc", 20);
- check(typeof(mc)=='movieclip');
- check(typeof(mcRef)=='movieclip');
- check(mc == _level0.mc);
- // Gnash bug:
- // Target of the sprite mcRef points to changed, so seeking
- // for the new target fails (_level0.changed doesn't exist)
- check(mcRef == _level0.mc);
- .end
-
-.frame 7
- .action:
- // change the instance name again
- mc._name = "changed_again";
-
- check(typeof(changed_again)=='movieclip');
- check(mcRef != _level0.changed_again);
-
- check(mc == undefined);
- check(typeof(mcRef)=='movieclip');
- check(mcRef.valueOf() == null);
-
- // change the instance name back
- mc._name = "mc";
- check(typeof(mc)=='undefined');
- check(mc == undefined);
-
- check(typeof(mcRef)=='movieclip');
- check(mcRef.valueOf() == null);
-
- // Release resources after testing
- delete mc;
- delete mcRef;
- changed_again.removeMovieClip();
- .end
-
-
-// seperate tests in frame9
-.frame 9
- .action:
- _root.createEmptyMovieClip("mc1", 30);
- mc1._name = "mc2";
- mcRef = mc2;
-
- check(typeof(mcRef)=='movieclip');
- check_equals(mcRef.getDepth(), 30);
- check(mcRef == _level0.mc2);
-
- mc2.removeMovieClip();
- _root.createEmptyMovieClip("mc2", 40);
-
- check(typeof(mcRef)=='movieclip');
- // Gnash bug:
- // Target of the sprite pointed to by mcRef is
- // not the one used on creation (_level0.mc1) but the one
- // subsequently changed to by effect of _name assignment: _level0.mc2.
- // Thus, when finding a *new* character (the old one was unloaded)
- // we find the *new* _level0.mc2.
- // Should be fixed in the same way as for the bug exposed in frame 5
- check(mcRef.valueOf() == null)
-
- // release resources after testing
- delete mcRef;
- mc2.removeMovieClip();
- .end
-
-// seperate tests in frame11
-.frame 11
- .action:
- mcContainer = new Array(10);
- i = 0;
- MovieClip.prototype.onConstruct = function ()
- {
- mcContainer[i++] = this;
- note("Constructed "+this+" in depth "+this.getDepth()+" and assigned to mcContainer["+(i-1)+"]");
- };
- _root.createEmptyMovieClip("mc1", 50);
- _root.createEmptyMovieClip("mc1", 51);
- check_equals(mcContainer[0].getDepth(), 50);
- check_equals(mcContainer[1].getDepth(), 51);
- check_equals(mc1.getDepth(), 50);
-
- mc1._name = "mc2"; // char at depth 50 changes name
- mcRef = mc2; // mcRef now points to char at depth 50, and target _level0.mc2
-
- check(typeof(mcRef)=='movieclip');
- check_equals(mcRef.getDepth(), 50);
- check(mcRef == _level0.mc2);
-
- mc2.removeMovieClip();
- _root.createEmptyMovieClip("mc2", 60);
-
- check(typeof(mcRef)=='movieclip');
-
- // Gnash bug:
- // Still the same bug: the ref uses *current* target instead of the one
- // as of creation time.
- check(mcRef == _level0.mc1);
-
- _root.totals(38);
- stop();
- .end
-
-.end
-
diff --git a/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf b/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf
deleted file mode 100644
index 3c24f1b..0000000
Binary files a/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf.trace b/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf.trace
deleted file mode 100644
index cb94bb4..0000000
--- a/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf.trace
+++ /dev/null
@@ -1,45 +0,0 @@
-PASSED: [soft_reference_test1.sc:39]
-PASSED: [soft_reference_test1.sc:40]
-PASSED: [soft_reference_test1.sc:41]
-PASSED: [soft_reference_test1.sc:42]
-PASSED: [soft_reference_test1.sc:50]
-PASSED: [soft_reference_test1.sc:51]
-PASSED: [soft_reference_test1.sc:52]
-PASSED: [soft_reference_test1.sc:53]
-PASSED: [soft_reference_test1.sc:61]
-PASSED: [soft_reference_test1.sc:62]
-PASSED: [soft_reference_test1.sc:63]
-PASSED: [soft_reference_test1.sc:64]
-PASSED: [soft_reference_test1.sc:68]
-PASSED: [soft_reference_test1.sc:69]
-PASSED: [soft_reference_test1.sc:70]
-PASSED: [soft_reference_test1.sc:74]
-PASSED: [soft_reference_test1.sc:82]
-PASSED: [soft_reference_test1.sc:83]
-PASSED: [soft_reference_test1.sc:85]
-PASSED: [soft_reference_test1.sc:86]
-PASSED: [soft_reference_test1.sc:87]
-PASSED: [soft_reference_test1.sc:91]
-PASSED: [soft_reference_test1.sc:92]
-PASSED: [soft_reference_test1.sc:94]
-PASSED: [soft_reference_test1.sc:95]
-PASSED: [soft_reference_test1.sc:111]
-PASSED: mcRef.getDepth() == 30 [soft_reference_test1.sc:112]
-PASSED: [soft_reference_test1.sc:113]
-PASSED: [soft_reference_test1.sc:118]
-PASSED: [soft_reference_test1.sc:126]
-Constructed _level0.mc1 in depth 50 and assigned to mcContainer[0] [soft_reference_test1.sc:141]
-Constructed _level0.mc1 in depth 51 and assigned to mcContainer[1] [soft_reference_test1.sc:141]
-PASSED: mcContainer[0].getDepth() == 50 [soft_reference_test1.sc:145]
-PASSED: mcContainer[1].getDepth() == 51 [soft_reference_test1.sc:146]
-PASSED: mc1.getDepth() == 50 [soft_reference_test1.sc:147]
-PASSED: [soft_reference_test1.sc:152]
-PASSED: mcRef.getDepth() == 50 [soft_reference_test1.sc:153]
-PASSED: [soft_reference_test1.sc:154]
-Constructed _level0.mc2 in depth 60 and assigned to mcContainer[2] [soft_reference_test1.sc:141]
-PASSED: [soft_reference_test1.sc:159]
-PASSED: [soft_reference_test1.sc:164]
-Total tests run: 38 typeof expected: number
-#passed: 38
-#failed: 0
-__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/soft_reference_test1.sc b/test/gnash/misc-swfc.all/soft_reference_test1.sc
new file mode 100644
index 0000000..47bf694
--- /dev/null
+++ b/test/gnash/misc-swfc.all/soft_reference_test1.sc
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Tests about soft reference to sprites.
+ *
+ * Description:
+ * frame1: create an movieclip and rename it;
+ * frame3: remove the movieclip;
+ * frame5: re-create an movieclip with the original name.
+ */
+
+
+.flash bbox=800x600 filename="soft_reference_test1.swf" background=white version=6 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+
+ //create a movieclip
+ mcRef = this.createEmptyMovieClip("mc", 10);
+ check(typeof(mc)=='movieclip');
+ check(typeof(mcRef)=='movieclip');
+ check(mc == _level0.mc);
+ check(mcRef == _level0.mc);
+
+ //change the "_name" property
+ mc._name = 'changed';
+ .end
+
+.frame 3
+ .action:
+ check(typeof(mc)=='undefined');
+ check(typeof(mcRef)=='movieclip');
+ check(mc == undefined);
+ check(mcRef == _level0.changed);
+
+ // remove the created moiveclip in frame1
+ changed.removeMovieClip();
+ .end
+
+.frame 5
+ .action:
+ check(typeof(mc) == 'undefined');
+ check(typeof(mcRef) == 'movieclip');
+ check(mc == undefined);
+ check(mcRef.valueOf() == null);
+
+ //re-create a movieclip again, mcRef connects to the newly created movieclip
+ this.createEmptyMovieClip("mc", 20);
+ check(typeof(mc)=='movieclip');
+ check(typeof(mcRef)=='movieclip');
+ check(mc == _level0.mc);
+ // Gnash bug:
+ // Target of the sprite mcRef points to changed, so seeking
+ // for the new target fails (_level0.changed doesn't exist)
+ check(mcRef == _level0.mc);
+ .end
+
+.frame 7
+ .action:
+ // change the instance name again
+ mc._name = "changed_again";
+
+ check(typeof(changed_again)=='movieclip');
+ check(mcRef != _level0.changed_again);
+
+ check(mc == undefined);
+ check(typeof(mcRef)=='movieclip');
+ check(mcRef.valueOf() == null);
+
+ // change the instance name back
+ mc._name = "mc";
+ check(typeof(mc)=='undefined');
+ check(mc == undefined);
+
+ check(typeof(mcRef)=='movieclip');
+ check(mcRef.valueOf() == null);
+
+ // Release resources after testing
+ delete mc;
+ delete mcRef;
+ changed_again.removeMovieClip();
+ .end
+
+
+// seperate tests in frame9
+.frame 9
+ .action:
+ _root.createEmptyMovieClip("mc1", 30);
+ mc1._name = "mc2";
+ mcRef = mc2;
+
+ check(typeof(mcRef)=='movieclip');
+ check_equals(mcRef.getDepth(), 30);
+ check(mcRef == _level0.mc2);
+
+ mc2.removeMovieClip();
+ _root.createEmptyMovieClip("mc2", 40);
+
+ check(typeof(mcRef)=='movieclip');
+ // Gnash bug:
+ // Target of the sprite pointed to by mcRef is
+ // not the one used on creation (_level0.mc1) but the one
+ // subsequently changed to by effect of _name assignment: _level0.mc2.
+ // Thus, when finding a *new* character (the old one was unloaded)
+ // we find the *new* _level0.mc2.
+ // Should be fixed in the same way as for the bug exposed in frame 5
+ check(mcRef.valueOf() == null)
+
+ // release resources after testing
+ delete mcRef;
+ mc2.removeMovieClip();
+ .end
+
+// seperate tests in frame11
+.frame 11
+ .action:
+ mcContainer = new Array(10);
+ i = 0;
+ MovieClip.prototype.onConstruct = function ()
+ {
+ mcContainer[i++] = this;
+ note("Constructed "+this+" in depth "+this.getDepth()+" and assigned to mcContainer["+(i-1)+"]");
+ };
+ _root.createEmptyMovieClip("mc1", 50);
+ _root.createEmptyMovieClip("mc1", 51);
+ check_equals(mcContainer[0].getDepth(), 50);
+ check_equals(mcContainer[1].getDepth(), 51);
+ check_equals(mc1.getDepth(), 50);
+
+ mc1._name = "mc2"; // char at depth 50 changes name
+ mcRef = mc2; // mcRef now points to char at depth 50, and target _level0.mc2
+
+ check(typeof(mcRef)=='movieclip');
+ check_equals(mcRef.getDepth(), 50);
+ check(mcRef == _level0.mc2);
+
+ mc2.removeMovieClip();
+ _root.createEmptyMovieClip("mc2", 60);
+
+ check(typeof(mcRef)=='movieclip');
+
+ // Gnash bug:
+ // Still the same bug: the ref uses *current* target instead of the one
+ // as of creation time.
+ check(mcRef == _level0.mc1);
+
+ _root.totals(38);
+ stop();
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/soft_reference_test1.swf b/test/gnash/misc-swfc.all/soft_reference_test1.swf
new file mode 100644
index 0000000..3c24f1b
Binary files /dev/null and b/test/gnash/misc-swfc.all/soft_reference_test1.swf differ
diff --git a/test/gnash/misc-swfc.all/soft_reference_test1.swf.trace b/test/gnash/misc-swfc.all/soft_reference_test1.swf.trace
new file mode 100644
index 0000000..cb94bb4
--- /dev/null
+++ b/test/gnash/misc-swfc.all/soft_reference_test1.swf.trace
@@ -0,0 +1,45 @@
+PASSED: [soft_reference_test1.sc:39]
+PASSED: [soft_reference_test1.sc:40]
+PASSED: [soft_reference_test1.sc:41]
+PASSED: [soft_reference_test1.sc:42]
+PASSED: [soft_reference_test1.sc:50]
+PASSED: [soft_reference_test1.sc:51]
+PASSED: [soft_reference_test1.sc:52]
+PASSED: [soft_reference_test1.sc:53]
+PASSED: [soft_reference_test1.sc:61]
+PASSED: [soft_reference_test1.sc:62]
+PASSED: [soft_reference_test1.sc:63]
+PASSED: [soft_reference_test1.sc:64]
+PASSED: [soft_reference_test1.sc:68]
+PASSED: [soft_reference_test1.sc:69]
+PASSED: [soft_reference_test1.sc:70]
+PASSED: [soft_reference_test1.sc:74]
+PASSED: [soft_reference_test1.sc:82]
+PASSED: [soft_reference_test1.sc:83]
+PASSED: [soft_reference_test1.sc:85]
+PASSED: [soft_reference_test1.sc:86]
+PASSED: [soft_reference_test1.sc:87]
+PASSED: [soft_reference_test1.sc:91]
+PASSED: [soft_reference_test1.sc:92]
+PASSED: [soft_reference_test1.sc:94]
+PASSED: [soft_reference_test1.sc:95]
+PASSED: [soft_reference_test1.sc:111]
+PASSED: mcRef.getDepth() == 30 [soft_reference_test1.sc:112]
+PASSED: [soft_reference_test1.sc:113]
+PASSED: [soft_reference_test1.sc:118]
+PASSED: [soft_reference_test1.sc:126]
+Constructed _level0.mc1 in depth 50 and assigned to mcContainer[0] [soft_reference_test1.sc:141]
+Constructed _level0.mc1 in depth 51 and assigned to mcContainer[1] [soft_reference_test1.sc:141]
+PASSED: mcContainer[0].getDepth() == 50 [soft_reference_test1.sc:145]
+PASSED: mcContainer[1].getDepth() == 51 [soft_reference_test1.sc:146]
+PASSED: mc1.getDepth() == 50 [soft_reference_test1.sc:147]
+PASSED: [soft_reference_test1.sc:152]
+PASSED: mcRef.getDepth() == 50 [soft_reference_test1.sc:153]
+PASSED: [soft_reference_test1.sc:154]
+Constructed _level0.mc2 in depth 60 and assigned to mcContainer[2] [soft_reference_test1.sc:141]
+PASSED: [soft_reference_test1.sc:159]
+PASSED: [soft_reference_test1.sc:164]
+Total tests run: 38 typeof expected: number
+#passed: 38
+#failed: 0
+__END_OF_TEST__
commit 6a3a5cc94376fb4763f15a165baa1384cea2c371
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 14:35:58 2008 +0300
Call onConstruct when using createEmptyMovieClip. Add a test
diff --git a/swfdec/swfdec_sprite_movie_as.c b/swfdec/swfdec_sprite_movie_as.c
index 24cd47d..b7e7b27 100644
--- a/swfdec/swfdec_sprite_movie_as.c
+++ b/swfdec/swfdec_sprite_movie_as.c
@@ -656,7 +656,18 @@ swfdec_sprite_movie_createEmptyMovieClip (SwfdecAsContext *cx, SwfdecAsObject *o
if (movie)
swfdec_movie_remove (movie);
movie = swfdec_movie_new (SWFDEC_PLAYER (cx), depth, parent, parent->resource, NULL, name);
- swfdec_movie_initialize (movie);
+
+ if (SWFDEC_IS_SPRITE_MOVIE (movie)) {
+ SwfdecSandbox *sandbox = movie->resource->sandbox;
+ SwfdecActor *actor = SWFDEC_ACTOR (movie);
+ swfdec_sandbox_unuse (sandbox);
+ swfdec_movie_initialize (movie);
+ swfdec_actor_execute (actor, SWFDEC_EVENT_CONSTRUCT, 0);
+ swfdec_sandbox_use (sandbox);
+ } else {
+ swfdec_movie_initialize (movie);
+ }
+
SWFDEC_AS_VALUE_SET_OBJECT (rval, SWFDEC_AS_OBJECT (movie));
}
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 5ca8374..a4beb40 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -923,6 +923,9 @@ EXTRA_DIST = \
crash-0.7.1-uncompressed-half-samples-8.swf \
crash-0.7.1-uncompressed-half-samples-8.swf.trace \
crash-0.7.1-uncompressed-half-samples.xml \
+ createEmptyMovieClip-events.sc \
+ createEmptyMovieClip-events.swf \
+ createEmptyMovieClip-events.swf.trace \
createTextField-returnvalue-5.swf \
createTextField-returnvalue-5.swf.trace \
createTextField-returnvalue-6.swf \
diff --git a/test/trace/createEmptyMovieClip-events.sc b/test/trace/createEmptyMovieClip-events.sc
new file mode 100644
index 0000000..fb871c8
--- /dev/null
+++ b/test/trace/createEmptyMovieClip-events.sc
@@ -0,0 +1,45 @@
+.flash bbox=150x200 filename="createEmptyMovieClip-events.swf" background=white version=8 fps=15
+
+.frame 1
+ .action:
+ MovieClip.prototype.onLoad = function () {
+ trace ("onLoad: " + this);
+ trace ("arguments: " + arguments);
+ trace ("caller: " + arguments.caller);
+ trace ("callee: " + arguments.callee);
+ };
+
+ MovieClip.prototype.onConstruct = function () {
+ trace ("onConstruct: " + this);
+ trace ("arguments: " + arguments);
+ trace ("caller: " + arguments.caller);
+ trace ("callee: " + arguments.callee);
+ };
+
+ TextField.prototype.onLoad = function () {
+ trace ("TextField onLoad");
+ };
+
+ TextField.prototype.onConstruct = function () {
+ trace ("TextField onConstruct");
+ };
+
+ trace ("Creating: a");
+ createEmptyMovieClip ("a", 0);
+
+ trace ("Creating duplicate: b");
+ a.duplicateMovieClip ("b", 1);
+
+ trace ("Creating child: c");
+ a.createEmptyMovieClip ("c", 0);
+
+ trace ("Creating text field: d");
+ createTextField ("d", 2, 0, 0, 100, 100);
+ .end
+
+.frame 15
+ .action:
+ getURL("fscommand:quit", "");
+ .end
+
+.end
diff --git a/test/trace/createEmptyMovieClip-events.swf b/test/trace/createEmptyMovieClip-events.swf
new file mode 100644
index 0000000..f7d2dbe
Binary files /dev/null and b/test/trace/createEmptyMovieClip-events.swf differ
diff --git a/test/trace/createEmptyMovieClip-events.swf.trace b/test/trace/createEmptyMovieClip-events.swf.trace
new file mode 100644
index 0000000..9ce119e
--- /dev/null
+++ b/test/trace/createEmptyMovieClip-events.swf.trace
@@ -0,0 +1,16 @@
+Creating: a
+onConstruct: _level0.a
+arguments:
+caller: null
+callee: [type Function]
+Creating duplicate: b
+Creating child: c
+onConstruct: _level0.a.c
+arguments:
+caller: null
+callee: [type Function]
+Creating text field: d
+onLoad: _level0
+arguments:
+caller: null
+callee: [type Function]
commit 918d5b37fa12d69847c4e7d22be8499aea41938e
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 13:59:49 2008 +0300
Move swf4opcode Gnash test from pending, it passes now
diff --git a/test/gnash/misc-swfc.all/Makefile.am b/test/gnash/misc-swfc.all/Makefile.am
index afe05f5..dcea8aa 100644
--- a/test/gnash/misc-swfc.all/Makefile.am
+++ b/test/gnash/misc-swfc.all/Makefile.am
@@ -38,4 +38,8 @@ EXTRA_DIST = \
movieclip_destruction_test4.swf.trace \
registerclass_test3.sc \
registerclass_test3.swf \
- registerclass_test3.swf.trace
+ registerclass_test3.swf.trace \
+ swf4opcode.sc \
+ swf4opcode.sc.original \
+ swf4opcode.swf \
+ swf4opcode.swf.trace
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.sc b/test/gnash/misc-swfc.all/pending/swf4opcode.sc
deleted file mode 100644
index 316c030..0000000
--- a/test/gnash/misc-swfc.all/pending/swf4opcode.sc
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * test opcodes defined in swf4.
- *
- * Deduction:
- *
- * There is no NaN number in swf4 at all, invalid numbers are converted to 0.
- *
- */
-
-//
-// Dejagnu clip does not work/compile in swf4.
-//
-
-//-------------------------------------------------------------------------------------------
-// Dejagnu-like interface for SWF4
-// TODO: expose in check.as based on OUTPUT_VERSION ?
-//-------------------------------------------------------------------------------------------
-
-#define _INFO_ concat(' [', concat(__FILE__, concat(':', concat(__LINE__,']'))))
-
-#define pass_check(lbl) { trace(concat("PASSED: ", concat(lbl, _INFO_))); }
-#define xpass_check(lbl) { trace(concat("XPASSED: ", concat(lbl, _INFO_))); }
-#define fail_check(lbl) { trace(concat("FAILED: ", concat(lbl, _INFO_))); }
-#define xfail_check(lbl) { trace(concat("XFAILED: ", concat(lbl, _INFO_))); }
-
-
-//
-// Use check_equals(<obtained>, <expected>)
-//
-#define check_equals(obt, exp) \
- if ( obt == exp ) pass_check( concat(#obt, concat(" == ", #exp)) ) \
- else fail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
-
-#define xcheck_equals(obt, exp) \
- if ( obt == exp ) xpass_check( concat(#obt, concat(" == ", #exp)) ) \
- else xfail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
-
-#define check(expr) \
- if ( expr ) pass_check(#expr) \
- else fail_check(#expr)
-
-#define xcheck(expr) \
- if ( expr ) xpass_check(#expr) \
- else xfail_check(#expr)
-
-//-------------------------------------------------------------------------------------------
-
-.flash bbox=800x600 filename="swf4opcode.swf" background=white version=4 fps=12
-
-.frame 1
- .action:
- //
- // test opcode ActionEquals
- //
- testvar = (uninitialized1 == '');
- check_equals(testvar, 1);
- testvar = ('' == uninitialized2);
- check_equals(testvar, 1);
- testvar = ('' == '');
- check_equals(testvar, 1);
- testvar = ('xyz' == 'abc');
- //Ref: http://swishtutor.com
- // both hands are converted to zero
- check_equals(testvar, 1);
- check_equals('xyz', 0);
- check_equals('abc', 0);
- check_equals('xyz', 'xyz');
- check_equals('xyz', 'abc');
-
- // test 'undefined' in swf4
- check_equals(uninitialized2, uninitialized3);
- check_equals(uninitialized2, 0);
- check_equals(undefined, 0);
- check_equals(0, undefined);
- check_equals(undefined, undefined);
-
- // test 'Infinity' in swf4
- // there's no 'Infinity' constant in swf4
- check_equals(Infinity, undefined);
- check_equals(Infinity, Infinity);
- check_equals(Infinity, -Infinity);
-
- // test 'null' in swf4
- // there's no null in swf4
- check_equals(null, undefined);
- check_equals(null, 0);
-
- // test 'NaN' in swf4
- // there's no 'NaN' constant in swf4
- check_equals(NaN, 0);
- .end
-
-
-.frame 2
- .action:
-
- //
- // test convertion to number (and thus bool)
- //
- x = '2/';
- y = '3/';
- // x and y are converted to number 0 before comparision
- check_equals( (x+y), 5 );
- check( y > x );
- neg = !x;
- check(!neg);
- neg = !y;
- check(!neg);
- y = '/';
- check_equals( y, 0 );
- y = ' 4';
- check_equals( y, 4 );
- // This needs to work in all locales
- y = '4.5';
- check_equals( y, 4.5 );
- y = '4,5';
- check_equals( y, 4 );
- // exponent
- y = '4.5e4';
- check_equals( y, 45000 );
- y = '4.5E4';
- check_equals( y, 45000 );
- y = '+4.5e4';
- check_equals( y, 45000 );
- y = '-4.5e4';
- check_equals( y, -45000 );
- y = '4.5e+4';
- check_equals( y, 45000 );
- y = '4.5e-4';
- check_equals( y, 0.00045 );
- y = '-4.5e-4';
- check_equals( y, -0.00045 );
- x = '2e1';
- check_equals(x+1, 21);
- //
- // test ActionLogicalNot (0x12)
- //
- check(!"");
- check(!"a");
- check(!"true");
- check(!"false");
- check("1");
- check(!"0000.000");
- check(!false); // doh !
- check(true); // doh !
- check(!0);
- check(4);
- xcheck(!_root); // undefined ?
- check(!null);
- check(!undefined);
-
- //
- // test ActionLessThan
- //
- x = 'ab';
- y = 'abc';
- // should return 0(false)
- // x and y are converted to number 0 before comparision
- check( ! (x < y) );
- check( ! (x > y) );
- check( x == y );
- check( x == 0);
-
- //
- // test swf4 ActionMultiply, ActionDivide, ActionAdd, ActionSubstract
- //
- x = "abc";
- y = 0;
- z = x * y;
- check_equals(z, 0);
- z = x / 1;
- check_equals(z, 0);
- z = x + 1;
- check_equals(z, 1);
- z = x - 1;
- check_equals(z, -1);
-
- //
- // TODO: add tests for ActionStringEq, ActionStringGreater,
- // ActionStringCompare
- //
- // Question: how to generate the above opcodes?
- .end
-
-
-.frame 3
- .action:
- stop();
- getURL("fscommand:quit", "");
- .end
-
-.end
-
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.sc.original b/test/gnash/misc-swfc.all/pending/swf4opcode.sc.original
deleted file mode 100644
index 23f1a0e..0000000
--- a/test/gnash/misc-swfc.all/pending/swf4opcode.sc.original
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * test opcodes defined in swf4.
- *
- * Deduction:
- *
- * There is no NaN number in swf4 at all, invalid numbers are converted to 0.
- *
- */
-
-//
-// Dejagnu clip does not work/compile in swf4.
-//
-
-//-------------------------------------------------------------------------------------------
-// Dejagnu-like interface for SWF4
-// TODO: expose in check.as based on OUTPUT_VERSION ?
-//-------------------------------------------------------------------------------------------
-
-#define _INFO_ concat(' [', concat(__FILE__, concat(':', concat(__LINE__,']'))))
-
-#define pass_check(lbl) { trace(concat("PASSED: ", concat(lbl, _INFO_))); }
-#define xpass_check(lbl) { trace(concat("XPASSED: ", concat(lbl, _INFO_))); }
-#define fail_check(lbl) { trace(concat("FAILED: ", concat(lbl, _INFO_))); }
-#define xfail_check(lbl) { trace(concat("XFAILED: ", concat(lbl, _INFO_))); }
-
-
-//
-// Use check_equals(<obtained>, <expected>)
-//
-#define check_equals(obt, exp) \
- if ( obt == exp ) pass_check( concat(#obt, concat(" == ", #exp)) ) \
- else fail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
-
-#define xcheck_equals(obt, exp) \
- if ( obt == exp ) xpass_check( concat(#obt, concat(" == ", #exp)) ) \
- else xfail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
-
-#define check(expr) \
- if ( expr ) pass_check(#expr) \
- else fail_check(#expr)
-
-#define xcheck(expr) \
- if ( expr ) xpass_check(#expr) \
- else xfail_check(#expr)
-
-//-------------------------------------------------------------------------------------------
-
-.flash bbox=800x600 filename="swf4opcode.swf" background=white version=4 fps=12
-
-.frame 1
- .action:
- //
- // test opcode ActionEquals
- //
- testvar = (uninitialized1 == '');
- check_equals(testvar, 1);
- testvar = ('' == uninitialized2);
- check_equals(testvar, 1);
- testvar = ('' == '');
- check_equals(testvar, 1);
- testvar = ('xyz' == 'abc');
- //Ref: http://swishtutor.com
- // both hands are converted to zero
- check_equals(testvar, 1);
- check_equals('xyz', 0);
- check_equals('abc', 0);
- check_equals('xyz', 'xyz');
- check_equals('xyz', 'abc');
-
- // test 'undefined' in swf4
- check_equals(uninitialized2, uninitialized3);
- check_equals(uninitialized2, 0);
- check_equals(undefined, 0);
- check_equals(0, undefined);
- check_equals(undefined, undefined);
-
- // test 'Infinity' in swf4
- // there's no 'Infinity' constant in swf4
- check_equals(Infinity, undefined);
- check_equals(Infinity, Infinity);
- check_equals(Infinity, -Infinity);
-
- // test 'null' in swf4
- // there's no null in swf4
- check_equals(null, undefined);
- check_equals(null, 0);
-
- // test 'NaN' in swf4
- // there's no 'NaN' constant in swf4
- check_equals(NaN, 0);
- .end
-
-
-.frame 2
- .action:
-
- //
- // test convertion to number (and thus bool)
- //
- x = '2/';
- y = '3/';
- // x and y are converted to number 0 before comparision
- check_equals( (x+y), 5 );
- check( y > x );
- neg = !x;
- check(!neg);
- neg = !y;
- check(!neg);
- y = '/';
- check_equals( y, 0 );
- y = ' 4';
- check_equals( y, 4 );
- // This needs to work in all locales
- y = '4.5';
- check_equals( y, 4.5 );
- y = '4,5';
- check_equals( y, 4 );
- // exponent
- y = '4.5e4';
- check_equals( y, 45000 );
- y = '4.5E4';
- check_equals( y, 45000 );
- y = '+4.5e4';
- check_equals( y, 45000 );
- y = '-4.5e4';
- check_equals( y, -45000 );
- y = '4.5e+4';
- check_equals( y, 45000 );
- y = '4.5e-4';
- check_equals( y, 0.00045 );
- y = '-4.5e-4';
- check_equals( y, -0.00045 );
- x = '2e1';
- check_equals(x+1, 21);
- //
- // test ActionLogicalNot (0x12)
- //
- check(!"");
- check(!"a");
- check(!"true");
- check(!"false");
- check("1");
- check(!"0000.000");
- check(!false); // doh !
- check(true); // doh !
- check(!0);
- check(4);
- xcheck(!_root); // undefined ?
- check(!null);
- check(!undefined);
-
- //
- // test ActionLessThan
- //
- x = 'ab';
- y = 'abc';
- // should return 0(false)
- // x and y are converted to number 0 before comparision
- check( ! (x < y) );
- check( ! (x > y) );
- check( x == y );
- check( x == 0);
-
- //
- // test swf4 ActionMultiply, ActionDivide, ActionAdd, ActionSubstract
- //
- x = "abc";
- y = 0;
- z = x * y;
- check_equals(z, 0);
- z = x / 1;
- check_equals(z, 0);
- z = x + 1;
- check_equals(z, 1);
- z = x - 1;
- check_equals(z, -1);
-
- //
- // TODO: add tests for ActionStringEq, ActionStringGreater,
- // ActionStringCompare
- //
- // Question: how to generate the above opcodes?
- .end
-
-
-.frame 3
- .action:
- stop();
- .end
-
-.end
-
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.swf b/test/gnash/misc-swfc.all/pending/swf4opcode.swf
deleted file mode 100644
index 031751c..0000000
Binary files a/test/gnash/misc-swfc.all/pending/swf4opcode.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.swf.trace b/test/gnash/misc-swfc.all/pending/swf4opcode.swf.trace
deleted file mode 100644
index a817028..0000000
--- a/test/gnash/misc-swfc.all/pending/swf4opcode.swf.trace
+++ /dev/null
@@ -1,56 +0,0 @@
-PASSED: testvar == 1 [swf4opcode.sc:76]
-PASSED: testvar == 1 [swf4opcode.sc:78]
-PASSED: testvar == 1 [swf4opcode.sc:80]
-PASSED: testvar == 1 [swf4opcode.sc:84]
-PASSED: 'xyz' == 0 [swf4opcode.sc:85]
-PASSED: 'abc' == 0 [swf4opcode.sc:86]
-PASSED: 'xyz' == 'xyz' [swf4opcode.sc:87]
-PASSED: 'xyz' == 'abc' [swf4opcode.sc:88]
-PASSED: uninitialized2 == uninitialized3 [swf4opcode.sc:91]
-PASSED: uninitialized2 == 0 [swf4opcode.sc:92]
-PASSED: undefined == 0 [swf4opcode.sc:93]
-PASSED: 0 == undefined [swf4opcode.sc:94]
-PASSED: undefined == undefined [swf4opcode.sc:95]
-PASSED: Infinity == undefined [swf4opcode.sc:99]
-PASSED: Infinity == Infinity [swf4opcode.sc:100]
-PASSED: Infinity == -Infinity [swf4opcode.sc:101]
-PASSED: null == undefined [swf4opcode.sc:105]
-PASSED: null == 0 [swf4opcode.sc:106]
-PASSED: NaN == 0 [swf4opcode.sc:110]
-PASSED: (x+y) == 5 [swf4opcode.sc:123]
-PASSED: y > x [swf4opcode.sc:124]
-PASSED: !neg [swf4opcode.sc:126]
-PASSED: !neg [swf4opcode.sc:128]
-PASSED: y == 0 [swf4opcode.sc:130]
-PASSED: y == 4 [swf4opcode.sc:132]
-PASSED: y == 4.5 [swf4opcode.sc:135]
-PASSED: y == 4 [swf4opcode.sc:137]
-PASSED: y == 45000 [swf4opcode.sc:140]
-PASSED: y == 45000 [swf4opcode.sc:142]
-PASSED: y == 45000 [swf4opcode.sc:144]
-PASSED: y == -45000 [swf4opcode.sc:146]
-PASSED: y == 45000 [swf4opcode.sc:148]
-PASSED: y == 0.00045 [swf4opcode.sc:150]
-PASSED: y == -0.00045 [swf4opcode.sc:152]
-PASSED: x+1 == 21 [swf4opcode.sc:154]
-PASSED: !"" [swf4opcode.sc:158]
-PASSED: !"a" [swf4opcode.sc:159]
-PASSED: !"true" [swf4opcode.sc:160]
-PASSED: !"false" [swf4opcode.sc:161]
-PASSED: "1" [swf4opcode.sc:162]
-PASSED: !"0000.000" [swf4opcode.sc:163]
-PASSED: !false [swf4opcode.sc:164]
-PASSED: true [swf4opcode.sc:165]
-PASSED: !0 [swf4opcode.sc:166]
-PASSED: 4 [swf4opcode.sc:167]
-XPASSED: !_root [swf4opcode.sc:168]
-PASSED: !null [swf4opcode.sc:169]
-PASSED: !undefined [swf4opcode.sc:170]
-PASSED: ! (x < y) [swf4opcode.sc:179]
-PASSED: ! (x > y) [swf4opcode.sc:180]
-PASSED: x == y [swf4opcode.sc:181]
-PASSED: x == 0 [swf4opcode.sc:182]
-PASSED: z == 0 [swf4opcode.sc:190]
-PASSED: z == 0 [swf4opcode.sc:192]
-PASSED: z == 1 [swf4opcode.sc:194]
-PASSED: z == -1 [swf4opcode.sc:196]
diff --git a/test/gnash/misc-swfc.all/swf4opcode.sc b/test/gnash/misc-swfc.all/swf4opcode.sc
new file mode 100644
index 0000000..316c030
--- /dev/null
+++ b/test/gnash/misc-swfc.all/swf4opcode.sc
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * test opcodes defined in swf4.
+ *
+ * Deduction:
+ *
+ * There is no NaN number in swf4 at all, invalid numbers are converted to 0.
+ *
+ */
+
+//
+// Dejagnu clip does not work/compile in swf4.
+//
+
+//-------------------------------------------------------------------------------------------
+// Dejagnu-like interface for SWF4
+// TODO: expose in check.as based on OUTPUT_VERSION ?
+//-------------------------------------------------------------------------------------------
+
+#define _INFO_ concat(' [', concat(__FILE__, concat(':', concat(__LINE__,']'))))
+
+#define pass_check(lbl) { trace(concat("PASSED: ", concat(lbl, _INFO_))); }
+#define xpass_check(lbl) { trace(concat("XPASSED: ", concat(lbl, _INFO_))); }
+#define fail_check(lbl) { trace(concat("FAILED: ", concat(lbl, _INFO_))); }
+#define xfail_check(lbl) { trace(concat("XFAILED: ", concat(lbl, _INFO_))); }
+
+
+//
+// Use check_equals(<obtained>, <expected>)
+//
+#define check_equals(obt, exp) \
+ if ( obt == exp ) pass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else fail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define xcheck_equals(obt, exp) \
+ if ( obt == exp ) xpass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else xfail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define check(expr) \
+ if ( expr ) pass_check(#expr) \
+ else fail_check(#expr)
+
+#define xcheck(expr) \
+ if ( expr ) xpass_check(#expr) \
+ else xfail_check(#expr)
+
+//-------------------------------------------------------------------------------------------
+
+.flash bbox=800x600 filename="swf4opcode.swf" background=white version=4 fps=12
+
+.frame 1
+ .action:
+ //
+ // test opcode ActionEquals
+ //
+ testvar = (uninitialized1 == '');
+ check_equals(testvar, 1);
+ testvar = ('' == uninitialized2);
+ check_equals(testvar, 1);
+ testvar = ('' == '');
+ check_equals(testvar, 1);
+ testvar = ('xyz' == 'abc');
+ //Ref: http://swishtutor.com
+ // both hands are converted to zero
+ check_equals(testvar, 1);
+ check_equals('xyz', 0);
+ check_equals('abc', 0);
+ check_equals('xyz', 'xyz');
+ check_equals('xyz', 'abc');
+
+ // test 'undefined' in swf4
+ check_equals(uninitialized2, uninitialized3);
+ check_equals(uninitialized2, 0);
+ check_equals(undefined, 0);
+ check_equals(0, undefined);
+ check_equals(undefined, undefined);
+
+ // test 'Infinity' in swf4
+ // there's no 'Infinity' constant in swf4
+ check_equals(Infinity, undefined);
+ check_equals(Infinity, Infinity);
+ check_equals(Infinity, -Infinity);
+
+ // test 'null' in swf4
+ // there's no null in swf4
+ check_equals(null, undefined);
+ check_equals(null, 0);
+
+ // test 'NaN' in swf4
+ // there's no 'NaN' constant in swf4
+ check_equals(NaN, 0);
+ .end
+
+
+.frame 2
+ .action:
+
+ //
+ // test convertion to number (and thus bool)
+ //
+ x = '2/';
+ y = '3/';
+ // x and y are converted to number 0 before comparision
+ check_equals( (x+y), 5 );
+ check( y > x );
+ neg = !x;
+ check(!neg);
+ neg = !y;
+ check(!neg);
+ y = '/';
+ check_equals( y, 0 );
+ y = ' 4';
+ check_equals( y, 4 );
+ // This needs to work in all locales
+ y = '4.5';
+ check_equals( y, 4.5 );
+ y = '4,5';
+ check_equals( y, 4 );
+ // exponent
+ y = '4.5e4';
+ check_equals( y, 45000 );
+ y = '4.5E4';
+ check_equals( y, 45000 );
+ y = '+4.5e4';
+ check_equals( y, 45000 );
+ y = '-4.5e4';
+ check_equals( y, -45000 );
+ y = '4.5e+4';
+ check_equals( y, 45000 );
+ y = '4.5e-4';
+ check_equals( y, 0.00045 );
+ y = '-4.5e-4';
+ check_equals( y, -0.00045 );
+ x = '2e1';
+ check_equals(x+1, 21);
+ //
+ // test ActionLogicalNot (0x12)
+ //
+ check(!"");
+ check(!"a");
+ check(!"true");
+ check(!"false");
+ check("1");
+ check(!"0000.000");
+ check(!false); // doh !
+ check(true); // doh !
+ check(!0);
+ check(4);
+ xcheck(!_root); // undefined ?
+ check(!null);
+ check(!undefined);
+
+ //
+ // test ActionLessThan
+ //
+ x = 'ab';
+ y = 'abc';
+ // should return 0(false)
+ // x and y are converted to number 0 before comparision
+ check( ! (x < y) );
+ check( ! (x > y) );
+ check( x == y );
+ check( x == 0);
+
+ //
+ // test swf4 ActionMultiply, ActionDivide, ActionAdd, ActionSubstract
+ //
+ x = "abc";
+ y = 0;
+ z = x * y;
+ check_equals(z, 0);
+ z = x / 1;
+ check_equals(z, 0);
+ z = x + 1;
+ check_equals(z, 1);
+ z = x - 1;
+ check_equals(z, -1);
+
+ //
+ // TODO: add tests for ActionStringEq, ActionStringGreater,
+ // ActionStringCompare
+ //
+ // Question: how to generate the above opcodes?
+ .end
+
+
+.frame 3
+ .action:
+ stop();
+ getURL("fscommand:quit", "");
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/swf4opcode.sc.original b/test/gnash/misc-swfc.all/swf4opcode.sc.original
new file mode 100644
index 0000000..23f1a0e
--- /dev/null
+++ b/test/gnash/misc-swfc.all/swf4opcode.sc.original
@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * test opcodes defined in swf4.
+ *
+ * Deduction:
+ *
+ * There is no NaN number in swf4 at all, invalid numbers are converted to 0.
+ *
+ */
+
+//
+// Dejagnu clip does not work/compile in swf4.
+//
+
+//-------------------------------------------------------------------------------------------
+// Dejagnu-like interface for SWF4
+// TODO: expose in check.as based on OUTPUT_VERSION ?
+//-------------------------------------------------------------------------------------------
+
+#define _INFO_ concat(' [', concat(__FILE__, concat(':', concat(__LINE__,']'))))
+
+#define pass_check(lbl) { trace(concat("PASSED: ", concat(lbl, _INFO_))); }
+#define xpass_check(lbl) { trace(concat("XPASSED: ", concat(lbl, _INFO_))); }
+#define fail_check(lbl) { trace(concat("FAILED: ", concat(lbl, _INFO_))); }
+#define xfail_check(lbl) { trace(concat("XFAILED: ", concat(lbl, _INFO_))); }
+
+
+//
+// Use check_equals(<obtained>, <expected>)
+//
+#define check_equals(obt, exp) \
+ if ( obt == exp ) pass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else fail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define xcheck_equals(obt, exp) \
+ if ( obt == exp ) xpass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else xfail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define check(expr) \
+ if ( expr ) pass_check(#expr) \
+ else fail_check(#expr)
+
+#define xcheck(expr) \
+ if ( expr ) xpass_check(#expr) \
+ else xfail_check(#expr)
+
+//-------------------------------------------------------------------------------------------
+
+.flash bbox=800x600 filename="swf4opcode.swf" background=white version=4 fps=12
+
+.frame 1
+ .action:
+ //
+ // test opcode ActionEquals
+ //
+ testvar = (uninitialized1 == '');
+ check_equals(testvar, 1);
+ testvar = ('' == uninitialized2);
+ check_equals(testvar, 1);
+ testvar = ('' == '');
+ check_equals(testvar, 1);
+ testvar = ('xyz' == 'abc');
+ //Ref: http://swishtutor.com
+ // both hands are converted to zero
+ check_equals(testvar, 1);
+ check_equals('xyz', 0);
+ check_equals('abc', 0);
+ check_equals('xyz', 'xyz');
+ check_equals('xyz', 'abc');
+
+ // test 'undefined' in swf4
+ check_equals(uninitialized2, uninitialized3);
+ check_equals(uninitialized2, 0);
+ check_equals(undefined, 0);
+ check_equals(0, undefined);
+ check_equals(undefined, undefined);
+
+ // test 'Infinity' in swf4
+ // there's no 'Infinity' constant in swf4
+ check_equals(Infinity, undefined);
+ check_equals(Infinity, Infinity);
+ check_equals(Infinity, -Infinity);
+
+ // test 'null' in swf4
+ // there's no null in swf4
+ check_equals(null, undefined);
+ check_equals(null, 0);
+
+ // test 'NaN' in swf4
+ // there's no 'NaN' constant in swf4
+ check_equals(NaN, 0);
+ .end
+
+
+.frame 2
+ .action:
+
+ //
+ // test convertion to number (and thus bool)
+ //
+ x = '2/';
+ y = '3/';
+ // x and y are converted to number 0 before comparision
+ check_equals( (x+y), 5 );
+ check( y > x );
+ neg = !x;
+ check(!neg);
+ neg = !y;
+ check(!neg);
+ y = '/';
+ check_equals( y, 0 );
+ y = ' 4';
+ check_equals( y, 4 );
+ // This needs to work in all locales
+ y = '4.5';
+ check_equals( y, 4.5 );
+ y = '4,5';
+ check_equals( y, 4 );
+ // exponent
+ y = '4.5e4';
+ check_equals( y, 45000 );
+ y = '4.5E4';
+ check_equals( y, 45000 );
+ y = '+4.5e4';
+ check_equals( y, 45000 );
+ y = '-4.5e4';
+ check_equals( y, -45000 );
+ y = '4.5e+4';
+ check_equals( y, 45000 );
+ y = '4.5e-4';
+ check_equals( y, 0.00045 );
+ y = '-4.5e-4';
+ check_equals( y, -0.00045 );
+ x = '2e1';
+ check_equals(x+1, 21);
+ //
+ // test ActionLogicalNot (0x12)
+ //
+ check(!"");
+ check(!"a");
+ check(!"true");
+ check(!"false");
+ check("1");
+ check(!"0000.000");
+ check(!false); // doh !
+ check(true); // doh !
+ check(!0);
+ check(4);
+ xcheck(!_root); // undefined ?
+ check(!null);
+ check(!undefined);
+
+ //
+ // test ActionLessThan
+ //
+ x = 'ab';
+ y = 'abc';
+ // should return 0(false)
+ // x and y are converted to number 0 before comparision
+ check( ! (x < y) );
+ check( ! (x > y) );
+ check( x == y );
+ check( x == 0);
+
+ //
+ // test swf4 ActionMultiply, ActionDivide, ActionAdd, ActionSubstract
+ //
+ x = "abc";
+ y = 0;
+ z = x * y;
+ check_equals(z, 0);
+ z = x / 1;
+ check_equals(z, 0);
+ z = x + 1;
+ check_equals(z, 1);
+ z = x - 1;
+ check_equals(z, -1);
+
+ //
+ // TODO: add tests for ActionStringEq, ActionStringGreater,
+ // ActionStringCompare
+ //
+ // Question: how to generate the above opcodes?
+ .end
+
+
+.frame 3
+ .action:
+ stop();
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/swf4opcode.swf b/test/gnash/misc-swfc.all/swf4opcode.swf
new file mode 100644
index 0000000..031751c
Binary files /dev/null and b/test/gnash/misc-swfc.all/swf4opcode.swf differ
diff --git a/test/gnash/misc-swfc.all/swf4opcode.swf.trace b/test/gnash/misc-swfc.all/swf4opcode.swf.trace
new file mode 100644
index 0000000..a817028
--- /dev/null
+++ b/test/gnash/misc-swfc.all/swf4opcode.swf.trace
@@ -0,0 +1,56 @@
+PASSED: testvar == 1 [swf4opcode.sc:76]
+PASSED: testvar == 1 [swf4opcode.sc:78]
+PASSED: testvar == 1 [swf4opcode.sc:80]
+PASSED: testvar == 1 [swf4opcode.sc:84]
+PASSED: 'xyz' == 0 [swf4opcode.sc:85]
+PASSED: 'abc' == 0 [swf4opcode.sc:86]
+PASSED: 'xyz' == 'xyz' [swf4opcode.sc:87]
+PASSED: 'xyz' == 'abc' [swf4opcode.sc:88]
+PASSED: uninitialized2 == uninitialized3 [swf4opcode.sc:91]
+PASSED: uninitialized2 == 0 [swf4opcode.sc:92]
+PASSED: undefined == 0 [swf4opcode.sc:93]
+PASSED: 0 == undefined [swf4opcode.sc:94]
+PASSED: undefined == undefined [swf4opcode.sc:95]
+PASSED: Infinity == undefined [swf4opcode.sc:99]
+PASSED: Infinity == Infinity [swf4opcode.sc:100]
+PASSED: Infinity == -Infinity [swf4opcode.sc:101]
+PASSED: null == undefined [swf4opcode.sc:105]
+PASSED: null == 0 [swf4opcode.sc:106]
+PASSED: NaN == 0 [swf4opcode.sc:110]
+PASSED: (x+y) == 5 [swf4opcode.sc:123]
+PASSED: y > x [swf4opcode.sc:124]
+PASSED: !neg [swf4opcode.sc:126]
+PASSED: !neg [swf4opcode.sc:128]
+PASSED: y == 0 [swf4opcode.sc:130]
+PASSED: y == 4 [swf4opcode.sc:132]
+PASSED: y == 4.5 [swf4opcode.sc:135]
+PASSED: y == 4 [swf4opcode.sc:137]
+PASSED: y == 45000 [swf4opcode.sc:140]
+PASSED: y == 45000 [swf4opcode.sc:142]
+PASSED: y == 45000 [swf4opcode.sc:144]
+PASSED: y == -45000 [swf4opcode.sc:146]
+PASSED: y == 45000 [swf4opcode.sc:148]
+PASSED: y == 0.00045 [swf4opcode.sc:150]
+PASSED: y == -0.00045 [swf4opcode.sc:152]
+PASSED: x+1 == 21 [swf4opcode.sc:154]
+PASSED: !"" [swf4opcode.sc:158]
+PASSED: !"a" [swf4opcode.sc:159]
+PASSED: !"true" [swf4opcode.sc:160]
+PASSED: !"false" [swf4opcode.sc:161]
+PASSED: "1" [swf4opcode.sc:162]
+PASSED: !"0000.000" [swf4opcode.sc:163]
+PASSED: !false [swf4opcode.sc:164]
+PASSED: true [swf4opcode.sc:165]
+PASSED: !0 [swf4opcode.sc:166]
+PASSED: 4 [swf4opcode.sc:167]
+XPASSED: !_root [swf4opcode.sc:168]
+PASSED: !null [swf4opcode.sc:169]
+PASSED: !undefined [swf4opcode.sc:170]
+PASSED: ! (x < y) [swf4opcode.sc:179]
+PASSED: ! (x > y) [swf4opcode.sc:180]
+PASSED: x == y [swf4opcode.sc:181]
+PASSED: x == 0 [swf4opcode.sc:182]
+PASSED: z == 0 [swf4opcode.sc:190]
+PASSED: z == 0 [swf4opcode.sc:192]
+PASSED: z == 1 [swf4opcode.sc:194]
+PASSED: z == -1 [swf4opcode.sc:196]
commit 073d296796438893c8bfa8135392da110d4ff939
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 13:58:31 2008 +0300
Add a test to see that no global objects are visible in version 4
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 074d81f..5ca8374 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -4072,6 +4072,9 @@ EXTRA_DIST = \
utf-32-be-bom.txt \
utf-32-le-bom.txt \
values.as \
+ version4-global.sc \
+ version4-global.swf \
+ version4-global.swf.trace \
video.flv \
video-enumerate.c \
video-enumerate.swf \
diff --git a/test/trace/version4-global.sc b/test/trace/version4-global.sc
new file mode 100644
index 0000000..523f89e
--- /dev/null
+++ b/test/trace/version4-global.sc
@@ -0,0 +1,73 @@
+.flash bbox=150x200 filename="version4-global.swf" background=white version=4 fps=15
+
+.frame 1
+ .action:
+ trace (_global);
+ trace (ASSetNative);
+ trace (ASSetNativeAccessor);
+ trace (ASSetPropFlags);
+ trace (ASconstructor);
+ trace (ASnative);
+ trace (Accessibility);
+ trace (Array);
+ trace (AsBroadcaster);
+ trace (AsSetupError);
+ trace (AssetCache);
+ trace (Boolean);
+ trace (Button);
+ trace (Camera);
+ trace (Color);
+ trace (ContextMenu);
+ trace (ContextMenuItem);
+ trace (Date);
+ trace (Error);
+ trace (Function);
+ trace (Infinity);
+ trace (Key);
+ trace (LoadVars);
+ trace (LocalConnection);
+ trace (Math);
+ trace (Microphone);
+ trace (Mouse);
+ trace (MovieClip);
+ trace (MovieClipLoader);
+ trace (NaN);
+ trace (NetConnection);
+ trace (NetStream);
+ trace (Number);
+ trace (Object);
+ trace (PrintJob);
+ trace (RemoteLSOUsage);
+ trace (Selection);
+ trace (SharedObject);
+ trace (Sound);
+ trace (Stage);
+ trace (String);
+ trace (System);
+ trace (TextField);
+ trace (TextFormat);
+ trace (TextSnapshot);
+ trace (Video);
+ trace (XML);
+ trace (XMLNode);
+ trace (XMLSocket);
+ trace (clearInterval);
+ trace (clearTimeout);
+ trace (enableDebugConsole);
+ trace (escape);
+ trace (flash);
+ trace (isFinite);
+ trace (isNaN);
+ trace (o);
+ trace (parseFloat);
+ trace (parseInt);
+ trace (setInterval);
+ trace (setTimeout);
+ trace (showRedrawRegions);
+ trace (textRenderer);
+ trace (unescape);
+ trace (updateAfterEvent);
+ getURL("fscommand:quit", "");
+ .end
+
+.end
diff --git a/test/trace/version4-global.swf b/test/trace/version4-global.swf
new file mode 100644
index 0000000..be3941b
Binary files /dev/null and b/test/trace/version4-global.swf differ
diff --git a/test/trace/version4-global.swf.trace b/test/trace/version4-global.swf.trace
new file mode 100644
index 0000000..cf47267
--- /dev/null
+++ b/test/trace/version4-global.swf.trace
@@ -0,0 +1,65 @@
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
commit 53949a1875bfd0702ad70089a0e9df41fd284f4f
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 13:55:33 2008 +0300
swfdec_as_frame_get_variable: Don't load from global object in version < 4
The more correct fix might be not creating the global object at all
diff --git a/swfdec/swfdec_as_frame.c b/swfdec/swfdec_as_frame.c
index fd19eb1..7f07a46 100644
--- a/swfdec/swfdec_as_frame.c
+++ b/swfdec/swfdec_as_frame.c
@@ -558,10 +558,13 @@ swfdec_as_frame_get_variable_and_flags (SwfdecAsFrame *frame, const char *variab
SwfdecAsValue *value, guint *flags, SwfdecAsObject **pobject)
{
GSList *walk;
+ SwfdecAsContext *cx;
g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
g_return_val_if_fail (variable != NULL, NULL);
+ cx = SWFDEC_AS_OBJECT (frame)->context;
+
for (walk = frame->scope_chain; walk; walk = walk->next) {
if (swfdec_as_object_get_variable_and_flags (walk->data, variable, value,
flags, pobject))
@@ -580,8 +583,9 @@ swfdec_as_frame_get_variable_and_flags (SwfdecAsFrame *frame, const char *variab
return frame->original_target;
}
/* 2) the global object */
- if (swfdec_as_object_get_variable_and_flags (
- SWFDEC_AS_OBJECT (frame)->context->global, variable, value, flags, pobject))
+ /* FIXME: ignored on version 4, but should it never be created instead? */
+ if (cx->version > 4 && swfdec_as_object_get_variable_and_flags (cx->global,
+ variable, value, flags, pobject))
return SWFDEC_AS_OBJECT (frame)->context->global;
return NULL;
commit 1f61665473a82048b234c7552f7b3846a6445d1c
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 12:31:45 2008 +0300
In version 4 give 0 instead of NaN in swfdec_as_value_to_number
Also allow strings to have extra characters behind the numbers in version 4
diff --git a/swfdec/swfdec_as_types.c b/swfdec/swfdec_as_types.c
index 16010df..2500a26 100644
--- a/swfdec/swfdec_as_types.c
+++ b/swfdec/swfdec_as_types.c
@@ -489,7 +489,7 @@ swfdec_as_value_to_number (SwfdecAsContext *context, const SwfdecAsValue *value)
// FIXME: We should most likely copy Tamarin's code here (MathUtils.cpp)
s = SWFDEC_AS_VALUE_GET_STRING (&tmp);
if (s == SWFDEC_AS_STR_EMPTY)
- return NAN;
+ return (context->version >= 5) ? NAN : 0.0;
if (context->version > 5 && s[0] == '0' &&
(s[1] == 'x' || s[1] == 'X')) {
d = g_ascii_strtoll (s + 2, &end, 16);
@@ -498,16 +498,16 @@ swfdec_as_value_to_number (SwfdecAsContext *context, const SwfdecAsValue *value)
d = g_ascii_strtoll (s, &end, 8);
} else {
if (strpbrk (s, "xXiI") != NULL)
- return NAN;
+ return (context->version >= 5) ? NAN : 0.0;
d = g_ascii_strtod (s, &end);
}
- if (*end == '\0')
+ if (*end == '\0' || context->version < 5)
return d == -0.0 ? 0.0 : d;
else
return NAN;
}
case SWFDEC_AS_TYPE_OBJECT:
- return NAN;
+ return (context->version >= 5) ? NAN : 0.0;
case SWFDEC_AS_TYPE_INT:
default:
g_assert_not_reached ();
commit 5e0c2fbe1a3e5bad5a757c8e3fd4117a1acc6d62
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 11:59:31 2008 +0300
Move Gnash's test opcode_guard_test2 from pending, it passes now
diff --git a/test/gnash/misc-swfc.all/Makefile.am b/test/gnash/misc-swfc.all/Makefile.am
index 6090743..afe05f5 100644
--- a/test/gnash/misc-swfc.all/Makefile.am
+++ b/test/gnash/misc-swfc.all/Makefile.am
@@ -22,6 +22,11 @@ EXTRA_DIST = \
hello.sc \
hello.swf \
hello.swf.trace \
+ opcode_guard_test2.sc \
+ opcode_guard_test2.swf \
+ opcode_guard_test2.swf.trace \
+ hello.swf \
+ hello.swf.trace \
mouse_drag_test.sc \
mouse_drag_test.swf \
mouse_drag_test.swf.trace \
diff --git a/test/gnash/misc-swfc.all/opcode_guard_test2.sc b/test/gnash/misc-swfc.all/opcode_guard_test2.sc
new file mode 100644
index 0000000..3257385
--- /dev/null
+++ b/test/gnash/misc-swfc.all/opcode_guard_test2.sc
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * test opcode guard and setTarget
+ */
+
+
+.flash bbox=800x600 filename="opcode_guard_test2.swf" background=white version=6 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+
+.frame 2
+ .sprite mc1 // Define a sprite
+ .frame 2
+ .action:
+ setTarget('/mc1');
+ _root.gotoAndPlay(5);
+ _root.check(false); // shoudn't be executed
+ setTarget('');
+ .end
+ .end
+ .put mc1 // Place mc1
+
+
+.frame 4
+ .del mc1
+
+.frame 5
+ .sprite mc2 // Define mc2
+ .end
+ .put mc2 // Place mc2
+ .action:
+ mc2.duplicateMovieClip('dup1', 10);
+ mc2.duplicateMovieClip('dup2', 20);
+ mc2.duplicateMovieClip('dup3', 30);
+
+ _root.dup3.onUnload = function() {};
+
+ _root.check_equals(typeof(_root.dup1), 'movieclip');
+ _root.check_equals(typeof(_root.dup2), 'movieclip');
+
+ dup1.testVar = 'dup1_var'; //
+ setTarget('dup1');
+ removeMovieClip(_root.dup1);
+ // seems Gnash discarded the following 2 tests, caused by opcode guard with
+ // current target. I think we should use the original target.
+ _root.check_equals(typeof(_root.dup1), 'undefined');
+ _root.check_equals(testVar, undefined);
+ setTarget('');
+
+ dup2.testVar = 'dup2_var';
+ with('dup2'){
+ removeMovieClip(_root.dup2);
+ // seems Gnash discarded the following 2 tests
+ _root.check_equals(typeof(_root.dup2), 'undefined');
+ _root.check_equals(testVar, undefined);
+ }
+
+ dup3.testVar = 'dup3_var'; //
+ setTarget('dup3');
+ removeMovieClip(_root.dup3);
+ // dup3 is unloaded but not destroyed
+ _root.check_equals(typeof(_root.dup3), 'movieclip');
+ _root.check_equals(testVar, 'dup3_var');
+ setTarget('');
+
+ .end
+
+
+.frame 6
+ .sprite mc31
+ .action:
+ setTarget('/mc3/mc32');
+ _root.gotoAndPlay(8); // unload it's parent mc3
+ _root.check(false); // shouldn't be executed
+ setTarget('');
+ .end
+ .end
+ .sprite mc32
+ .end
+ .sprite mc3
+ .put mc31
+ .put mc32
+ .end
+ .put mc3
+
+
+.frame 7
+ .del mc3
+
+.frame 8
+ .sprite mc4
+ .end
+ .sprite mc5
+ .action:
+ setTarget('/mc4');
+ _root.gotoAndPlay(9);
+ _root.testvar = true; // should be executed
+ setTarget('');
+ .end
+ .end
+ .put mc4
+ .put mc5
+
+.frame 9
+ .del mc4
+
+.frame 10
+ .action:
+ _root.xcheck_equals(testvar, true);
+ .end
+
+//
+// separate tests for setTargetExpression
+//
+.frame 12
+ .action:
+ mc100Ref = _root.createEmptyMovieClip("mcA", 100);
+ mc100Ref.testvar = 100;
+ mc101Ref = _root.createEmptyMovieClip("mcA", 101);
+ mc101Ref.testvar = 101;
+ _root.check_equals(mc100Ref.testvar, 100);
+ _root.check_equals(mc101Ref.testvar, 101);
+
+ setTarget(mc100Ref);
+ _root.check_equals(testvar, 100);
+ setTarget('');
+
+ setTarget(mc101Ref);
+ // reference mc100Ref.testvar
+ _root.check_equals(testvar, 100);
+
+ _root.mc99Ref = _root.createEmptyMovieClip("mcA", 99);
+ _root.mc99Ref.testvar = 99;
+ // still reference mc100Ref.testvar
+ _root.check_equals(testvar, 100);
+ setTarget('');
+
+ _root.check_equals(mc99Ref.testvar, 99);
+
+
+ ref200=createEmptyMovieClip('name', 200);
+ ref200.testvar = 200;
+ ref200.onUnload = function() {};
+ ref201=createEmptyMovieClip('name', 201);
+ ref201.testvar = 201;
+ ref200.removeMovieClip();
+ _root.check_equals(ref200.getDepth(), -32969);
+ _root.check_equals(ref201.getDepth(), 201);
+ setTarget(ref200);
+ _root.check_equals(testvar, 200);
+ setTarget('');
+
+ setTarget(ref201);
+ _root.check_equals(testvar, 200);
+ setTarget('');
+ .end
+
+
+//
+// separate tests for setTarget('/')
+//
+.frame 13
+ .sprite mc6
+ .action:
+ setTarget('/');
+ _root.check_equals(_target, "/");
+ gotoAndPlay(15);
+ setTarget('');
+ .end
+ .end
+ .put mc6
+
+.frame 14
+ .action:
+ _root.check(false); // shoudn't executed!
+ .end
+
+.frame 15
+
+ .action:
+ stop();
+ // Gnash failed on totals() by discarding some checks.
+ xtotals(20);
+ .end
+
+.end // file end
+
diff --git a/test/gnash/misc-swfc.all/opcode_guard_test2.swf b/test/gnash/misc-swfc.all/opcode_guard_test2.swf
new file mode 100644
index 0000000..b717e7f
Binary files /dev/null and b/test/gnash/misc-swfc.all/opcode_guard_test2.swf differ
diff --git a/test/gnash/misc-swfc.all/opcode_guard_test2.swf.trace b/test/gnash/misc-swfc.all/opcode_guard_test2.swf.trace
new file mode 100644
index 0000000..5635c01
--- /dev/null
+++ b/test/gnash/misc-swfc.all/opcode_guard_test2.swf.trace
@@ -0,0 +1,26 @@
+PASSED: typeof(_root.dup1) == movieclip [opcode_guard_test2.sc:61]
+PASSED: typeof(_root.dup2) == movieclip [opcode_guard_test2.sc:62]
+PASSED: typeof(_root.dup1) == undefined [opcode_guard_test2.sc:69]
+PASSED: testVar == [opcode_guard_test2.sc:70]
+PASSED: typeof(_root.dup2) == undefined [opcode_guard_test2.sc:77]
+PASSED: testVar == [opcode_guard_test2.sc:78]
+PASSED: typeof(_root.dup3) == movieclip [opcode_guard_test2.sc:85]
+PASSED: testVar == dup3_var [opcode_guard_test2.sc:86]
+XPASSED: testvar == true [opcode_guard_test2.sc:132]
+PASSED: mc100Ref.testvar == 100 [opcode_guard_test2.sc:144]
+PASSED: mc101Ref.testvar == 101 [opcode_guard_test2.sc:145]
+PASSED: testvar == 100 [opcode_guard_test2.sc:148]
+PASSED: testvar == 100 [opcode_guard_test2.sc:153]
+PASSED: testvar == 100 [opcode_guard_test2.sc:158]
+PASSED: mc99Ref.testvar == 99 [opcode_guard_test2.sc:161]
+PASSED: ref200.getDepth() == -32969 [opcode_guard_test2.sc:170]
+PASSED: ref201.getDepth() == 201 [opcode_guard_test2.sc:171]
+PASSED: testvar == 200 [opcode_guard_test2.sc:173]
+PASSED: testvar == 200 [opcode_guard_test2.sc:177]
+PASSED: _target == / [opcode_guard_test2.sc:189]
+Total tests run: 20 typeof expected: number
+XPASSED: TOTAL tests run: 20 [ [opcode_guard_test2.sc:206]]
+#passed: 19
+#failed: 0
+#unexpected successes: 2
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.sc b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.sc
deleted file mode 100644
index 3257385..0000000
--- a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.sc
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * test opcode guard and setTarget
- */
-
-
-.flash bbox=800x600 filename="opcode_guard_test2.swf" background=white version=6 fps=12
-
-.frame 1
- .action:
- #include "Dejagnu.sc"
- .end
-
-
-.frame 2
- .sprite mc1 // Define a sprite
- .frame 2
- .action:
- setTarget('/mc1');
- _root.gotoAndPlay(5);
- _root.check(false); // shoudn't be executed
- setTarget('');
- .end
- .end
- .put mc1 // Place mc1
-
-
-.frame 4
- .del mc1
-
-.frame 5
- .sprite mc2 // Define mc2
- .end
- .put mc2 // Place mc2
- .action:
- mc2.duplicateMovieClip('dup1', 10);
- mc2.duplicateMovieClip('dup2', 20);
- mc2.duplicateMovieClip('dup3', 30);
-
- _root.dup3.onUnload = function() {};
-
- _root.check_equals(typeof(_root.dup1), 'movieclip');
- _root.check_equals(typeof(_root.dup2), 'movieclip');
-
- dup1.testVar = 'dup1_var'; //
- setTarget('dup1');
- removeMovieClip(_root.dup1);
- // seems Gnash discarded the following 2 tests, caused by opcode guard with
- // current target. I think we should use the original target.
- _root.check_equals(typeof(_root.dup1), 'undefined');
- _root.check_equals(testVar, undefined);
- setTarget('');
-
- dup2.testVar = 'dup2_var';
- with('dup2'){
- removeMovieClip(_root.dup2);
- // seems Gnash discarded the following 2 tests
- _root.check_equals(typeof(_root.dup2), 'undefined');
- _root.check_equals(testVar, undefined);
- }
-
- dup3.testVar = 'dup3_var'; //
- setTarget('dup3');
- removeMovieClip(_root.dup3);
- // dup3 is unloaded but not destroyed
- _root.check_equals(typeof(_root.dup3), 'movieclip');
- _root.check_equals(testVar, 'dup3_var');
- setTarget('');
-
- .end
-
-
-.frame 6
- .sprite mc31
- .action:
- setTarget('/mc3/mc32');
- _root.gotoAndPlay(8); // unload it's parent mc3
- _root.check(false); // shouldn't be executed
- setTarget('');
- .end
- .end
- .sprite mc32
- .end
- .sprite mc3
- .put mc31
- .put mc32
- .end
- .put mc3
-
-
-.frame 7
- .del mc3
-
-.frame 8
- .sprite mc4
- .end
- .sprite mc5
- .action:
- setTarget('/mc4');
- _root.gotoAndPlay(9);
- _root.testvar = true; // should be executed
- setTarget('');
- .end
- .end
- .put mc4
- .put mc5
-
-.frame 9
- .del mc4
-
-.frame 10
- .action:
- _root.xcheck_equals(testvar, true);
- .end
-
-//
-// separate tests for setTargetExpression
-//
-.frame 12
- .action:
- mc100Ref = _root.createEmptyMovieClip("mcA", 100);
- mc100Ref.testvar = 100;
- mc101Ref = _root.createEmptyMovieClip("mcA", 101);
- mc101Ref.testvar = 101;
- _root.check_equals(mc100Ref.testvar, 100);
- _root.check_equals(mc101Ref.testvar, 101);
-
- setTarget(mc100Ref);
- _root.check_equals(testvar, 100);
- setTarget('');
-
- setTarget(mc101Ref);
- // reference mc100Ref.testvar
- _root.check_equals(testvar, 100);
-
- _root.mc99Ref = _root.createEmptyMovieClip("mcA", 99);
- _root.mc99Ref.testvar = 99;
- // still reference mc100Ref.testvar
- _root.check_equals(testvar, 100);
- setTarget('');
-
- _root.check_equals(mc99Ref.testvar, 99);
-
-
- ref200=createEmptyMovieClip('name', 200);
- ref200.testvar = 200;
- ref200.onUnload = function() {};
- ref201=createEmptyMovieClip('name', 201);
- ref201.testvar = 201;
- ref200.removeMovieClip();
- _root.check_equals(ref200.getDepth(), -32969);
- _root.check_equals(ref201.getDepth(), 201);
- setTarget(ref200);
- _root.check_equals(testvar, 200);
- setTarget('');
-
- setTarget(ref201);
- _root.check_equals(testvar, 200);
- setTarget('');
- .end
-
-
-//
-// separate tests for setTarget('/')
-//
-.frame 13
- .sprite mc6
- .action:
- setTarget('/');
- _root.check_equals(_target, "/");
- gotoAndPlay(15);
- setTarget('');
- .end
- .end
- .put mc6
-
-.frame 14
- .action:
- _root.check(false); // shoudn't executed!
- .end
-
-.frame 15
-
- .action:
- stop();
- // Gnash failed on totals() by discarding some checks.
- xtotals(20);
- .end
-
-.end // file end
-
diff --git a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf
deleted file mode 100644
index b717e7f..0000000
Binary files a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf.trace b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf.trace
deleted file mode 100644
index 5635c01..0000000
--- a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf.trace
+++ /dev/null
@@ -1,26 +0,0 @@
-PASSED: typeof(_root.dup1) == movieclip [opcode_guard_test2.sc:61]
-PASSED: typeof(_root.dup2) == movieclip [opcode_guard_test2.sc:62]
-PASSED: typeof(_root.dup1) == undefined [opcode_guard_test2.sc:69]
-PASSED: testVar == [opcode_guard_test2.sc:70]
-PASSED: typeof(_root.dup2) == undefined [opcode_guard_test2.sc:77]
-PASSED: testVar == [opcode_guard_test2.sc:78]
-PASSED: typeof(_root.dup3) == movieclip [opcode_guard_test2.sc:85]
-PASSED: testVar == dup3_var [opcode_guard_test2.sc:86]
-XPASSED: testvar == true [opcode_guard_test2.sc:132]
-PASSED: mc100Ref.testvar == 100 [opcode_guard_test2.sc:144]
-PASSED: mc101Ref.testvar == 101 [opcode_guard_test2.sc:145]
-PASSED: testvar == 100 [opcode_guard_test2.sc:148]
-PASSED: testvar == 100 [opcode_guard_test2.sc:153]
-PASSED: testvar == 100 [opcode_guard_test2.sc:158]
-PASSED: mc99Ref.testvar == 99 [opcode_guard_test2.sc:161]
-PASSED: ref200.getDepth() == -32969 [opcode_guard_test2.sc:170]
-PASSED: ref201.getDepth() == 201 [opcode_guard_test2.sc:171]
-PASSED: testvar == 200 [opcode_guard_test2.sc:173]
-PASSED: testvar == 200 [opcode_guard_test2.sc:177]
-PASSED: _target == / [opcode_guard_test2.sc:189]
-Total tests run: 20 typeof expected: number
-XPASSED: TOTAL tests run: 20 [ [opcode_guard_test2.sc:206]]
-#passed: 19
-#failed: 0
-#unexpected successes: 2
-__END_OF_TEST__
commit c8d1e7a9a73df402d2cadeccd915bf4504ae6b5c
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 11:58:10 2008 +0300
Add a test for the case when target movie is removed
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index dbf86f7..074d81f 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -3213,6 +3213,15 @@ EXTRA_DIST = \
settarget-relative-7.swf.trace \
settarget-relative-8.swf \
settarget-relative-8.swf.trace \
+ settarget-remove.as \
+ settarget-remove-5.swf \
+ settarget-remove-5.swf.trace \
+ settarget-remove-6.swf \
+ settarget-remove-6.swf.trace \
+ settarget-remove-7.swf \
+ settarget-remove-7.swf.trace \
+ settarget-remove-8.swf \
+ settarget-remove-8.swf.trace \
settimeout.as \
settimeout-5.swf \
settimeout-5.swf.trace \
diff --git a/test/trace/settarget-remove-5.swf b/test/trace/settarget-remove-5.swf
new file mode 100644
index 0000000..1d3248b
Binary files /dev/null and b/test/trace/settarget-remove-5.swf differ
diff --git a/test/trace/settarget-remove-5.swf.trace b/test/trace/settarget-remove-5.swf.trace
new file mode 100644
index 0000000..408dfa6
--- /dev/null
+++ b/test/trace/settarget-remove-5.swf.trace
@@ -0,0 +1,4 @@
+this
+this
+this
+this
diff --git a/test/trace/settarget-remove-6.swf b/test/trace/settarget-remove-6.swf
new file mode 100644
index 0000000..e6c4a01
Binary files /dev/null and b/test/trace/settarget-remove-6.swf differ
diff --git a/test/trace/settarget-remove-6.swf.trace b/test/trace/settarget-remove-6.swf.trace
new file mode 100644
index 0000000..6ff64f9
--- /dev/null
+++ b/test/trace/settarget-remove-6.swf.trace
@@ -0,0 +1,4 @@
+global
+a
+this
+this
diff --git a/test/trace/settarget-remove-7.swf b/test/trace/settarget-remove-7.swf
new file mode 100644
index 0000000..61c09c4
Binary files /dev/null and b/test/trace/settarget-remove-7.swf differ
diff --git a/test/trace/settarget-remove-7.swf.trace b/test/trace/settarget-remove-7.swf.trace
new file mode 100644
index 0000000..6ff64f9
--- /dev/null
+++ b/test/trace/settarget-remove-7.swf.trace
@@ -0,0 +1,4 @@
+global
+a
+this
+this
diff --git a/test/trace/settarget-remove-8.swf b/test/trace/settarget-remove-8.swf
new file mode 100644
index 0000000..9695e29
Binary files /dev/null and b/test/trace/settarget-remove-8.swf differ
diff --git a/test/trace/settarget-remove-8.swf.trace b/test/trace/settarget-remove-8.swf.trace
new file mode 100644
index 0000000..6ff64f9
--- /dev/null
+++ b/test/trace/settarget-remove-8.swf.trace
@@ -0,0 +1,4 @@
+global
+a
+this
+this
diff --git a/test/trace/settarget-remove.as b/test/trace/settarget-remove.as
new file mode 100644
index 0000000..c93f0fb
--- /dev/null
+++ b/test/trace/settarget-remove.as
@@ -0,0 +1,20 @@
+// makeswf -v 7 -s 200x150 -r 15 -o settarget-remove.swf settarget-remove.as
+
+_global.test = "global";
+test = "this";
+
+createEmptyMovieClip ("a", 0);
+
+setTarget("a");
+trace (test);
+
+_root.a.test = "a";
+trace (test);
+
+removeMovieClip (_root.a);
+trace (test);
+
+setTarget("");
+trace (test);
+
+getURL ("fscommand:quit", "");
commit 17c7edcb2342a35a228eb39e0780406db6a726e4
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 11:57:10 2008 +0300
If target movie is removed, use original target instead
diff --git a/swfdec/swfdec_as_frame.c b/swfdec/swfdec_as_frame.c
index 439c0c6..fd19eb1 100644
--- a/swfdec/swfdec_as_frame.c
+++ b/swfdec/swfdec_as_frame.c
@@ -29,6 +29,7 @@
#include "swfdec_as_strings.h"
#include "swfdec_as_super.h"
#include "swfdec_debug.h"
+#include "swfdec_movie.h"
/**
* SECTION:SwfdecAsFrame
@@ -567,10 +568,17 @@ swfdec_as_frame_get_variable_and_flags (SwfdecAsFrame *frame, const char *variab
return walk->data;
}
/* we've walked the scope chain down. Now look in the special objects. */
- /* 1) the target */
- if (swfdec_as_object_get_variable_and_flags (frame->target, variable, value,
- flags, pobject))
- return frame->target;
+ /* 1) the target (if removed, use original target) */
+ if (SWFDEC_IS_MOVIE (frame->target) &&
+ SWFDEC_MOVIE(frame->target)->state < SWFDEC_MOVIE_STATE_DESTROYED) {
+ if (swfdec_as_object_get_variable_and_flags (frame->target, variable,
+ value, flags, pobject))
+ return frame->target;
+ } else {
+ if (swfdec_as_object_get_variable_and_flags (frame->original_target,
+ variable, value, flags, pobject))
+ return frame->original_target;
+ }
/* 2) the global object */
if (swfdec_as_object_get_variable_and_flags (
SWFDEC_AS_OBJECT (frame)->context->global, variable, value, flags, pobject))
commit f4b1c6752238ac485b951ffa8c96983968086397
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 11:23:20 2008 +0300
Move Gnash test movieclip_destruction_test2 from pending, it passes now
diff --git a/test/gnash/misc-swfc.all/Makefile.am b/test/gnash/misc-swfc.all/Makefile.am
index 9730c2a..6090743 100644
--- a/test/gnash/misc-swfc.all/Makefile.am
+++ b/test/gnash/misc-swfc.all/Makefile.am
@@ -25,6 +25,9 @@ EXTRA_DIST = \
mouse_drag_test.sc \
mouse_drag_test.swf \
mouse_drag_test.swf.trace \
+ movieclip_destruction_test2.sc \
+ movieclip_destruction_test2.swf \
+ movieclip_destruction_test2.swf.trace \
movieclip_destruction_test4.sc \
movieclip_destruction_test4.swf \
movieclip_destruction_test4.swf.trace \
diff --git a/test/gnash/misc-swfc.all/movieclip_destruction_test2.sc b/test/gnash/misc-swfc.all/movieclip_destruction_test2.sc
new file mode 100644
index 0000000..5a92ecb
--- /dev/null
+++ b/test/gnash/misc-swfc.all/movieclip_destruction_test2.sc
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test destruction of static movieclips and soft references
+ *
+ * Description:
+ *
+ * frame2: Place mc1, mc2, mc3 by PlaceObject2 tag.
+ * Create a soft reference mc1Ref for mc1, mc2Ref for mc2, mc3Ref for mc3.
+ * Define onUnload for mc2, define onUnload for mc3.
+ * Define mc2.testvar = 100, define mc3.testvar = new Number(100);
+ *
+ * frame3: Remove mc1, mc2, mc3 by RemovieObject2 tag
+ *
+ *
+ * Expected behaviour:
+ * (1) mc1Ref in frame3 is dangling.
+ * (2) mc2Ref, mc3Ref, mc2 and mc3 are still accessible in frame3.
+ * (3) Movieclip.swapDepths() does not work for mc2 and mc3 in frame3.
+ * (4) 'testvar' of mc2 and mc3 keep alive after onUnload called.
+ * (5) mc2Ref, mc3Ref are dangling at frame4.
+ *
+ */
+
+
+.flash bbox=800x600 filename="movieclip_destruction_test2.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box b1 fill=green width=100 height=100
+ .box b2 fill=red width=100 height=100
+ .box b3 fill=yellow width=100 height=100
+
+.frame 2
+
+ .sprite mc1 // Define a sprite mc1
+ .frame 1
+ .put b1 x = 0 y = 0
+ .end //end of sprite
+
+ .sprite mc2 // Define a sprite mc2
+ .frame 1
+ .put b2 x = 0 y = 0
+ .end
+
+ .sprite mc3 // Define a sprite mc3
+ .frame 1
+ .put b3 x = 0 y = 0
+ .end
+
+ .put mc1 x = 100 y = 300 // Place mc1
+ .put mc2 x = 200 y = 300 // Place mc2
+ .put mc3 x = 300 y = 300 // Place mc3
+
+ .action:
+
+ _root.mc2UnlaodedCount = 0;
+ _root.mc3UnlaodedCount = 0;
+ check_equals(typeof(mc1), 'movieclip');
+ check_equals(mc1.getDepth(), -16383);
+ check_equals(mc2.getDepth(), -16382);
+ check_equals(mc3.getDepth(), -16381);
+ // Define a onUnload for mc2 and mc3
+ mc2.onUnload = function ()
+ {
+ _root.check_equals(mc2.getDepth(), -16387); // already shifted inside unload handler !
+ _root.check_equals(this.getDepth(), -16387); // ...
+ _root.mc2UnlaodedCount++;
+ // mc2.testvar keeps alive as long as mc2 is alive
+ _root.check_equals(mc2.testvar, 100);
+ };
+ mc3.onUnload = function ()
+ {
+ _root.mc3UnlaodedCount++;
+ _root.check_equals(mc3.testvar, 100);
+ };
+
+ mc2.testvar = 100;
+ mc3.testvar = new Number(100);
+
+ // Create soft references for mc1 and mc2 and mc3
+ mc1Ref = mc1;
+ mc2Ref = mc2;
+ mc3Ref = mc3;
+ .end
+
+
+.frame 3
+ .del mc1 // Remove mc1 by RemoveObject2
+ .del mc2 // Remove mc2 by RemoveObject2
+ .del mc3 // Remove mc3 by RemoveObject2
+
+ .action:
+ check_equals(mc2UnlaodedCount, 1); // mc2.onUnload triggered
+ check_equals(mc3UnlaodedCount, 1); // mc3.onUnload triggered
+ check_equals(mc1Ref.valueOf(), null);
+ check_equals(mc2Ref, mc2);
+ check_equals(mc3Ref, mc3);
+
+ check_equals(typeof(mc1), 'undefined'); // cann't access the hard reference
+ // mc1 is destroyed. it is not in the removed depth zone.
+ check_equals(_root.getInstanceAtDepth(-16386), undefined);
+ check_equals(typeof(mc2), 'movieclip'); // mc2 is still accessable
+ check_equals(typeof(mc3), 'movieclip'); // mc3 is still accessable
+ check_equals(mc2.getDepth(), -16387); // depth of mc2 changed after onUnload
+ check_equals(mc3.getDepth(), -16388); // depth of mc3 changed after onUnload
+
+ mc2.swapDepths(mc3);
+ check_equals(mc2.getDepth(), -16387); // depth not change after swapDepths
+ check_equals(mc3.getDepth(), -16388); // depth not change after swapDepths
+
+ mc2.swapDephts(-10);
+ mc2.swapDephts(10);
+ check_equals(mc2.getDepth(), -16387); // depth not change after swapDepths
+ check_equals(mc3.getDepth(), -16388); // depth not change after swapDepths
+
+ check_equals(mc2.testvar, 100);
+ check_equals(mc3.testvar, 100);
+ mc2.removMovieClip();
+ mc3.removMovieClip();
+ check_equals(mc2UnlaodedCount, 1); // mc2.onUnload not triggered again
+ check_equals(mc2UnlaodedCount, 1); // mc3.onUnload not triggered again
+ check_equals(typeof(mc2), 'movieclip'); // mc2 is still accessible
+ check_equals(typeof(mc3), 'movieclip'); // mc3 is still accessible
+ check_equals(mc2.getDepth(), -16387);
+ check_equals(mc3.getDepth(), -16388);
+ check_equals(mc2._x, 200);
+ check_equals(mc3._y, 300);
+ check_equals(mc2.testvar, 100);
+ check_equals(mc3.testvar, 100);
+
+ mc2.onUnload();
+ mc3.onUnload();
+ check_equals(mc2UnlaodedCount, 2); // we can still invoke onUnload
+ check_equals(mc2UnlaodedCount, 2); // we can still invoke onUnload
+ .end
+
+
+.frame 4
+ .action:
+ check_equals(typeof(mc1), 'undefined');
+ check_equals(typeof(mc2), 'undefined');
+ check_equals(typeof(mc3), 'undefined');
+ check_equals(mc1Ref.valueOf(), null);
+ check_equals(mc2Ref.valueOf(), null);
+ check_equals(mc3Ref.valueOf(), null);
+ .end
+
+// Seperate tests for Movieclip.swapDepths
+.frame 5
+ .put mc1 x = 100 y = 300 // Place mc1
+ .action:
+ check_equals(mc1.getDepth(), -16380);
+ mc1.swapDepths(-16385); // doesn't work, can't swap mc1 to a depth below -16384
+ check_equals(mc1.getDepth(), -16380);
+ mc1.swapDepths(-16384); // works
+ check_equals(mc1.getDepth(), -16384);
+ mc1.swapDepths(-32769); // doesn't work, can't swap mc1 to a depth below -16384
+ check_equals(mc1.getDepth(), -16384);
+ mc1.swapDepths(-402770); // doesn't work, can't swap mc1 to a depth below -16384
+ check_equals(mc1.getDepth(), -16384);
+ .end
+
+.frame 6
+ .action:
+ totals(52);
+ stop();
+ .end
+
+
+.end // end of the file
+
diff --git a/test/gnash/misc-swfc.all/movieclip_destruction_test2.swf b/test/gnash/misc-swfc.all/movieclip_destruction_test2.swf
new file mode 100644
index 0000000..fb54709
Binary files /dev/null and b/test/gnash/misc-swfc.all/movieclip_destruction_test2.swf differ
diff --git a/test/gnash/misc-swfc.all/movieclip_destruction_test2.swf.trace b/test/gnash/misc-swfc.all/movieclip_destruction_test2.swf.trace
new file mode 100644
index 0000000..51a1cea
--- /dev/null
+++ b/test/gnash/misc-swfc.all/movieclip_destruction_test2.swf.trace
@@ -0,0 +1,56 @@
+PASSED: typeof(mc1) == movieclip [movieclip_destruction_test2.sc:81]
+PASSED: mc1.getDepth() == -16383 [movieclip_destruction_test2.sc:82]
+PASSED: mc2.getDepth() == -16382 [movieclip_destruction_test2.sc:83]
+PASSED: mc3.getDepth() == -16381 [movieclip_destruction_test2.sc:84]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:88]
+PASSED: this.getDepth() == -16387 [movieclip_destruction_test2.sc:89]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:92]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:97]
+PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:116]
+PASSED: mc3UnlaodedCount == 1 [movieclip_destruction_test2.sc:117]
+PASSED: mc1Ref.valueOf() == null [movieclip_destruction_test2.sc:118]
+PASSED: mc2Ref == _level0.mc2 [movieclip_destruction_test2.sc:119]
+PASSED: mc3Ref == _level0.mc3 [movieclip_destruction_test2.sc:120]
+PASSED: typeof(mc1) == undefined [movieclip_destruction_test2.sc:122]
+PASSED: _root.getInstanceAtDepth(-16386) == undefined [movieclip_destruction_test2.sc:124]
+PASSED: typeof(mc2) == movieclip [movieclip_destruction_test2.sc:125]
+PASSED: typeof(mc3) == movieclip [movieclip_destruction_test2.sc:126]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:127]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:128]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:131]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:132]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:136]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:137]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:139]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:140]
+PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:143]
+PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:144]
+PASSED: typeof(mc2) == movieclip [movieclip_destruction_test2.sc:145]
+PASSED: typeof(mc3) == movieclip [movieclip_destruction_test2.sc:146]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:147]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:148]
+PASSED: mc2._x == 200 [movieclip_destruction_test2.sc:149]
+PASSED: mc3._y == 300 [movieclip_destruction_test2.sc:150]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:151]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:152]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:88]
+PASSED: this.getDepth() == -16387 [movieclip_destruction_test2.sc:89]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:92]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:97]
+PASSED: mc2UnlaodedCount == 2 [movieclip_destruction_test2.sc:156]
+PASSED: mc2UnlaodedCount == 2 [movieclip_destruction_test2.sc:157]
+PASSED: typeof(mc1) == undefined [movieclip_destruction_test2.sc:163]
+PASSED: typeof(mc2) == undefined [movieclip_destruction_test2.sc:164]
+PASSED: typeof(mc3) == undefined [movieclip_destruction_test2.sc:165]
+PASSED: mc1Ref.valueOf() == null [movieclip_destruction_test2.sc:166]
+PASSED: mc2Ref.valueOf() == null [movieclip_destruction_test2.sc:167]
+PASSED: mc3Ref.valueOf() == null [movieclip_destruction_test2.sc:168]
+PASSED: mc1.getDepth() == -16380 [movieclip_destruction_test2.sc:175]
+PASSED: mc1.getDepth() == -16380 [movieclip_destruction_test2.sc:177]
+PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:179]
+PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:181]
+PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:183]
+Total tests run: 52 typeof expected: number
+#passed: 52
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.sc b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.sc
deleted file mode 100644
index 5a92ecb..0000000
--- a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.sc
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * Test destruction of static movieclips and soft references
- *
- * Description:
- *
- * frame2: Place mc1, mc2, mc3 by PlaceObject2 tag.
- * Create a soft reference mc1Ref for mc1, mc2Ref for mc2, mc3Ref for mc3.
- * Define onUnload for mc2, define onUnload for mc3.
- * Define mc2.testvar = 100, define mc3.testvar = new Number(100);
- *
- * frame3: Remove mc1, mc2, mc3 by RemovieObject2 tag
- *
- *
- * Expected behaviour:
- * (1) mc1Ref in frame3 is dangling.
- * (2) mc2Ref, mc3Ref, mc2 and mc3 are still accessible in frame3.
- * (3) Movieclip.swapDepths() does not work for mc2 and mc3 in frame3.
- * (4) 'testvar' of mc2 and mc3 keep alive after onUnload called.
- * (5) mc2Ref, mc3Ref are dangling at frame4.
- *
- */
-
-
-.flash bbox=800x600 filename="movieclip_destruction_test2.swf" background=white version=7 fps=12
-
-.frame 1
- .action:
- #include "Dejagnu.sc"
- .end
-
- // Define 3 shapes(b1, b2, b3)
- .box b1 fill=green width=100 height=100
- .box b2 fill=red width=100 height=100
- .box b3 fill=yellow width=100 height=100
-
-.frame 2
-
- .sprite mc1 // Define a sprite mc1
- .frame 1
- .put b1 x = 0 y = 0
- .end //end of sprite
-
- .sprite mc2 // Define a sprite mc2
- .frame 1
- .put b2 x = 0 y = 0
- .end
-
- .sprite mc3 // Define a sprite mc3
- .frame 1
- .put b3 x = 0 y = 0
- .end
-
- .put mc1 x = 100 y = 300 // Place mc1
- .put mc2 x = 200 y = 300 // Place mc2
- .put mc3 x = 300 y = 300 // Place mc3
-
- .action:
-
- _root.mc2UnlaodedCount = 0;
- _root.mc3UnlaodedCount = 0;
- check_equals(typeof(mc1), 'movieclip');
- check_equals(mc1.getDepth(), -16383);
- check_equals(mc2.getDepth(), -16382);
- check_equals(mc3.getDepth(), -16381);
- // Define a onUnload for mc2 and mc3
- mc2.onUnload = function ()
- {
- _root.check_equals(mc2.getDepth(), -16387); // already shifted inside unload handler !
- _root.check_equals(this.getDepth(), -16387); // ...
- _root.mc2UnlaodedCount++;
- // mc2.testvar keeps alive as long as mc2 is alive
- _root.check_equals(mc2.testvar, 100);
- };
- mc3.onUnload = function ()
- {
- _root.mc3UnlaodedCount++;
- _root.check_equals(mc3.testvar, 100);
- };
-
- mc2.testvar = 100;
- mc3.testvar = new Number(100);
-
- // Create soft references for mc1 and mc2 and mc3
- mc1Ref = mc1;
- mc2Ref = mc2;
- mc3Ref = mc3;
- .end
-
-
-.frame 3
- .del mc1 // Remove mc1 by RemoveObject2
- .del mc2 // Remove mc2 by RemoveObject2
- .del mc3 // Remove mc3 by RemoveObject2
-
- .action:
- check_equals(mc2UnlaodedCount, 1); // mc2.onUnload triggered
- check_equals(mc3UnlaodedCount, 1); // mc3.onUnload triggered
- check_equals(mc1Ref.valueOf(), null);
- check_equals(mc2Ref, mc2);
- check_equals(mc3Ref, mc3);
-
- check_equals(typeof(mc1), 'undefined'); // cann't access the hard reference
- // mc1 is destroyed. it is not in the removed depth zone.
- check_equals(_root.getInstanceAtDepth(-16386), undefined);
- check_equals(typeof(mc2), 'movieclip'); // mc2 is still accessable
- check_equals(typeof(mc3), 'movieclip'); // mc3 is still accessable
- check_equals(mc2.getDepth(), -16387); // depth of mc2 changed after onUnload
- check_equals(mc3.getDepth(), -16388); // depth of mc3 changed after onUnload
-
- mc2.swapDepths(mc3);
- check_equals(mc2.getDepth(), -16387); // depth not change after swapDepths
- check_equals(mc3.getDepth(), -16388); // depth not change after swapDepths
-
- mc2.swapDephts(-10);
- mc2.swapDephts(10);
- check_equals(mc2.getDepth(), -16387); // depth not change after swapDepths
- check_equals(mc3.getDepth(), -16388); // depth not change after swapDepths
-
- check_equals(mc2.testvar, 100);
- check_equals(mc3.testvar, 100);
- mc2.removMovieClip();
- mc3.removMovieClip();
- check_equals(mc2UnlaodedCount, 1); // mc2.onUnload not triggered again
- check_equals(mc2UnlaodedCount, 1); // mc3.onUnload not triggered again
- check_equals(typeof(mc2), 'movieclip'); // mc2 is still accessible
- check_equals(typeof(mc3), 'movieclip'); // mc3 is still accessible
- check_equals(mc2.getDepth(), -16387);
- check_equals(mc3.getDepth(), -16388);
- check_equals(mc2._x, 200);
- check_equals(mc3._y, 300);
- check_equals(mc2.testvar, 100);
- check_equals(mc3.testvar, 100);
-
- mc2.onUnload();
- mc3.onUnload();
- check_equals(mc2UnlaodedCount, 2); // we can still invoke onUnload
- check_equals(mc2UnlaodedCount, 2); // we can still invoke onUnload
- .end
-
-
-.frame 4
- .action:
- check_equals(typeof(mc1), 'undefined');
- check_equals(typeof(mc2), 'undefined');
- check_equals(typeof(mc3), 'undefined');
- check_equals(mc1Ref.valueOf(), null);
- check_equals(mc2Ref.valueOf(), null);
- check_equals(mc3Ref.valueOf(), null);
- .end
-
-// Seperate tests for Movieclip.swapDepths
-.frame 5
- .put mc1 x = 100 y = 300 // Place mc1
- .action:
- check_equals(mc1.getDepth(), -16380);
- mc1.swapDepths(-16385); // doesn't work, can't swap mc1 to a depth below -16384
- check_equals(mc1.getDepth(), -16380);
- mc1.swapDepths(-16384); // works
- check_equals(mc1.getDepth(), -16384);
- mc1.swapDepths(-32769); // doesn't work, can't swap mc1 to a depth below -16384
- check_equals(mc1.getDepth(), -16384);
- mc1.swapDepths(-402770); // doesn't work, can't swap mc1 to a depth below -16384
- check_equals(mc1.getDepth(), -16384);
- .end
-
-.frame 6
- .action:
- totals(52);
- stop();
- .end
-
-
-.end // end of the file
-
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf
deleted file mode 100644
index fb54709..0000000
Binary files a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf.trace b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf.trace
deleted file mode 100644
index 51a1cea..0000000
--- a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf.trace
+++ /dev/null
@@ -1,56 +0,0 @@
-PASSED: typeof(mc1) == movieclip [movieclip_destruction_test2.sc:81]
-PASSED: mc1.getDepth() == -16383 [movieclip_destruction_test2.sc:82]
-PASSED: mc2.getDepth() == -16382 [movieclip_destruction_test2.sc:83]
-PASSED: mc3.getDepth() == -16381 [movieclip_destruction_test2.sc:84]
-PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:88]
-PASSED: this.getDepth() == -16387 [movieclip_destruction_test2.sc:89]
-PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:92]
-PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:97]
-PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:116]
-PASSED: mc3UnlaodedCount == 1 [movieclip_destruction_test2.sc:117]
-PASSED: mc1Ref.valueOf() == null [movieclip_destruction_test2.sc:118]
-PASSED: mc2Ref == _level0.mc2 [movieclip_destruction_test2.sc:119]
-PASSED: mc3Ref == _level0.mc3 [movieclip_destruction_test2.sc:120]
-PASSED: typeof(mc1) == undefined [movieclip_destruction_test2.sc:122]
-PASSED: _root.getInstanceAtDepth(-16386) == undefined [movieclip_destruction_test2.sc:124]
-PASSED: typeof(mc2) == movieclip [movieclip_destruction_test2.sc:125]
-PASSED: typeof(mc3) == movieclip [movieclip_destruction_test2.sc:126]
-PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:127]
-PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:128]
-PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:131]
-PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:132]
-PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:136]
-PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:137]
-PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:139]
-PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:140]
-PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:143]
-PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:144]
-PASSED: typeof(mc2) == movieclip [movieclip_destruction_test2.sc:145]
-PASSED: typeof(mc3) == movieclip [movieclip_destruction_test2.sc:146]
-PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:147]
-PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:148]
-PASSED: mc2._x == 200 [movieclip_destruction_test2.sc:149]
-PASSED: mc3._y == 300 [movieclip_destruction_test2.sc:150]
-PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:151]
-PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:152]
-PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:88]
-PASSED: this.getDepth() == -16387 [movieclip_destruction_test2.sc:89]
-PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:92]
-PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:97]
-PASSED: mc2UnlaodedCount == 2 [movieclip_destruction_test2.sc:156]
-PASSED: mc2UnlaodedCount == 2 [movieclip_destruction_test2.sc:157]
-PASSED: typeof(mc1) == undefined [movieclip_destruction_test2.sc:163]
-PASSED: typeof(mc2) == undefined [movieclip_destruction_test2.sc:164]
-PASSED: typeof(mc3) == undefined [movieclip_destruction_test2.sc:165]
-PASSED: mc1Ref.valueOf() == null [movieclip_destruction_test2.sc:166]
-PASSED: mc2Ref.valueOf() == null [movieclip_destruction_test2.sc:167]
-PASSED: mc3Ref.valueOf() == null [movieclip_destruction_test2.sc:168]
-PASSED: mc1.getDepth() == -16380 [movieclip_destruction_test2.sc:175]
-PASSED: mc1.getDepth() == -16380 [movieclip_destruction_test2.sc:177]
-PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:179]
-PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:181]
-PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:183]
-Total tests run: 52 typeof expected: number
-#passed: 52
-#failed: 0
-__END_OF_TEST__
commit 0c58f4277364100a7245dcf41374e6d9f6ec6233
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 11:22:04 2008 +0300
Don't allow MovieClip.swapDepths to depth classified as empty or reserved
Added a test
diff --git a/swfdec/swfdec_sprite_movie_as.c b/swfdec/swfdec_sprite_movie_as.c
index c360fca..24cd47d 100644
--- a/swfdec/swfdec_sprite_movie_as.c
+++ b/swfdec/swfdec_sprite_movie_as.c
@@ -608,23 +608,20 @@ void
swfdec_sprite_movie_swapDepths (SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval)
{
- SwfdecMovie *movie;
- SwfdecMovie *other;
+ SwfdecMovie *movie, *other;
+ SwfdecAsValue value;
int depth;
- SWFDEC_AS_CHECK (SWFDEC_TYPE_MOVIE, (gpointer)&movie, "");
-
- if (argc < 1)
- return;
+ SWFDEC_AS_CHECK (SWFDEC_TYPE_MOVIE, (gpointer)&movie, "v", &value);
- if (SWFDEC_AS_VALUE_IS_OBJECT (&argv[0])) {
- other = (SwfdecMovie *) SWFDEC_AS_VALUE_GET_OBJECT (&argv[0]);
+ if (SWFDEC_AS_VALUE_IS_OBJECT (&value)) {
+ other = (SwfdecMovie *) SWFDEC_AS_VALUE_GET_OBJECT (&value);
if (!SWFDEC_IS_MOVIE (other) ||
other->parent != movie->parent)
return;
depth = other->depth;
} else {
- depth = swfdec_as_value_to_integer (cx, &argv[0]);
+ depth = swfdec_as_value_to_integer (cx, &value);
if (movie->parent) {
other = swfdec_movie_find (movie->parent, depth);
} else {
@@ -632,6 +629,13 @@ swfdec_sprite_movie_swapDepths (SwfdecAsContext *cx, SwfdecAsObject *object,
other = NULL;
}
}
+
+ // FIXME: one different than the reserved range, should the classify function
+ // be changed instead?
+ if (swfdec_depth_classify (depth) == SWFDEC_DEPTH_CLASS_EMPTY ||
+ depth >= 2130690045)
+ return;
+
if (other)
swfdec_movie_set_depth (other, movie->depth);
swfdec_movie_set_depth (movie, depth);
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index cdccc32..dbf86f7 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -2091,6 +2091,15 @@ EXTRA_DIST = \
movieclip-swap-depths-7.swf.trace \
movieclip-swap-depths-8.swf \
movieclip-swap-depths-8.swf.trace \
+ movieclip-swap-depths-range.as \
+ movieclip-swap-depths-range-5.swf \
+ movieclip-swap-depths-range-5.swf.trace \
+ movieclip-swap-depths-range-6.swf \
+ movieclip-swap-depths-range-6.swf.trace \
+ movieclip-swap-depths-range-7.swf \
+ movieclip-swap-depths-range-7.swf.trace \
+ movieclip-swap-depths-range-8.swf \
+ movieclip-swap-depths-range-8.swf.trace \
movieclip-target.as \
movieclip-target-5.swf \
movieclip-target-5.swf.trace \
diff --git a/test/trace/movieclip-swap-depths-range-5.swf b/test/trace/movieclip-swap-depths-range-5.swf
new file mode 100644
index 0000000..10ffdd2
Binary files /dev/null and b/test/trace/movieclip-swap-depths-range-5.swf differ
diff --git a/test/trace/movieclip-swap-depths-range-5.swf.trace b/test/trace/movieclip-swap-depths-range-5.swf.trace
new file mode 100644
index 0000000..2b26574
--- /dev/null
+++ b/test/trace/movieclip-swap-depths-range-5.swf.trace
@@ -0,0 +1,18 @@
+a:
+b:
+c:
+a:
+b:
+c:
+a:
+b:
+c:
+a:
+b:
+c:
+a:
+b:
+c:
+a:
+b:
+c:
diff --git a/test/trace/movieclip-swap-depths-range-6.swf b/test/trace/movieclip-swap-depths-range-6.swf
new file mode 100644
index 0000000..74cd560
Binary files /dev/null and b/test/trace/movieclip-swap-depths-range-6.swf differ
diff --git a/test/trace/movieclip-swap-depths-range-6.swf.trace b/test/trace/movieclip-swap-depths-range-6.swf.trace
new file mode 100644
index 0000000..f841651
--- /dev/null
+++ b/test/trace/movieclip-swap-depths-range-6.swf.trace
@@ -0,0 +1,18 @@
+a: 1
+b: 2
+c: 3
+a: 1
+b: -16384
+c: -16383
+a: -1
+b: 0
+c: 1
+a: 1048575
+b: 1048576
+c: 1048577
+a: 1048575
+b: 1048576
+c: 1048577
+a: 2130690044
+b: 2130690043
+c: 2130690042
diff --git a/test/trace/movieclip-swap-depths-range-7.swf b/test/trace/movieclip-swap-depths-range-7.swf
new file mode 100644
index 0000000..47e2767
Binary files /dev/null and b/test/trace/movieclip-swap-depths-range-7.swf differ
diff --git a/test/trace/movieclip-swap-depths-range-7.swf.trace b/test/trace/movieclip-swap-depths-range-7.swf.trace
new file mode 100644
index 0000000..f841651
--- /dev/null
+++ b/test/trace/movieclip-swap-depths-range-7.swf.trace
@@ -0,0 +1,18 @@
+a: 1
+b: 2
+c: 3
+a: 1
+b: -16384
+c: -16383
+a: -1
+b: 0
+c: 1
+a: 1048575
+b: 1048576
+c: 1048577
+a: 1048575
+b: 1048576
+c: 1048577
+a: 2130690044
+b: 2130690043
+c: 2130690042
diff --git a/test/trace/movieclip-swap-depths-range-8.swf b/test/trace/movieclip-swap-depths-range-8.swf
new file mode 100644
index 0000000..da829ba
Binary files /dev/null and b/test/trace/movieclip-swap-depths-range-8.swf differ
diff --git a/test/trace/movieclip-swap-depths-range-8.swf.trace b/test/trace/movieclip-swap-depths-range-8.swf.trace
new file mode 100644
index 0000000..f841651
--- /dev/null
+++ b/test/trace/movieclip-swap-depths-range-8.swf.trace
@@ -0,0 +1,18 @@
+a: 1
+b: 2
+c: 3
+a: 1
+b: -16384
+c: -16383
+a: -1
+b: 0
+c: 1
+a: 1048575
+b: 1048576
+c: 1048577
+a: 1048575
+b: 1048576
+c: 1048577
+a: 2130690044
+b: 2130690043
+c: 2130690042
diff --git a/test/trace/movieclip-swap-depths-range.as b/test/trace/movieclip-swap-depths-range.as
new file mode 100644
index 0000000..02f6a9b
--- /dev/null
+++ b/test/trace/movieclip-swap-depths-range.as
@@ -0,0 +1,46 @@
+// makeswf -v 7 -r 15 -o movieclip-swap-depths-range-7.swf movieclip-swap-depths-range.as
+
+function trace_depths () {
+ //trace ("this: " + this.getDepth ());
+ trace ("a: " + a.getDepth ());
+ trace ("b: " + b.getDepth ());
+ trace ("c: " + c.getDepth ());
+}
+
+this.createEmptyMovieClip ("a", 1);
+this.createEmptyMovieClip ("b", 2);
+this.createEmptyMovieClip ("c", 3);
+
+trace_depths ();
+
+a.swapDepths (-16385);
+b.swapDepths (-16384);
+c.swapDepths (-16383);
+
+trace_depths ();
+
+a.swapDepths (-1);
+b.swapDepths (0);
+c.swapDepths (1);
+
+trace_depths ();
+
+a.swapDepths (1048575);
+b.swapDepths (1048576);
+c.swapDepths (1048577);
+
+trace_depths ();
+
+a.swapDepths (2130690045);
+b.swapDepths (2130690046);
+c.swapDepths (2130690047);
+
+trace_depths ();
+
+a.swapDepths (2130690044);
+b.swapDepths (2130690043);
+c.swapDepths (2130690042);
+
+trace_depths ();
+
+getURL ("FSCommand:quit", "");
commit a7bfecf5d2db6b1c2bcdfd7e95b936a647b3aef1
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 10:47:43 2008 +0300
Run misc-swfc.all tests longer (default.stas). Move working ones from pending
diff --git a/test/gnash/misc-swfc.all/Makefile.am b/test/gnash/misc-swfc.all/Makefile.am
index d3be011..9730c2a 100644
--- a/test/gnash/misc-swfc.all/Makefile.am
+++ b/test/gnash/misc-swfc.all/Makefile.am
@@ -10,6 +10,24 @@ EXTRA_DIST = \
default.sts \
Dejagnu.sc \
Dejagnu.sc.original \
+ edittext_test1.sc \
+ edittext_test1.swf \
+ edittext_test1.swf.trace \
+ gotoFrameFromInterval2.sc \
+ gotoFrameFromInterval2.swf \
+ gotoFrameFromInterval2.swf.trace \
+ gotoFrameLabelAsFunction.sc \
+ gotoFrameLabelAsFunction.swf \
+ gotoFrameLabelAsFunction.swf.trace \
hello.sc \
hello.swf \
- hello.swf.trace
+ hello.swf.trace \
+ mouse_drag_test.sc \
+ mouse_drag_test.swf \
+ mouse_drag_test.swf.trace \
+ movieclip_destruction_test4.sc \
+ movieclip_destruction_test4.swf \
+ movieclip_destruction_test4.swf.trace \
+ registerclass_test3.sc \
+ registerclass_test3.swf \
+ registerclass_test3.swf.trace
diff --git a/test/gnash/misc-swfc.all/default.stas b/test/gnash/misc-swfc.all/default.stas
index 844990a..d77c708 100644
--- a/test/gnash/misc-swfc.all/default.stas
+++ b/test/gnash/misc-swfc.all/default.stas
@@ -24,7 +24,8 @@ run_test = function (t, file) {
t.reset (file);
var expected = Buffer.load (file + ".trace");
t.advance (0);
- t.advance (Math.ceil (10000 / t.rate));
+ // run these tests longer...
+ t.advance (Math.ceil (20000 / t.rate));
var diff = t.trace.diff (expected);
if (diff) {
error ("different trace output");
diff --git a/test/gnash/misc-swfc.all/default.sts b/test/gnash/misc-swfc.all/default.sts
index 279dcda..581a8ed 100644
Binary files a/test/gnash/misc-swfc.all/default.sts and b/test/gnash/misc-swfc.all/default.sts differ
diff --git a/test/gnash/misc-swfc.all/edittext_test1.sc b/test/gnash/misc-swfc.all/edittext_test1.sc
new file mode 100644
index 0000000..7196176
--- /dev/null
+++ b/test/gnash/misc-swfc.all/edittext_test1.sc
@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ */
+
+
+.flash bbox=800x600 filename="edittext_test1.swf" background=white version=7 fps=1
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+ .edittext edtext1 size=200%
+ width=400 height=200
+ color=blue border multiline wordwrap
+ text="Hello"
+ variable="textVar1"
+
+ .put edtext1 x=10 y=300
+
+ .action:
+ // check the initial values
+ check_equals(typeof(edtext1), 'object');
+ check_equals(edtext1._name, 'edtext1');
+ check_equals(edtext1._target, '/edtext1');
+ check_equals(edtext1.text, 'Hello');
+ check_equals(edtext1.variable, 'textVar1');
+ check_equals(_root.textVar1, 'Hello');
+ .end
+
+
+.frame 2
+ .action:
+ // Update the registered variable
+ _root.textVar1 = 'new-string-frame2';
+ check_equals(_root.textVar1, 'new-string-frame2');
+ // The return value of TextField.text also updated
+ check_equals(edtext1.text, 'new-string-frame2');
+ .end
+
+.frame 3
+ .action:
+ // Update TextField.text
+ edtext1.text = 'new-string-frame3';
+ check_equals(edtext1.text, 'new-string-frame3');
+ // The return value of the registered variable also updated
+ check_equals(edtext1.text, 'new-string-frame3');
+ .end
+
+.frame 4
+ .action:
+ // rename the EditText variable to 'textVar2'
+ edtext1.variable = 'textVar2';
+ check_equals(_root.hasOwnProperty('textVar2'), true);
+ check_equals(edtext1.variable, 'textVar2');
+ // textVar2 automatically initialized to 'Hello'
+ // (the InitialText in DefineTextField tag, make sense!)
+ check_equals(_root.textVar2, 'Hello');
+ check_equals(edtext1.text, 'Hello');
+ check_equals(_root.textVar1, 'new-string-frame3');
+ .end
+
+
+.frame 5
+ .action:
+ // restore the EditText variable name to 'textVar1'
+ edtext1.variable = 'textVar1';
+ check_equals(edtext1.variable, 'textVar1');
+ // edtext1.text also restore to the value of
+ // _root.textVar1(the registered variable)
+ check_equals(edtext1.text, 'new-string-frame3');
+ .end
+
+
+.frame 6
+ .action:
+ edtext1.text = 'new-string-frame6';
+ check_equals(edtext1.text, 'new-string-frame6');
+ check_equals(_root.textVar1, 'new-string-frame6');
+
+ // Rename the EditText variable to 'textVar3'
+ edtext1.variable = 'textVar3';
+ // textVar3 automatically initialized to 'Hello'
+ // (the InitialText in DefineTextField tag, make sense!)
+ check_equals(_root.textVar3, 'Hello');
+ check_equals(_root.textVar1, 'new-string-frame6');
+ .end
+
+.frame 7
+ .action:
+ check_equals(_root.hasOwnProperty('textVar1'), true);
+ check_equals(_root.hasOwnProperty('textVar2'), true);
+ check_equals(_root.hasOwnProperty('textVar3'), true);
+ .end
+
+
+.frame 8
+ .del edtext1 // Remove edtext1
+ .action:
+ // after removing the TextField instance, all registered variables still keep alive
+ check_equals(_root.hasOwnProperty('textVar1'), true);
+ check_equals(_root.hasOwnProperty('textVar2'), true);
+ check_equals(_root.hasOwnProperty('textVar3'), true);
+ check_equals(typeof(edtext1), 'undefined');
+ .end
+
+//
+// new tests, seperate from the above
+//
+.frame 9
+ .action:
+ textVar4 = 'new_tests_begin';
+ .end
+
+.frame 10
+ .edittext edtext2 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="Hello"
+ variable="textVar4" // give a name already exists in main timeline.
+ .put edtext2 x=10 y=300
+ .action:
+ // returns the value of the registered variable in main timeline
+ check_equals(edtext2.text, 'new_tests_begin');
+ .end
+
+
+.frame 11
+ .action:
+ edtext2.text = 'value_changed';
+ check_equals(edtext2.text, 'value_changed');
+ check_equals(textVar4, 'value_changed');
+ .end
+
+//
+// new tests, seperate from the above
+//
+.frame 12
+ .edittext edtext10 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="AAA"
+ variable="textVar10"
+ .edittext edtext11 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="BBB"
+ variable="textVar11"
+ .edittext edtext12 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="CCC"
+ variable="textVar12"
+
+ .put edtext10 x=100 y=300
+ .put edtext11 x=100 y=400
+ .put edtext12 x=100 y=500
+
+
+ .action:
+ check_equals(edtext10.text, 'AAA');
+ check_equals(edtext11.text, 'BBB');
+ check_equals(edtext12.text, 'CCC');
+ edtext10.variable = "textVar11";
+ edtext11.variable = "textVar12";
+ edtext12.variable = "textVar10";
+ check_equals(edtext10.text, 'BBB');
+ check_equals(edtext11.text, 'CCC');
+ check_equals(edtext12.text, 'AAA');
+ check_equals(textVar10, 'AAA');
+ check_equals(textVar11, 'BBB');
+ check_equals(textVar12, 'CCC');
+ .end
+
+
+.frame 13
+ .action:
+ edtext10.text = 'CCC';
+ edtext11.text = 'BBB';
+ edtext12.text = 'AAA';
+ check_equals(textVar10, 'AAA');
+ check_equals(textVar11, 'CCC');
+ check_equals(textVar12, 'BBB');
+ .end
+
+.frame 15
+ .action:
+ totals(43);
+ stop();
+ .end
+
+
+.end // file end
+
diff --git a/test/gnash/misc-swfc.all/edittext_test1.swf b/test/gnash/misc-swfc.all/edittext_test1.swf
new file mode 100644
index 0000000..ed4c18c
Binary files /dev/null and b/test/gnash/misc-swfc.all/edittext_test1.swf differ
diff --git a/test/gnash/misc-swfc.all/edittext_test1.swf.trace b/test/gnash/misc-swfc.all/edittext_test1.swf.trace
new file mode 100644
index 0000000..e4205be
--- /dev/null
+++ b/test/gnash/misc-swfc.all/edittext_test1.swf.trace
@@ -0,0 +1,47 @@
+PASSED: typeof(edtext1) == object [edittext_test1.sc:41]
+PASSED: edtext1._name == edtext1 [edittext_test1.sc:42]
+PASSED: edtext1._target == /edtext1 [edittext_test1.sc:43]
+PASSED: edtext1.text == Hello [edittext_test1.sc:44]
+PASSED: edtext1.variable == textVar1 [edittext_test1.sc:45]
+PASSED: _root.textVar1 == Hello [edittext_test1.sc:46]
+PASSED: _root.textVar1 == new-string-frame2 [edittext_test1.sc:54]
+PASSED: edtext1.text == new-string-frame2 [edittext_test1.sc:56]
+PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:63]
+PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:65]
+PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:72]
+PASSED: edtext1.variable == textVar2 [edittext_test1.sc:73]
+PASSED: _root.textVar2 == Hello [edittext_test1.sc:76]
+PASSED: edtext1.text == Hello [edittext_test1.sc:77]
+PASSED: _root.textVar1 == new-string-frame3 [edittext_test1.sc:78]
+PASSED: edtext1.variable == textVar1 [edittext_test1.sc:86]
+PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:89]
+PASSED: edtext1.text == new-string-frame6 [edittext_test1.sc:96]
+PASSED: _root.textVar1 == new-string-frame6 [edittext_test1.sc:97]
+PASSED: _root.textVar3 == Hello [edittext_test1.sc:103]
+PASSED: _root.textVar1 == new-string-frame6 [edittext_test1.sc:104]
+PASSED: _root.hasOwnProperty('textVar1') == true [edittext_test1.sc:109]
+PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:110]
+PASSED: _root.hasOwnProperty('textVar3') == true [edittext_test1.sc:111]
+PASSED: _root.hasOwnProperty('textVar1') == true [edittext_test1.sc:119]
+PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:120]
+PASSED: _root.hasOwnProperty('textVar3') == true [edittext_test1.sc:121]
+PASSED: typeof(edtext1) == undefined [edittext_test1.sc:122]
+PASSED: edtext2.text == new_tests_begin [edittext_test1.sc:142]
+PASSED: edtext2.text == value_changed [edittext_test1.sc:149]
+PASSED: textVar4 == value_changed [edittext_test1.sc:150]
+PASSED: edtext10.text == AAA [edittext_test1.sc:179]
+PASSED: edtext11.text == BBB [edittext_test1.sc:180]
+PASSED: edtext12.text == CCC [edittext_test1.sc:181]
+PASSED: edtext10.text == BBB [edittext_test1.sc:185]
+PASSED: edtext11.text == CCC [edittext_test1.sc:186]
+PASSED: edtext12.text == AAA [edittext_test1.sc:187]
+PASSED: textVar10 == AAA [edittext_test1.sc:188]
+PASSED: textVar11 == BBB [edittext_test1.sc:189]
+PASSED: textVar12 == CCC [edittext_test1.sc:190]
+PASSED: textVar10 == AAA [edittext_test1.sc:199]
+PASSED: textVar11 == CCC [edittext_test1.sc:200]
+PASSED: textVar12 == BBB [edittext_test1.sc:201]
+Total tests run: 43 typeof expected: number
+#passed: 43
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/gotoFrameFromInterval2.sc b/test/gnash/misc-swfc.all/gotoFrameFromInterval2.sc
new file mode 100644
index 0000000..1d99cbb
--- /dev/null
+++ b/test/gnash/misc-swfc.all/gotoFrameFromInterval2.sc
@@ -0,0 +1,85 @@
+// just like gotoFrameFromInterval, but using gotoAndPlay
+
+.flash bbox=800x600 filename="gotoFrameFromInterval2.swf" version=6 fps=10
+
+.frame 1
+ .action:
+#include "Dejagnu.sc"
+ asOrder = '0+';
+ .end
+
+.frame 2
+ .action:
+ stop();
+
+ function local_whatever() {}
+
+ intervalID = setInterval(
+ function() {
+ if (_currentframe != 2) return;
+ trace("jumping...");
+ gotoAndPlay(6);
+ }
+ ,0.0001);
+
+
+ _root.framecount = 0;
+
+ this.onEnterFrame = function() {
+ _root.framecount++;
+
+ if (_root.framecount==10) {
+ check_equals(_root._currentframe, 6);
+ totals(2);
+ }
+ };
+
+ .end
+
+.frame 6
+ .sprite mc1 // Define a sprite mc1
+ .action:
+ _parent.init_me(this);
+ .end
+ .end
+
+ .action:
+ stop();
+
+ trace("Entering frame 6");
+ clearInterval( intervalID );
+
+ function init_me(obj) {
+ // traces here are just for visual check, can be safely removed.
+ // Please don't use _root.note() here, we don't need extra function calls.
+ trace(obj);
+ trace(obj+" --> 1 =");
+ _root.asOrder += '1+';
+ trace(obj+" --> 2 ==");
+ _root.asOrder += '2+';
+ local_whatever();
+ trace(obj+" --> 3 ===");
+ _root.asOrder += '3+';
+ local_whatever();
+ trace(obj+" --> 4 ====");
+ _root.asOrder += '4+';
+ }
+ .end
+
+ .put clip1=mc1 // place a named sprite clip1
+ .put clip2=mc1 // place a named sprite clip2
+ .put clip3=mc1 // place a named sprite clip3
+
+ .action:
+ check_equals(asOrder, '0+1+2+3+4+1+2+3+4+1+2+3+4+');
+ .end
+
+
+.frame 7
+ .action:
+ stop();
+ note("Entering unreachable frame 7 !");
+ .end
+
+
+.end // end of file
diff --git a/test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf b/test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf
new file mode 100644
index 0000000..d72b8de
Binary files /dev/null and b/test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf differ
diff --git a/test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf.trace b/test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf.trace
new file mode 100644
index 0000000..2399bf1
--- /dev/null
+++ b/test/gnash/misc-swfc.all/gotoFrameFromInterval2.swf.trace
@@ -0,0 +1,23 @@
+jumping...
+Entering frame 6
+_level0.clip1
+_level0.clip1 --> 1 =
+_level0.clip1 --> 2 ==
+_level0.clip1 --> 3 ===
+_level0.clip1 --> 4 ====
+_level0.clip2
+_level0.clip2 --> 1 =
+_level0.clip2 --> 2 ==
+_level0.clip2 --> 3 ===
+_level0.clip2 --> 4 ====
+_level0.clip3
+_level0.clip3 --> 1 =
+_level0.clip3 --> 2 ==
+_level0.clip3 --> 3 ===
+_level0.clip3 --> 4 ====
+PASSED: asOrder == 0+1+2+3+4+1+2+3+4+1+2+3+4+ [gotoFrameFromInterval2.sc:74]
+PASSED: _root._currentframe == 6 [gotoFrameFromInterval2.sc:32]
+Total tests run: 2 typeof expected: number
+#passed: 2
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.sc b/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.sc
new file mode 100644
index 0000000..c502202
--- /dev/null
+++ b/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.sc
@@ -0,0 +1,47 @@
+// testcase for gotoAndXXXX(frame-label) when invoked as AS function
+
+.flash bbox=800x600 filename="gotoFrameLabelAsFunction.swf" version=6 fps=10
+
+.frame 1
+ .action:
+#include "Dejagnu.sc"
+ asOrder = '0+';
+ .end
+
+.frame 2
+ .action:
+
+ this.onEnterFrame = function() {
+ _root.framecount++;
+ if (_root.framecount==10) {
+ check_equals(_root._currentframe, 5);
+ totals(1);
+ }
+ };
+
+ // the "_root." part is important!
+ _root.gotoAndPlay("dest");
+
+ .end
+
+.frame 4
+ .action:
+ trace("reached label 4 (wrong)");
+ check(0);
+ stop();
+ .end
+
+.frame 5 name="dest"
+ .action:
+ trace("reached label 5 (correct)");
+ stop();
+ .end
+
+.frame 6
+ .action:
+ trace("reached label 6 (wrong)");
+ check(0);
+ stop();
+ .end
+
+.end // end of file
diff --git a/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf b/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf
new file mode 100644
index 0000000..bfc4729
Binary files /dev/null and b/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf differ
diff --git a/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf.trace b/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf.trace
new file mode 100644
index 0000000..f2ddd17
--- /dev/null
+++ b/test/gnash/misc-swfc.all/gotoFrameLabelAsFunction.swf.trace
@@ -0,0 +1,6 @@
+reached label 5 (correct)
+PASSED: _root._currentframe == 5 [gotoFrameLabelAsFunction.sc:17]
+Total tests run: 1 typeof expected: number
+#passed: 1
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/mouse_drag_test.sc b/test/gnash/misc-swfc.all/mouse_drag_test.sc
new file mode 100644
index 0000000..79c095a
--- /dev/null
+++ b/test/gnash/misc-swfc.all/mouse_drag_test.sc
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test startDrag and endDrag
+ *
+ * Expected behaviour:
+ *
+ * static movieclips are immune to static transformation after startDrag.
+ */
+
+.flash bbox=800x600 filename="mouse_drag_test.sc" background=white version=6 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+.frame 2
+ .box b1 color=white fill=green width=50 height=50
+ .sprite mc1
+ .put shape1=b1 x=100 y=100
+ .end
+ .put mc1
+
+ .action:
+ // check the existence of mc1.shape1
+ check_equals(typeof(mc1.shape1), 'movieclip');
+ // the name of the shape is evaluated to its parent clip
+ check_equals(mc1.shape1, mc1);
+ mc1.startDrag(true);
+ check_equals(mc1._x, 0);
+ check_equals(mc1._y, 0);
+ .end
+
+.frame 3
+ .jump mc1 x=200 y=200 //MOVE
+ .action:
+ // static transformation does not work after startDrag
+ check(mc1._x != 200);
+ check(mc1._y != 200);
+ mc1.stopDrag();
+ .end
+
+.frame 4
+ .jump mc1 x=300 y=300
+ .action:
+ // static transformation does not work even after stopDrag
+ check(mc1._x != 300);
+ check(mc1._y != 300);
+ .end
+
+.frame 5
+ .action:
+ // enable dragging again, just for visual check.
+ mc1.startDrag(true, 200, 200, 300, 300);
+ .end
+
+.frame 6
+ .action:
+ totals(8);
+ stop();
+ .end
+
+.end // end of the file
+
+
diff --git a/test/gnash/misc-swfc.all/mouse_drag_test.swf b/test/gnash/misc-swfc.all/mouse_drag_test.swf
new file mode 100644
index 0000000..841fcb6
Binary files /dev/null and b/test/gnash/misc-swfc.all/mouse_drag_test.swf differ
diff --git a/test/gnash/misc-swfc.all/mouse_drag_test.swf.trace b/test/gnash/misc-swfc.all/mouse_drag_test.swf.trace
new file mode 100644
index 0000000..b9b5b0b
--- /dev/null
+++ b/test/gnash/misc-swfc.all/mouse_drag_test.swf.trace
@@ -0,0 +1,12 @@
+PASSED: typeof(mc1.shape1) == movieclip [mouse_drag_test.sc:45]
+PASSED: mc1.shape1 == _level0.mc1 [mouse_drag_test.sc:47]
+PASSED: mc1._x == 0 [mouse_drag_test.sc:49]
+PASSED: mc1._y == 0 [mouse_drag_test.sc:50]
+PASSED: [mouse_drag_test.sc:57]
+PASSED: [mouse_drag_test.sc:58]
+PASSED: [mouse_drag_test.sc:66]
+PASSED: [mouse_drag_test.sc:67]
+Total tests run: 8 typeof expected: number
+#passed: 8
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/movieclip_destruction_test4.sc b/test/gnash/misc-swfc.all/movieclip_destruction_test4.sc
new file mode 100644
index 0000000..4e52ec7
--- /dev/null
+++ b/test/gnash/misc-swfc.all/movieclip_destruction_test4.sc
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test destruction of brother movieClips.
+ *
+ * Description:
+ * frame2: Export three movieclips: mc1-->mc11, mc2, mc3-->mc31
+ * frame3: attach 6 brother movieclips: brother{1,2,3,4,5,6}
+ * frame5: brother{1,3,4,5,6} are removed by brother2
+ *
+ * Expected behaviour:
+ * (1)clipA.removeMovieClip() won't shift its parent or child.
+ * (2)unload a parent automatically unload its children.
+ * (3)whether a child should be unreachable(destroyed) after unload
+ * is not dependent its parent's onUnload.
+ * (4)whether a parent should be unreachable(destroyed) after unload
+ * is dependent on its children' onUnload
+ *
+ */
+
+
+.flash bbox=800x600 filename="movieclip_destruction_test4.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ _root.as_order = '0+';
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box green_square fill=green width=100 height=100
+ .box red_square fill=red width=100 height=100
+ .box blue_square fill=blue width=100 height=100
+
+.frame 2
+
+ .sprite mc11
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc11["+this._target+"] (adding green square @ 400,200)");
+ .end
+ .put green_square x=400 y=200
+ .end
+
+ .sprite mc1
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc1["+this._target+"] (adding green square @ 300,200 and mc11)");
+ .end
+ .put green_square x=300 y=200
+ .put mc11
+ .frame 6
+ .end
+
+ .sprite mc2
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc2["+this._target+"] (adding red square)");
+ .end
+ .put red_square x=300 y=300
+ .frame 2
+ .action:
+ _root.note("Running frame2["+this._currentframe+"] actions of mc2["+this._target+"] (nothing new)");
+ .end
+ .frame 3
+ .action:
+ _root.note("Running frame3["+this._currentframe+"] actions of mc2["+this._target+"] (removing brothers 1,3,4,5,6)");
+ _root.brother1['removeMovieClip']();
+ _root.brother3['removeMovieClip']();
+ _root.brother4['removeMovieClip']();
+ _root.brother5['removeMovieClip']();
+ _root.brother6['removeMovieClip']();
+ .end
+ .end
+
+ .sprite mc31
+ .put blue_square x=400 y=400
+ .end
+
+ .sprite mc3
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc3["+this._target+"] (adding blue square)");
+ .end
+ .put blue_square x=300 y=400
+ .put mc31
+ .frame 6
+ .end
+
+
+.frame 3
+ .action:
+ _root.note("Running frame3 actions of _root (attach brothers)");
+ _root.attachMovie("mc1", "brother1", 10);
+ _root.attachMovie("mc2", "brother2", 20);
+ _root.attachMovie("mc3", "brother3", 30);
+ _root.attachMovie("mc3", "brother4", 40);
+ _root.attachMovie("mc3", "brother5", 50);
+ _root.attachMovie("mc3", "brother6", 60);
+
+ // Define a parent onUnload
+ brother4.onUnload = function () {
+ _root.check_equals(this.getDepth(), -32809);
+ // child mc31 has no onUnload defined. child mc31 has been destroyed.
+ // Gnash fails by keeping the child alive(referenceable)
+ _root.check_equals(typeof(this.mc31), 'undefined');
+ };
+
+ // Define child onUnload
+ brother5.mc31.onUnload = function () {
+ // child mc31 has onUnload defined, not shifted.
+ _root.check_equals(this.getDepth(), -16382);
+ _root.check_equals(typeof(this), 'movieclip');
+ _root.check_equals(typeof(this._parent), 'movieclip');
+ _root.check_equals(this._parent.getDepth(), -32819);
+ };
+
+ //
+ // Define both parent onUnload and child onUnload
+ //
+ brother6.onUnload = function () {
+ _root.check_equals(this.getDepth(), -32829);
+ // child mc31 has onUnload defined, not shifted.
+ _root.check_equals(typeof(this.mc31), 'movieclip');
+ _root.check_equals(this.mc31.getDepth(), -16382);
+ };
+
+ brother6.mc31.onUnload = function () {
+ // child mc31 not shifted
+ _root.check_equals(this.getDepth(), -16382);
+ };
+ .end
+
+.frame 4
+ .action:
+ _root.note("Running frame3 actions of _root (nothing new)");
+ .end
+
+
+.frame 5
+ .action:
+ _root.note("Running frame5 actions of _root");
+ check_equals(typeof(brother1), 'undefined');
+ check_equals(typeof(brother2), 'movieclip');
+ check_equals(typeof(brother3), 'undefined');
+ check_equals(typeof(brother4), 'movieclip');
+ check_equals(typeof(brother5), 'movieclip');
+ check_equals(typeof(brother6), 'movieclip');
+ .end
+
+
+.frame 10
+ .action:
+ check_equals(typeof(brother1), 'undefined');
+ check_equals(typeof(brother2), 'movieclip');
+ check_equals(typeof(brother3), 'undefined');
+ stop();
+ totals(19);
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/movieclip_destruction_test4.swf b/test/gnash/misc-swfc.all/movieclip_destruction_test4.swf
new file mode 100644
index 0000000..754181d
Binary files /dev/null and b/test/gnash/misc-swfc.all/movieclip_destruction_test4.swf differ
diff --git a/test/gnash/misc-swfc.all/movieclip_destruction_test4.swf.trace b/test/gnash/misc-swfc.all/movieclip_destruction_test4.swf.trace
new file mode 100644
index 0000000..592c1f4
--- /dev/null
+++ b/test/gnash/misc-swfc.all/movieclip_destruction_test4.swf.trace
@@ -0,0 +1,40 @@
+Running frame3 actions of _root (attach brothers) [movieclip_destruction_test4.sc:111]
+Running frame1[1] actions of mc1[/brother1] (adding green square @ 300,200 and mc11) [movieclip_destruction_test4.sc:66]
+Running frame1[1] actions of mc11[/brother1/mc11] (adding green square @ 400,200) [movieclip_destruction_test4.sc:58]
+Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
+Running frame1[1] actions of mc3[/brother3] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame1[1] actions of mc3[/brother4] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame1[1] actions of mc3[/brother5] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame1[1] actions of mc3[/brother6] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
+Running frame3 actions of _root (nothing new) [movieclip_destruction_test4.sc:154]
+Running frame3[3] actions of mc2[/brother2] (removing brothers 1,3,4,5,6) [movieclip_destruction_test4.sc:85]
+Running frame5 actions of _root [movieclip_destruction_test4.sc:160]
+PASSED: typeof(brother1) == undefined [movieclip_destruction_test4.sc:161]
+PASSED: typeof(brother2) == movieclip [movieclip_destruction_test4.sc:162]
+PASSED: typeof(brother3) == undefined [movieclip_destruction_test4.sc:163]
+PASSED: typeof(brother4) == movieclip [movieclip_destruction_test4.sc:164]
+PASSED: typeof(brother5) == movieclip [movieclip_destruction_test4.sc:165]
+PASSED: typeof(brother6) == movieclip [movieclip_destruction_test4.sc:166]
+PASSED: this.getDepth() == -32809 [movieclip_destruction_test4.sc:121]
+PASSED: typeof(this.mc31) == undefined [movieclip_destruction_test4.sc:124]
+PASSED: this.getDepth() == -16382 [movieclip_destruction_test4.sc:130]
+PASSED: typeof(this) == movieclip [movieclip_destruction_test4.sc:131]
+PASSED: typeof(this._parent) == movieclip [movieclip_destruction_test4.sc:132]
+PASSED: this._parent.getDepth() == -32819 [movieclip_destruction_test4.sc:133]
+PASSED: this.getDepth() == -16382 [movieclip_destruction_test4.sc:148]
+PASSED: this.getDepth() == -32829 [movieclip_destruction_test4.sc:140]
+PASSED: typeof(this.mc31) == movieclip [movieclip_destruction_test4.sc:142]
+PASSED: this.mc31.getDepth() == -16382 [movieclip_destruction_test4.sc:143]
+Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
+Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
+Running frame3[3] actions of mc2[/brother2] (removing brothers 1,3,4,5,6) [movieclip_destruction_test4.sc:85]
+Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
+Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
+PASSED: typeof(brother1) == undefined [movieclip_destruction_test4.sc:172]
+PASSED: typeof(brother2) == movieclip [movieclip_destruction_test4.sc:173]
+PASSED: typeof(brother3) == undefined [movieclip_destruction_test4.sc:174]
+Total tests run: 19 typeof expected: number
+#passed: 19
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/edittext_test1.sc b/test/gnash/misc-swfc.all/pending/edittext_test1.sc
deleted file mode 100644
index 7196176..0000000
--- a/test/gnash/misc-swfc.all/pending/edittext_test1.sc
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- */
-
-
-.flash bbox=800x600 filename="edittext_test1.swf" background=white version=7 fps=1
-
-.frame 1
- .action:
- #include "Dejagnu.sc"
- .end
-
- .edittext edtext1 size=200%
- width=400 height=200
- color=blue border multiline wordwrap
- text="Hello"
- variable="textVar1"
-
- .put edtext1 x=10 y=300
-
- .action:
- // check the initial values
- check_equals(typeof(edtext1), 'object');
- check_equals(edtext1._name, 'edtext1');
- check_equals(edtext1._target, '/edtext1');
- check_equals(edtext1.text, 'Hello');
- check_equals(edtext1.variable, 'textVar1');
- check_equals(_root.textVar1, 'Hello');
- .end
-
-
-.frame 2
- .action:
- // Update the registered variable
- _root.textVar1 = 'new-string-frame2';
- check_equals(_root.textVar1, 'new-string-frame2');
- // The return value of TextField.text also updated
- check_equals(edtext1.text, 'new-string-frame2');
- .end
-
-.frame 3
- .action:
- // Update TextField.text
- edtext1.text = 'new-string-frame3';
- check_equals(edtext1.text, 'new-string-frame3');
- // The return value of the registered variable also updated
- check_equals(edtext1.text, 'new-string-frame3');
- .end
-
-.frame 4
- .action:
- // rename the EditText variable to 'textVar2'
- edtext1.variable = 'textVar2';
- check_equals(_root.hasOwnProperty('textVar2'), true);
- check_equals(edtext1.variable, 'textVar2');
- // textVar2 automatically initialized to 'Hello'
- // (the InitialText in DefineTextField tag, make sense!)
- check_equals(_root.textVar2, 'Hello');
- check_equals(edtext1.text, 'Hello');
- check_equals(_root.textVar1, 'new-string-frame3');
- .end
-
-
-.frame 5
- .action:
- // restore the EditText variable name to 'textVar1'
- edtext1.variable = 'textVar1';
- check_equals(edtext1.variable, 'textVar1');
- // edtext1.text also restore to the value of
- // _root.textVar1(the registered variable)
- check_equals(edtext1.text, 'new-string-frame3');
- .end
-
-
-.frame 6
- .action:
- edtext1.text = 'new-string-frame6';
- check_equals(edtext1.text, 'new-string-frame6');
- check_equals(_root.textVar1, 'new-string-frame6');
-
- // Rename the EditText variable to 'textVar3'
- edtext1.variable = 'textVar3';
- // textVar3 automatically initialized to 'Hello'
- // (the InitialText in DefineTextField tag, make sense!)
- check_equals(_root.textVar3, 'Hello');
- check_equals(_root.textVar1, 'new-string-frame6');
- .end
-
-.frame 7
- .action:
- check_equals(_root.hasOwnProperty('textVar1'), true);
- check_equals(_root.hasOwnProperty('textVar2'), true);
- check_equals(_root.hasOwnProperty('textVar3'), true);
- .end
-
-
-.frame 8
- .del edtext1 // Remove edtext1
- .action:
- // after removing the TextField instance, all registered variables still keep alive
- check_equals(_root.hasOwnProperty('textVar1'), true);
- check_equals(_root.hasOwnProperty('textVar2'), true);
- check_equals(_root.hasOwnProperty('textVar3'), true);
- check_equals(typeof(edtext1), 'undefined');
- .end
-
-//
-// new tests, seperate from the above
-//
-.frame 9
- .action:
- textVar4 = 'new_tests_begin';
- .end
-
-.frame 10
- .edittext edtext2 size=200%
- width=100 height=100
- color=blue border multiline wordwrap
- text="Hello"
- variable="textVar4" // give a name already exists in main timeline.
- .put edtext2 x=10 y=300
- .action:
- // returns the value of the registered variable in main timeline
- check_equals(edtext2.text, 'new_tests_begin');
- .end
-
-
-.frame 11
- .action:
- edtext2.text = 'value_changed';
- check_equals(edtext2.text, 'value_changed');
- check_equals(textVar4, 'value_changed');
- .end
-
-//
-// new tests, seperate from the above
-//
-.frame 12
- .edittext edtext10 size=200%
- width=100 height=100
- color=blue border multiline wordwrap
- text="AAA"
- variable="textVar10"
- .edittext edtext11 size=200%
- width=100 height=100
- color=blue border multiline wordwrap
- text="BBB"
- variable="textVar11"
- .edittext edtext12 size=200%
- width=100 height=100
- color=blue border multiline wordwrap
- text="CCC"
- variable="textVar12"
-
- .put edtext10 x=100 y=300
- .put edtext11 x=100 y=400
- .put edtext12 x=100 y=500
-
-
- .action:
- check_equals(edtext10.text, 'AAA');
- check_equals(edtext11.text, 'BBB');
- check_equals(edtext12.text, 'CCC');
- edtext10.variable = "textVar11";
- edtext11.variable = "textVar12";
- edtext12.variable = "textVar10";
- check_equals(edtext10.text, 'BBB');
- check_equals(edtext11.text, 'CCC');
- check_equals(edtext12.text, 'AAA');
- check_equals(textVar10, 'AAA');
- check_equals(textVar11, 'BBB');
- check_equals(textVar12, 'CCC');
- .end
-
-
-.frame 13
- .action:
- edtext10.text = 'CCC';
- edtext11.text = 'BBB';
- edtext12.text = 'AAA';
- check_equals(textVar10, 'AAA');
- check_equals(textVar11, 'CCC');
- check_equals(textVar12, 'BBB');
- .end
-
-.frame 15
- .action:
- totals(43);
- stop();
- .end
-
-
-.end // file end
-
diff --git a/test/gnash/misc-swfc.all/pending/edittext_test1.swf b/test/gnash/misc-swfc.all/pending/edittext_test1.swf
deleted file mode 100644
index ed4c18c..0000000
Binary files a/test/gnash/misc-swfc.all/pending/edittext_test1.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/edittext_test1.swf.trace b/test/gnash/misc-swfc.all/pending/edittext_test1.swf.trace
deleted file mode 100644
index e4205be..0000000
--- a/test/gnash/misc-swfc.all/pending/edittext_test1.swf.trace
+++ /dev/null
@@ -1,47 +0,0 @@
-PASSED: typeof(edtext1) == object [edittext_test1.sc:41]
-PASSED: edtext1._name == edtext1 [edittext_test1.sc:42]
-PASSED: edtext1._target == /edtext1 [edittext_test1.sc:43]
-PASSED: edtext1.text == Hello [edittext_test1.sc:44]
-PASSED: edtext1.variable == textVar1 [edittext_test1.sc:45]
-PASSED: _root.textVar1 == Hello [edittext_test1.sc:46]
-PASSED: _root.textVar1 == new-string-frame2 [edittext_test1.sc:54]
-PASSED: edtext1.text == new-string-frame2 [edittext_test1.sc:56]
-PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:63]
-PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:65]
-PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:72]
-PASSED: edtext1.variable == textVar2 [edittext_test1.sc:73]
-PASSED: _root.textVar2 == Hello [edittext_test1.sc:76]
-PASSED: edtext1.text == Hello [edittext_test1.sc:77]
-PASSED: _root.textVar1 == new-string-frame3 [edittext_test1.sc:78]
-PASSED: edtext1.variable == textVar1 [edittext_test1.sc:86]
-PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:89]
-PASSED: edtext1.text == new-string-frame6 [edittext_test1.sc:96]
-PASSED: _root.textVar1 == new-string-frame6 [edittext_test1.sc:97]
-PASSED: _root.textVar3 == Hello [edittext_test1.sc:103]
-PASSED: _root.textVar1 == new-string-frame6 [edittext_test1.sc:104]
-PASSED: _root.hasOwnProperty('textVar1') == true [edittext_test1.sc:109]
-PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:110]
-PASSED: _root.hasOwnProperty('textVar3') == true [edittext_test1.sc:111]
-PASSED: _root.hasOwnProperty('textVar1') == true [edittext_test1.sc:119]
-PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:120]
-PASSED: _root.hasOwnProperty('textVar3') == true [edittext_test1.sc:121]
-PASSED: typeof(edtext1) == undefined [edittext_test1.sc:122]
-PASSED: edtext2.text == new_tests_begin [edittext_test1.sc:142]
-PASSED: edtext2.text == value_changed [edittext_test1.sc:149]
-PASSED: textVar4 == value_changed [edittext_test1.sc:150]
-PASSED: edtext10.text == AAA [edittext_test1.sc:179]
-PASSED: edtext11.text == BBB [edittext_test1.sc:180]
-PASSED: edtext12.text == CCC [edittext_test1.sc:181]
-PASSED: edtext10.text == BBB [edittext_test1.sc:185]
-PASSED: edtext11.text == CCC [edittext_test1.sc:186]
-PASSED: edtext12.text == AAA [edittext_test1.sc:187]
-PASSED: textVar10 == AAA [edittext_test1.sc:188]
-PASSED: textVar11 == BBB [edittext_test1.sc:189]
-PASSED: textVar12 == CCC [edittext_test1.sc:190]
-PASSED: textVar10 == AAA [edittext_test1.sc:199]
-PASSED: textVar11 == CCC [edittext_test1.sc:200]
-PASSED: textVar12 == BBB [edittext_test1.sc:201]
-Total tests run: 43 typeof expected: number
-#passed: 43
-#failed: 0
-__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.sc b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.sc
deleted file mode 100644
index 1d99cbb..0000000
--- a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.sc
+++ /dev/null
@@ -1,85 +0,0 @@
-// just like gotoFrameFromInterval, but using gotoAndPlay
-
-.flash bbox=800x600 filename="gotoFrameFromInterval2.swf" version=6 fps=10
-
-.frame 1
- .action:
-#include "Dejagnu.sc"
- asOrder = '0+';
- .end
-
-.frame 2
- .action:
- stop();
-
- function local_whatever() {}
-
- intervalID = setInterval(
- function() {
- if (_currentframe != 2) return;
- trace("jumping...");
- gotoAndPlay(6);
- }
- ,0.0001);
-
-
- _root.framecount = 0;
-
- this.onEnterFrame = function() {
- _root.framecount++;
-
- if (_root.framecount==10) {
- check_equals(_root._currentframe, 6);
- totals(2);
- }
- };
-
- .end
-
-.frame 6
- .sprite mc1 // Define a sprite mc1
- .action:
- _parent.init_me(this);
- .end
- .end
-
- .action:
- stop();
-
- trace("Entering frame 6");
- clearInterval( intervalID );
-
- function init_me(obj) {
- // traces here are just for visual check, can be safely removed.
- // Please don't use _root.note() here, we don't need extra function calls.
- trace(obj);
- trace(obj+" --> 1 =");
- _root.asOrder += '1+';
- trace(obj+" --> 2 ==");
- _root.asOrder += '2+';
- local_whatever();
- trace(obj+" --> 3 ===");
- _root.asOrder += '3+';
- local_whatever();
- trace(obj+" --> 4 ====");
- _root.asOrder += '4+';
- }
- .end
-
- .put clip1=mc1 // place a named sprite clip1
- .put clip2=mc1 // place a named sprite clip2
- .put clip3=mc1 // place a named sprite clip3
-
- .action:
- check_equals(asOrder, '0+1+2+3+4+1+2+3+4+1+2+3+4+');
- .end
-
-
-.frame 7
- .action:
- stop();
- note("Entering unreachable frame 7 !");
- .end
-
-
-.end // end of file
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf
deleted file mode 100644
index d72b8de..0000000
Binary files a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf.trace b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf.trace
deleted file mode 100644
index 2399bf1..0000000
--- a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf.trace
+++ /dev/null
@@ -1,23 +0,0 @@
-jumping...
-Entering frame 6
-_level0.clip1
-_level0.clip1 --> 1 =
-_level0.clip1 --> 2 ==
-_level0.clip1 --> 3 ===
-_level0.clip1 --> 4 ====
-_level0.clip2
-_level0.clip2 --> 1 =
-_level0.clip2 --> 2 ==
-_level0.clip2 --> 3 ===
-_level0.clip2 --> 4 ====
-_level0.clip3
-_level0.clip3 --> 1 =
-_level0.clip3 --> 2 ==
-_level0.clip3 --> 3 ===
-_level0.clip3 --> 4 ====
-PASSED: asOrder == 0+1+2+3+4+1+2+3+4+1+2+3+4+ [gotoFrameFromInterval2.sc:74]
-PASSED: _root._currentframe == 6 [gotoFrameFromInterval2.sc:32]
-Total tests run: 2 typeof expected: number
-#passed: 2
-#failed: 0
-__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.sc b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.sc
deleted file mode 100644
index c502202..0000000
--- a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.sc
+++ /dev/null
@@ -1,47 +0,0 @@
-// testcase for gotoAndXXXX(frame-label) when invoked as AS function
-
-.flash bbox=800x600 filename="gotoFrameLabelAsFunction.swf" version=6 fps=10
-
-.frame 1
- .action:
-#include "Dejagnu.sc"
- asOrder = '0+';
- .end
-
-.frame 2
- .action:
-
- this.onEnterFrame = function() {
- _root.framecount++;
- if (_root.framecount==10) {
- check_equals(_root._currentframe, 5);
- totals(1);
- }
- };
-
- // the "_root." part is important!
- _root.gotoAndPlay("dest");
-
- .end
-
-.frame 4
- .action:
- trace("reached label 4 (wrong)");
- check(0);
- stop();
- .end
-
-.frame 5 name="dest"
- .action:
- trace("reached label 5 (correct)");
- stop();
- .end
-
-.frame 6
- .action:
- trace("reached label 6 (wrong)");
- check(0);
- stop();
- .end
-
-.end // end of file
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf
deleted file mode 100644
index bfc4729..0000000
Binary files a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf.trace b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf.trace
deleted file mode 100644
index f2ddd17..0000000
--- a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf.trace
+++ /dev/null
@@ -1,6 +0,0 @@
-reached label 5 (correct)
-PASSED: _root._currentframe == 5 [gotoFrameLabelAsFunction.sc:17]
-Total tests run: 1 typeof expected: number
-#passed: 1
-#failed: 0
-__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/mouse_drag_test.sc b/test/gnash/misc-swfc.all/pending/mouse_drag_test.sc
deleted file mode 100644
index 79c095a..0000000
--- a/test/gnash/misc-swfc.all/pending/mouse_drag_test.sc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * Test startDrag and endDrag
- *
- * Expected behaviour:
- *
- * static movieclips are immune to static transformation after startDrag.
- */
-
-.flash bbox=800x600 filename="mouse_drag_test.sc" background=white version=6 fps=12
-
-.frame 1
- .action:
- #include "Dejagnu.sc"
- .end
-
-.frame 2
- .box b1 color=white fill=green width=50 height=50
- .sprite mc1
- .put shape1=b1 x=100 y=100
- .end
- .put mc1
-
- .action:
- // check the existence of mc1.shape1
- check_equals(typeof(mc1.shape1), 'movieclip');
- // the name of the shape is evaluated to its parent clip
- check_equals(mc1.shape1, mc1);
- mc1.startDrag(true);
- check_equals(mc1._x, 0);
- check_equals(mc1._y, 0);
- .end
-
-.frame 3
- .jump mc1 x=200 y=200 //MOVE
- .action:
- // static transformation does not work after startDrag
- check(mc1._x != 200);
- check(mc1._y != 200);
- mc1.stopDrag();
- .end
-
-.frame 4
- .jump mc1 x=300 y=300
- .action:
- // static transformation does not work even after stopDrag
- check(mc1._x != 300);
- check(mc1._y != 300);
- .end
-
-.frame 5
- .action:
- // enable dragging again, just for visual check.
- mc1.startDrag(true, 200, 200, 300, 300);
- .end
-
-.frame 6
- .action:
- totals(8);
- stop();
- .end
-
-.end // end of the file
-
-
diff --git a/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf b/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf
deleted file mode 100644
index 841fcb6..0000000
Binary files a/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf.trace b/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf.trace
deleted file mode 100644
index b9b5b0b..0000000
--- a/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf.trace
+++ /dev/null
@@ -1,12 +0,0 @@
-PASSED: typeof(mc1.shape1) == movieclip [mouse_drag_test.sc:45]
-PASSED: mc1.shape1 == _level0.mc1 [mouse_drag_test.sc:47]
-PASSED: mc1._x == 0 [mouse_drag_test.sc:49]
-PASSED: mc1._y == 0 [mouse_drag_test.sc:50]
-PASSED: [mouse_drag_test.sc:57]
-PASSED: [mouse_drag_test.sc:58]
-PASSED: [mouse_drag_test.sc:66]
-PASSED: [mouse_drag_test.sc:67]
-Total tests run: 8 typeof expected: number
-#passed: 8
-#failed: 0
-__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.sc b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.sc
deleted file mode 100644
index 4e52ec7..0000000
--- a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.sc
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * Test destruction of brother movieClips.
- *
- * Description:
- * frame2: Export three movieclips: mc1-->mc11, mc2, mc3-->mc31
- * frame3: attach 6 brother movieclips: brother{1,2,3,4,5,6}
- * frame5: brother{1,3,4,5,6} are removed by brother2
- *
- * Expected behaviour:
- * (1)clipA.removeMovieClip() won't shift its parent or child.
- * (2)unload a parent automatically unload its children.
- * (3)whether a child should be unreachable(destroyed) after unload
- * is not dependent its parent's onUnload.
- * (4)whether a parent should be unreachable(destroyed) after unload
- * is dependent on its children' onUnload
- *
- */
-
-
-.flash bbox=800x600 filename="movieclip_destruction_test4.swf" background=white version=7 fps=12
-
-.frame 1
- .action:
- #include "Dejagnu.sc"
- _root.as_order = '0+';
- .end
-
- // Define 3 shapes(b1, b2, b3)
- .box green_square fill=green width=100 height=100
- .box red_square fill=red width=100 height=100
- .box blue_square fill=blue width=100 height=100
-
-.frame 2
-
- .sprite mc11
- .frame 1
- .action:
- _root.note("Running frame1["+this._currentframe+"] actions of mc11["+this._target+"] (adding green square @ 400,200)");
- .end
- .put green_square x=400 y=200
- .end
-
- .sprite mc1
- .frame 1
- .action:
- _root.note("Running frame1["+this._currentframe+"] actions of mc1["+this._target+"] (adding green square @ 300,200 and mc11)");
- .end
- .put green_square x=300 y=200
- .put mc11
- .frame 6
- .end
-
- .sprite mc2
- .frame 1
- .action:
- _root.note("Running frame1["+this._currentframe+"] actions of mc2["+this._target+"] (adding red square)");
- .end
- .put red_square x=300 y=300
- .frame 2
- .action:
- _root.note("Running frame2["+this._currentframe+"] actions of mc2["+this._target+"] (nothing new)");
- .end
- .frame 3
- .action:
- _root.note("Running frame3["+this._currentframe+"] actions of mc2["+this._target+"] (removing brothers 1,3,4,5,6)");
- _root.brother1['removeMovieClip']();
- _root.brother3['removeMovieClip']();
- _root.brother4['removeMovieClip']();
- _root.brother5['removeMovieClip']();
- _root.brother6['removeMovieClip']();
- .end
- .end
-
- .sprite mc31
- .put blue_square x=400 y=400
- .end
-
- .sprite mc3
- .frame 1
- .action:
- _root.note("Running frame1["+this._currentframe+"] actions of mc3["+this._target+"] (adding blue square)");
- .end
- .put blue_square x=300 y=400
- .put mc31
- .frame 6
- .end
-
-
-.frame 3
- .action:
- _root.note("Running frame3 actions of _root (attach brothers)");
- _root.attachMovie("mc1", "brother1", 10);
- _root.attachMovie("mc2", "brother2", 20);
- _root.attachMovie("mc3", "brother3", 30);
- _root.attachMovie("mc3", "brother4", 40);
- _root.attachMovie("mc3", "brother5", 50);
- _root.attachMovie("mc3", "brother6", 60);
-
- // Define a parent onUnload
- brother4.onUnload = function () {
- _root.check_equals(this.getDepth(), -32809);
- // child mc31 has no onUnload defined. child mc31 has been destroyed.
- // Gnash fails by keeping the child alive(referenceable)
- _root.check_equals(typeof(this.mc31), 'undefined');
- };
-
- // Define child onUnload
- brother5.mc31.onUnload = function () {
- // child mc31 has onUnload defined, not shifted.
- _root.check_equals(this.getDepth(), -16382);
- _root.check_equals(typeof(this), 'movieclip');
- _root.check_equals(typeof(this._parent), 'movieclip');
- _root.check_equals(this._parent.getDepth(), -32819);
- };
-
- //
- // Define both parent onUnload and child onUnload
- //
- brother6.onUnload = function () {
- _root.check_equals(this.getDepth(), -32829);
- // child mc31 has onUnload defined, not shifted.
- _root.check_equals(typeof(this.mc31), 'movieclip');
- _root.check_equals(this.mc31.getDepth(), -16382);
- };
-
- brother6.mc31.onUnload = function () {
- // child mc31 not shifted
- _root.check_equals(this.getDepth(), -16382);
- };
- .end
-
-.frame 4
- .action:
- _root.note("Running frame3 actions of _root (nothing new)");
- .end
-
-
-.frame 5
- .action:
- _root.note("Running frame5 actions of _root");
- check_equals(typeof(brother1), 'undefined');
- check_equals(typeof(brother2), 'movieclip');
- check_equals(typeof(brother3), 'undefined');
- check_equals(typeof(brother4), 'movieclip');
- check_equals(typeof(brother5), 'movieclip');
- check_equals(typeof(brother6), 'movieclip');
- .end
-
-
-.frame 10
- .action:
- check_equals(typeof(brother1), 'undefined');
- check_equals(typeof(brother2), 'movieclip');
- check_equals(typeof(brother3), 'undefined');
- stop();
- totals(19);
- .end
-
-.end
-
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf
deleted file mode 100644
index 754181d..0000000
Binary files a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf.trace b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf.trace
deleted file mode 100644
index 592c1f4..0000000
--- a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf.trace
+++ /dev/null
@@ -1,40 +0,0 @@
-Running frame3 actions of _root (attach brothers) [movieclip_destruction_test4.sc:111]
-Running frame1[1] actions of mc1[/brother1] (adding green square @ 300,200 and mc11) [movieclip_destruction_test4.sc:66]
-Running frame1[1] actions of mc11[/brother1/mc11] (adding green square @ 400,200) [movieclip_destruction_test4.sc:58]
-Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
-Running frame1[1] actions of mc3[/brother3] (adding blue square) [movieclip_destruction_test4.sc:101]
-Running frame1[1] actions of mc3[/brother4] (adding blue square) [movieclip_destruction_test4.sc:101]
-Running frame1[1] actions of mc3[/brother5] (adding blue square) [movieclip_destruction_test4.sc:101]
-Running frame1[1] actions of mc3[/brother6] (adding blue square) [movieclip_destruction_test4.sc:101]
-Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
-Running frame3 actions of _root (nothing new) [movieclip_destruction_test4.sc:154]
-Running frame3[3] actions of mc2[/brother2] (removing brothers 1,3,4,5,6) [movieclip_destruction_test4.sc:85]
-Running frame5 actions of _root [movieclip_destruction_test4.sc:160]
-PASSED: typeof(brother1) == undefined [movieclip_destruction_test4.sc:161]
-PASSED: typeof(brother2) == movieclip [movieclip_destruction_test4.sc:162]
-PASSED: typeof(brother3) == undefined [movieclip_destruction_test4.sc:163]
-PASSED: typeof(brother4) == movieclip [movieclip_destruction_test4.sc:164]
-PASSED: typeof(brother5) == movieclip [movieclip_destruction_test4.sc:165]
-PASSED: typeof(brother6) == movieclip [movieclip_destruction_test4.sc:166]
-PASSED: this.getDepth() == -32809 [movieclip_destruction_test4.sc:121]
-PASSED: typeof(this.mc31) == undefined [movieclip_destruction_test4.sc:124]
-PASSED: this.getDepth() == -16382 [movieclip_destruction_test4.sc:130]
-PASSED: typeof(this) == movieclip [movieclip_destruction_test4.sc:131]
-PASSED: typeof(this._parent) == movieclip [movieclip_destruction_test4.sc:132]
-PASSED: this._parent.getDepth() == -32819 [movieclip_destruction_test4.sc:133]
-PASSED: this.getDepth() == -16382 [movieclip_destruction_test4.sc:148]
-PASSED: this.getDepth() == -32829 [movieclip_destruction_test4.sc:140]
-PASSED: typeof(this.mc31) == movieclip [movieclip_destruction_test4.sc:142]
-PASSED: this.mc31.getDepth() == -16382 [movieclip_destruction_test4.sc:143]
-Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
-Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
-Running frame3[3] actions of mc2[/brother2] (removing brothers 1,3,4,5,6) [movieclip_destruction_test4.sc:85]
-Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
-Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
-PASSED: typeof(brother1) == undefined [movieclip_destruction_test4.sc:172]
-PASSED: typeof(brother2) == movieclip [movieclip_destruction_test4.sc:173]
-PASSED: typeof(brother3) == undefined [movieclip_destruction_test4.sc:174]
-Total tests run: 19 typeof expected: number
-#passed: 19
-#failed: 0
-__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/registerclass_test3.sc b/test/gnash/misc-swfc.all/pending/registerclass_test3.sc
deleted file mode 100644
index 95a0462..0000000
--- a/test/gnash/misc-swfc.all/pending/registerclass_test3.sc
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2007 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-/*
- * Zou Lunkai, zoulunkai at gmail.com
- *
- * Test registerClass
- *
- * Description:
- * frame1: tests simulate the layout of youtube player2.swf
- * frame2: export libItem1, export libItem2
- * frame3: DoInitAction(libItem1), DoInitAction(libItem2), PlaceObject(libItem2)
- * "Object.registerClass('libItem1', theClass1)" is called in DoInitAction(libItem1)
- * "Object.registerClass('libItem2', theClass2)" is called in DoInitAction(libItem2)
- * Observed:
- * the effect of "Object.registerClass('libItem2', theClass2)" is not visible
- * in DoInitAction(libItem2). Note: there's no attachMovie for libItem2 in DoInitAction(libItem2)
- */
-
-// use swf6 for case sensitiviness
-.flash bbox=800x600 filename="registerclass_test3.sc" background=white version=6 fps=12
-
-.frame 1
- .box b1 fill=green width=100 height=100
-
- .sprite xxx
- .end
-
- .initaction xxx:
- // make sure Dejagnu is available in the first frame
- #include "Dejagnu.sc"
- .end
-
- // Define fullDisplay and export it
- .sprite fullDisplay
- .end
-
- .action:
- note("root DoAction of frame1");
- check_equals(typeof(player.movie), 'movieclip');
- check_equals(player.movie.__proto__, logic_Movie.prototype);
- player.movie.setMovie();
- check_equals(_root.testvar, 100);
- .end
-
- .sprite id141
- // Place a child sprite name it as 'movie'
- .put movie=fullDisplay
- .end
-
- .initaction id141:
- note("root first InitAction of frame1 (where we check if object placed after is visible)");
- check_equals(typeof(player.movie), 'movieclip');
- check_equals(player.movie.__proto__, MovieClip.prototype);
- .end
-
- // Place sprite id141 and name it as 'player'
- .put player=id141
-
- // Define _Packages.logic.Movie and export it
- .sprite _Packages.logic.Movie
- .end
-
- // Define class logic_Movie
- .initaction _Packages.logic.Movie:
- note("root second InitAction of frame1 (where the class is defined)");
- check_equals(typeof(player.movie), 'movieclip');
- check_equals(player.movie.__proto__, MovieClip.prototype);
- logic_Movie = function() {};
- logic_Movie.prototype = new MovieClip();
- logic_Movie.prototype.setMovie = function () { _root.testvar = 100; };
- .end
-
- // register sprite player.movie to class logic_Movie
- .initaction fullDisplay:
- note("root third InitAction of frame1 (where registerClass is invoked)");
- Object.registerClass("fullDisplay", logic_Movie);
- .end
-
-
-.frame 2
- .sprite child1
- .put b1 x=100 y=100
- .end
-
- .sprite child2
- .put b1 x=100 y=200
- .end
-
- .sprite libItem1 // Define a sprite libItem1
- .put child1
- .end
- .sprite libItem2 // Define a sprite libItem2
- .put child2
- .end
-
-
-.frame 3
-
- .action:
- // registerClass effects are visible here
- check_equals(libItem2.__proto__, theClass2.prototype);
- .end
-
- .initaction libItem1:
- theClass1 = function() { this.testvar = 60;};
- theClass1.prototype = new MovieClip();
- Object.registerClass('libItem1', theClass1);
-
- _root.attachMovie('libItem1', 'clip1', 10);
- check_equals(typeof(clip1), 'movieclip');
- check_equals(clip1.__proto__, theClass1.prototype);
-
- clip1.duplicateMovieClip("dup1", 10);
- check_equals(typeof(dup1), 'movieclip');
- check_equals(dup1.__proto__, theClass1.prototype);
- check_equals(dup1.testvar, 60);
-
- // sprite libItem1 never placed.
- check_equals(typeof(libItem1), 'undefined');
- .end
- .initaction libItem2:
- theClass2 = function() { this.testvar = 60;};
- theClass2.prototype = new MovieClip();
- Object.registerClass('libItem2', theClass2);
-
- // Gnash failed by executing init actions before DLIST tags.
- check_equals(typeof(libItem2), 'movieclip');
- check_equals(libItem2.__proto__, MovieClip.prototype);
- check_equals(libItem2.__proto__, MovieClip.prototype);
-
- // Childs of libItem2 have also been placed already
- // Gnash fails by executing init actions before frame0 tags
- check_equals(typeof(libItem2.child2), 'movieclip');
- .end
-
- .put libItem2
-
-.frame 4
- .action:
- check_equals(libItem2.__proto__, theClass2.prototype);
- .end
-
-.frame 5
- .action:
- totals(19);
- stop();
- .end
-
-
-.end // end of the file
-
-
diff --git a/test/gnash/misc-swfc.all/pending/registerclass_test3.swf b/test/gnash/misc-swfc.all/pending/registerclass_test3.swf
deleted file mode 100644
index 1ee0aff..0000000
Binary files a/test/gnash/misc-swfc.all/pending/registerclass_test3.swf and /dev/null differ
diff --git a/test/gnash/misc-swfc.all/pending/registerclass_test3.swf.trace b/test/gnash/misc-swfc.all/pending/registerclass_test3.swf.trace
deleted file mode 100644
index e8c4d94..0000000
--- a/test/gnash/misc-swfc.all/pending/registerclass_test3.swf.trace
+++ /dev/null
@@ -1,27 +0,0 @@
-root first InitAction of frame1 (where we check if object placed after is visible) [registerclass_test3.sc:67]
-PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:68]
-PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:69]
-root second InitAction of frame1 (where the class is defined) [registerclass_test3.sc:81]
-PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:82]
-PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:83]
-root third InitAction of frame1 (where registerClass is invoked) [registerclass_test3.sc:91]
-root DoAction of frame1 [registerclass_test3.sc:54]
-PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:55]
-PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:56]
-PASSED: _root.testvar == 100 [registerclass_test3.sc:58]
-PASSED: typeof(clip1) == movieclip [registerclass_test3.sc:126]
-PASSED: clip1.__proto__ == [object Object] [registerclass_test3.sc:127]
-PASSED: typeof(dup1) == movieclip [registerclass_test3.sc:130]
-PASSED: dup1.__proto__ == [object Object] [registerclass_test3.sc:131]
-PASSED: dup1.testvar == 60 [registerclass_test3.sc:132]
-PASSED: typeof(libItem1) == undefined [registerclass_test3.sc:135]
-PASSED: typeof(libItem2) == movieclip [registerclass_test3.sc:143]
-PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:144]
-PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:145]
-PASSED: typeof(libItem2.child2) == movieclip [registerclass_test3.sc:149]
-PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:117]
-PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:156]
-Total tests run: 19 typeof expected: number
-#passed: 19
-#failed: 0
-__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/registerclass_test3.sc b/test/gnash/misc-swfc.all/registerclass_test3.sc
new file mode 100644
index 0000000..95a0462
--- /dev/null
+++ b/test/gnash/misc-swfc.all/registerclass_test3.sc
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test registerClass
+ *
+ * Description:
+ * frame1: tests simulate the layout of youtube player2.swf
+ * frame2: export libItem1, export libItem2
+ * frame3: DoInitAction(libItem1), DoInitAction(libItem2), PlaceObject(libItem2)
+ * "Object.registerClass('libItem1', theClass1)" is called in DoInitAction(libItem1)
+ * "Object.registerClass('libItem2', theClass2)" is called in DoInitAction(libItem2)
+ * Observed:
+ * the effect of "Object.registerClass('libItem2', theClass2)" is not visible
+ * in DoInitAction(libItem2). Note: there's no attachMovie for libItem2 in DoInitAction(libItem2)
+ */
+
+// use swf6 for case sensitiviness
+.flash bbox=800x600 filename="registerclass_test3.sc" background=white version=6 fps=12
+
+.frame 1
+ .box b1 fill=green width=100 height=100
+
+ .sprite xxx
+ .end
+
+ .initaction xxx:
+ // make sure Dejagnu is available in the first frame
+ #include "Dejagnu.sc"
+ .end
+
+ // Define fullDisplay and export it
+ .sprite fullDisplay
+ .end
+
+ .action:
+ note("root DoAction of frame1");
+ check_equals(typeof(player.movie), 'movieclip');
+ check_equals(player.movie.__proto__, logic_Movie.prototype);
+ player.movie.setMovie();
+ check_equals(_root.testvar, 100);
+ .end
+
+ .sprite id141
+ // Place a child sprite name it as 'movie'
+ .put movie=fullDisplay
+ .end
+
+ .initaction id141:
+ note("root first InitAction of frame1 (where we check if object placed after is visible)");
+ check_equals(typeof(player.movie), 'movieclip');
+ check_equals(player.movie.__proto__, MovieClip.prototype);
+ .end
+
+ // Place sprite id141 and name it as 'player'
+ .put player=id141
+
+ // Define _Packages.logic.Movie and export it
+ .sprite _Packages.logic.Movie
+ .end
+
+ // Define class logic_Movie
+ .initaction _Packages.logic.Movie:
+ note("root second InitAction of frame1 (where the class is defined)");
+ check_equals(typeof(player.movie), 'movieclip');
+ check_equals(player.movie.__proto__, MovieClip.prototype);
+ logic_Movie = function() {};
+ logic_Movie.prototype = new MovieClip();
+ logic_Movie.prototype.setMovie = function () { _root.testvar = 100; };
+ .end
+
+ // register sprite player.movie to class logic_Movie
+ .initaction fullDisplay:
+ note("root third InitAction of frame1 (where registerClass is invoked)");
+ Object.registerClass("fullDisplay", logic_Movie);
+ .end
+
+
+.frame 2
+ .sprite child1
+ .put b1 x=100 y=100
+ .end
+
+ .sprite child2
+ .put b1 x=100 y=200
+ .end
+
+ .sprite libItem1 // Define a sprite libItem1
+ .put child1
+ .end
+ .sprite libItem2 // Define a sprite libItem2
+ .put child2
+ .end
+
+
+.frame 3
+
+ .action:
+ // registerClass effects are visible here
+ check_equals(libItem2.__proto__, theClass2.prototype);
+ .end
+
+ .initaction libItem1:
+ theClass1 = function() { this.testvar = 60;};
+ theClass1.prototype = new MovieClip();
+ Object.registerClass('libItem1', theClass1);
+
+ _root.attachMovie('libItem1', 'clip1', 10);
+ check_equals(typeof(clip1), 'movieclip');
+ check_equals(clip1.__proto__, theClass1.prototype);
+
+ clip1.duplicateMovieClip("dup1", 10);
+ check_equals(typeof(dup1), 'movieclip');
+ check_equals(dup1.__proto__, theClass1.prototype);
+ check_equals(dup1.testvar, 60);
+
+ // sprite libItem1 never placed.
+ check_equals(typeof(libItem1), 'undefined');
+ .end
+ .initaction libItem2:
+ theClass2 = function() { this.testvar = 60;};
+ theClass2.prototype = new MovieClip();
+ Object.registerClass('libItem2', theClass2);
+
+ // Gnash failed by executing init actions before DLIST tags.
+ check_equals(typeof(libItem2), 'movieclip');
+ check_equals(libItem2.__proto__, MovieClip.prototype);
+ check_equals(libItem2.__proto__, MovieClip.prototype);
+
+ // Childs of libItem2 have also been placed already
+ // Gnash fails by executing init actions before frame0 tags
+ check_equals(typeof(libItem2.child2), 'movieclip');
+ .end
+
+ .put libItem2
+
+.frame 4
+ .action:
+ check_equals(libItem2.__proto__, theClass2.prototype);
+ .end
+
+.frame 5
+ .action:
+ totals(19);
+ stop();
+ .end
+
+
+.end // end of the file
+
+
diff --git a/test/gnash/misc-swfc.all/registerclass_test3.swf b/test/gnash/misc-swfc.all/registerclass_test3.swf
new file mode 100644
index 0000000..1ee0aff
Binary files /dev/null and b/test/gnash/misc-swfc.all/registerclass_test3.swf differ
diff --git a/test/gnash/misc-swfc.all/registerclass_test3.swf.trace b/test/gnash/misc-swfc.all/registerclass_test3.swf.trace
new file mode 100644
index 0000000..e8c4d94
--- /dev/null
+++ b/test/gnash/misc-swfc.all/registerclass_test3.swf.trace
@@ -0,0 +1,27 @@
+root first InitAction of frame1 (where we check if object placed after is visible) [registerclass_test3.sc:67]
+PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:68]
+PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:69]
+root second InitAction of frame1 (where the class is defined) [registerclass_test3.sc:81]
+PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:82]
+PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:83]
+root third InitAction of frame1 (where registerClass is invoked) [registerclass_test3.sc:91]
+root DoAction of frame1 [registerclass_test3.sc:54]
+PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:55]
+PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:56]
+PASSED: _root.testvar == 100 [registerclass_test3.sc:58]
+PASSED: typeof(clip1) == movieclip [registerclass_test3.sc:126]
+PASSED: clip1.__proto__ == [object Object] [registerclass_test3.sc:127]
+PASSED: typeof(dup1) == movieclip [registerclass_test3.sc:130]
+PASSED: dup1.__proto__ == [object Object] [registerclass_test3.sc:131]
+PASSED: dup1.testvar == 60 [registerclass_test3.sc:132]
+PASSED: typeof(libItem1) == undefined [registerclass_test3.sc:135]
+PASSED: typeof(libItem2) == movieclip [registerclass_test3.sc:143]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:144]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:145]
+PASSED: typeof(libItem2.child2) == movieclip [registerclass_test3.sc:149]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:117]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:156]
+Total tests run: 19 typeof expected: number
+#passed: 19
+#failed: 0
+__END_OF_TEST__
commit 11a8ba221c1b20e7b97af4811ba9548b7d862213
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri Jul 11 10:13:41 2008 +0300
Import tests from Gnash's misc-swfc.all directory
diff --git a/configure.ac b/configure.ac
index c37afc6..6174d3a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -295,6 +295,7 @@ test/custom/Makefile
test/gnash/Makefile
test/gnash/media/Makefile
test/gnash/actionscript.all/Makefile
+test/gnash/misc-swfc.all/Makefile
test/image/Makefile
test/sound/Makefile
test/trace/Makefile
diff --git a/test/gnash/Makefile.am b/test/gnash/Makefile.am
index f5e0f73..6623dcc 100644
--- a/test/gnash/Makefile.am
+++ b/test/gnash/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = actionscript.all media
+SUBDIRS = actionscript.all media misc-swfc.all
EXTRA_DIST = \
COPYING \
diff --git a/test/gnash/misc-swfc.all/Dejagnu.sc b/test/gnash/misc-swfc.all/Dejagnu.sc
new file mode 100644
index 0000000..82a0dbb
--- /dev/null
+++ b/test/gnash/misc-swfc.all/Dejagnu.sc
@@ -0,0 +1,183 @@
+ // Dejagnu.sc - SWFC script for dejagnu-like testing.
+ //
+ // Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ //
+ // This program is free software; you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ //
+ // This program 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 General Public License for more details.
+ //
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ //
+ //
+ // Original author: David Rorex - drorex at gmail.com
+ //
+ //
+
+ _root.Dejagnu = _global.Dejagnu = {
+ passed:0,
+ failed:0,
+ xpassed:0,
+ xfailed:0,
+ untest:0,
+ unresolve:0,
+
+ fail : function (why) {
+ this.failed++;
+ var msg = 'FAILED: '+why;
+ this.xtrace(msg);
+ },
+
+ xfail: function (why) {
+ this.xfailed++;
+ var msg = 'XFAILED: '+why;
+ this.xtrace(msg);
+ },
+
+ pass: function (why) {
+ this.passed++;
+ var msg = 'PASSED: '+why;
+ trace (msg);
+ },
+
+ xpass: function (why) {
+ this.xpassed++;
+ var msg = 'XPASSED: '+why;
+ trace (msg);
+ },
+
+ totals: function (expectedTestsRun, msg) {
+ if ( arguments.length > 1 )
+ {
+ ttr = 0;
+ if ( this.passed ) ttr += this.passed;
+ if ( this.failed ) ttr += this.failed;
+ if ( this.xpassed ) ttr += this.xpassed;
+ if ( this.xfailed ) ttr += this.xfailed;
+ if ( this.untest ) ttr += this.untest;
+ if ( this.unresolv ) ttr += this.unresolv;
+ this.note("Total tests run: "+ttr+" typeof expected: "+typeof(expectedTestsRun));
+
+ if ( expectedTestsRun != ttr )
+ {
+ this.fail("TOTAL tests run: "+ttr+", expected: "+expectedTestsRun+" ["+msg+"]");
+ }
+ }
+ this.xtrace('#passed: '+ this.passed);
+ this.xtrace('#failed: '+ this.failed);
+ if ( this.xpassed ) {
+ this.xtrace('#unexpected successes: '+ this.xpassed);
+ }
+ if ( this.xfailed ) {
+ this.xtrace('#expected failures: '+ this.xfailed);
+ }
+
+ this.done();
+ },
+
+ xtotals: function (expectedTestsRun, msg) {
+ if ( arguments.length > 1 )
+ {
+ ttr = 0;
+ if ( this.passed ) ttr += this.passed;
+ if ( this.failed ) ttr += this.failed;
+ if ( this.xpassed ) ttr += this.xpassed;
+ if ( this.xfailed ) ttr += this.xfailed;
+ if ( this.untest ) ttr += this.untest;
+ if ( this.unresolv ) ttr += this.unresolv;
+ this.note("Total tests run: "+ttr+" typeof expected: "+typeof(expectedTestsRun));
+
+ if ( expectedTestsRun != ttr )
+ {
+ this.xfail("TOTAL tests run: "+ttr+", expected: "+expectedTestsRun+" ["+msg+"]");
+ }
+ else
+ {
+ this.xpass("TOTAL tests run: "+ttr+" ["+msg+"]");
+ }
+ }
+ this.xtrace('#passed: '+ this.passed);
+ this.xtrace('#failed: '+ this.failed);
+ if ( this.xpassed ) {
+ this.xtrace('#unexpected successes: '+ this.xpassed);
+ }
+ if ( this.xfailed ) {
+ this.xtrace('#expected failures: '+ this.xfailed);
+ }
+
+ this.done();
+ },
+
+ check_equals: function (obt, exp, msg, expression) {
+ if(msg == null) msg = "";
+ if ( obt == exp )
+ this.pass(expression+' == '+exp+" "+msg);
+ else
+ this.fail(expression+': expected: "'+exp+'" , obtained: "'+obt+'" '+msg);
+ },
+
+ xcheck_equals: function (obt, exp, msg, expression) {
+ if(msg == null) msg = "";
+ if ( obt == exp )
+ this.xpass(expression+' == '+exp+" "+msg);
+ else
+ this.xfail(expression+': expected: '+exp+' , obtained: '+obt+" "+msg);
+ },
+
+ check: function (a, msg) {
+ if ( a )
+ this.pass(msg != undefined ? msg : a);
+ else
+ this.fail(msg != undefined ? msg : a);
+ },
+
+ xcheck: function (a, msg) {
+ if ( a )
+ this.xpass(msg != undefined ? msg : a);
+ else
+ this.xfail(msg != undefined ? msg : a);
+ },
+
+ note: function (msg) {
+ this.xtrace(msg);
+ },
+
+ xtrace: function (msg) {
+ _level0.textout._height += 20;
+ _level0.textout.text += msg + "\n";
+ trace(msg);
+ },
+
+ untested: function (msg) {
+ trace("UNTESTED: "+msg);
+ },
+
+ unresolved: function (msg) {
+ trace("UNRESOLVED: "+msg);
+ },
+
+ done: function () {
+ _root.stop();
+ trace("__END_OF_TEST__");
+ getURL("fscommand:quit", "");
+ }
+
+ };
+
+ if(_level0.dejagnu_module_initialized != 1) {
+ // create a textfield to output to
+ _level0.createTextField("textout", 99, 10, 10, 600, 0);
+ _level0.textout.autoSize = true;
+ _level0.dejagnu_module_initialized = 1;
+ }
+
+// helper functions
+#include "check.sc"
+
diff --git a/test/gnash/misc-swfc.all/Dejagnu.sc.original b/test/gnash/misc-swfc.all/Dejagnu.sc.original
new file mode 100644
index 0000000..b9d998e
--- /dev/null
+++ b/test/gnash/misc-swfc.all/Dejagnu.sc.original
@@ -0,0 +1,183 @@
+ // Dejagnu.sc - SWFC script for dejagnu-like testing.
+ //
+ // Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ //
+ // This program is free software; you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+ // the Free Software Foundation; either version 3 of the License, or
+ // (at your option) any later version.
+ //
+ // This program 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 General Public License for more details.
+ //
+ // You should have received a copy of the GNU General Public License
+ // along with this program; if not, write to the Free Software
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ //
+ //
+ // Original author: David Rorex - drorex at gmail.com
+ //
+ //
+
+ _root.Dejagnu = _global.Dejagnu = {
+ passed:0,
+ failed:0,
+ xpassed:0,
+ xfailed:0,
+ untest:0,
+ unresolve:0,
+
+ fail : function (why) {
+ this.failed++;
+ var msg = 'FAILED: '+why;
+ this.xtrace(msg);
+ },
+
+ xfail: function (why) {
+ this.xfailed++;
+ var msg = 'XFAILED: '+why;
+ this.xtrace(msg);
+ },
+
+ pass: function (why) {
+ this.passed++;
+ var msg = 'PASSED: '+why;
+ trace (msg);
+ },
+
+ xpass: function (why) {
+ this.xpassed++;
+ var msg = 'XPASSED: '+why;
+ trace (msg);
+ },
+
+ totals: function (expectedTestsRun, msg) {
+ if ( arguments.length > 1 )
+ {
+ ttr = 0;
+ if ( this.passed ) ttr += this.passed;
+ if ( this.failed ) ttr += this.failed;
+ if ( this.xpassed ) ttr += this.xpassed;
+ if ( this.xfailed ) ttr += this.xfailed;
+ if ( this.untest ) ttr += this.untest;
+ if ( this.unresolv ) ttr += this.unresolv;
+ this.note("Total tests run: "+ttr+" typeof expected: "+typeof(expectedTestsRun));
+
+ if ( expectedTestsRun != ttr )
+ {
+ this.fail("TOTAL tests run: "+ttr+", expected: "+expectedTestsRun+" ["+msg+"]");
+ }
+ }
+ this.xtrace('#passed: '+ this.passed);
+ this.xtrace('#failed: '+ this.failed);
+ if ( this.xpassed ) {
+ this.xtrace('#unexpected successes: '+ this.xpassed);
+ }
+ if ( this.xfailed ) {
+ this.xtrace('#expected failures: '+ this.xfailed);
+ }
+
+ this.done();
+ },
+
+ xtotals: function (expectedTestsRun, msg) {
+ if ( arguments.length > 1 )
+ {
+ ttr = 0;
+ if ( this.passed ) ttr += this.passed;
+ if ( this.failed ) ttr += this.failed;
+ if ( this.xpassed ) ttr += this.xpassed;
+ if ( this.xfailed ) ttr += this.xfailed;
+ if ( this.untest ) ttr += this.untest;
+ if ( this.unresolv ) ttr += this.unresolv;
+ this.note("Total tests run: "+ttr+" typeof expected: "+typeof(expectedTestsRun));
+
+ if ( expectedTestsRun != ttr )
+ {
+ this.xfail("TOTAL tests run: "+ttr+", expected: "+expectedTestsRun+" ["+msg+"]");
+ }
+ else
+ {
+ this.xpass("TOTAL tests run: "+ttr+" ["+msg+"]");
+ }
+ }
+ this.xtrace('#passed: '+ this.passed);
+ this.xtrace('#failed: '+ this.failed);
+ if ( this.xpassed ) {
+ this.xtrace('#unexpected successes: '+ this.xpassed);
+ }
+ if ( this.xfailed ) {
+ this.xtrace('#expected failures: '+ this.xfailed);
+ }
+
+ this.done();
+ },
+
+ check_equals: function (obt, exp, msg, expression) {
+ if(msg == null) msg = "";
+ if ( obt == exp )
+ this.pass(expression+' == '+exp+" "+msg);
+ else
+ this.fail(expression+': expected: "'+exp+'" , obtained: "'+obt+'" '+msg);
+ },
+
+ xcheck_equals: function (obt, exp, msg, expression) {
+ if(msg == null) msg = "";
+ if ( obt == exp )
+ this.xpass(expression+' == '+exp+" "+msg);
+ else
+ this.xfail(expression+': expected: '+exp+' , obtained: '+obt+" "+msg);
+ },
+
+ check: function (a, msg) {
+ if ( a )
+ this.pass(msg != undefined ? msg : a);
+ else
+ this.fail(msg != undefined ? msg : a);
+ },
+
+ xcheck: function (a, msg) {
+ if ( a )
+ this.xpass(msg != undefined ? msg : a);
+ else
+ this.xfail(msg != undefined ? msg : a);
+ },
+
+ note: function (msg) {
+ this.xtrace(msg);
+ },
+
+ xtrace: function (msg) {
+ _level0.textout._height += 20;
+ _level0.textout.text += msg + "\n";
+ trace(msg);
+ },
+
+ untested: function (msg) {
+ trace("UNTESTED: "+msg);
+ },
+
+ unresolved: function (msg) {
+ trace("UNRESOLVED: "+msg);
+ },
+
+ done: function () {
+ _root.stop();
+ trace("__END_OF_TEST__");
+ loadMovie("fscommand:quit", _level0);
+ }
+
+ };
+
+ if(_level0.dejagnu_module_initialized != 1) {
+ // create a textfield to output to
+ _level0.createTextField("textout", 99, 10, 10, 600, 0);
+ _level0.textout.autoSize = true;
+ _level0.dejagnu_module_initialized = 1;
+ }
+
+// helper functions
+#include "check.sc"
+
diff --git a/test/gnash/misc-swfc.all/Makefile.am b/test/gnash/misc-swfc.all/Makefile.am
new file mode 100644
index 0000000..d3be011
--- /dev/null
+++ b/test/gnash/misc-swfc.all/Makefile.am
@@ -0,0 +1,15 @@
+check-local: ../../swfdec-test
+ ../../swfdec-test --script $(srcdir)/default.sts $(srcdir)/*.swf
+
+EXTRA_DIST = \
+ README \
+ REMOVED \
+ UPDATED \
+ check.sc \
+ default.stas \
+ default.sts \
+ Dejagnu.sc \
+ Dejagnu.sc.original \
+ hello.sc \
+ hello.swf \
+ hello.swf.trace
diff --git a/test/gnash/misc-swfc.all/README b/test/gnash/misc-swfc.all/README
new file mode 100644
index 0000000..bc4c43d
--- /dev/null
+++ b/test/gnash/misc-swfc.all/README
@@ -0,0 +1,19 @@
+The .sc files, from Gnash's test suite's directory with same name, have been
+imported here and compiled using the following command line:
+ cpp -P -DMEDIADIR="../media" test.sc | swfc -o test.swf -
+
+Dejagnu.sc (and check.sc) has been slightly modified, so it performs a Swfdec
+style trace test mostly without modifications to the test scripts. Where
+modifications were needed, the original file is named .sc.original and modified
+version just .sc
+
+Various .sc files were not imported, they are listed in the REMOVED
+
+Tests that are not working in Swfdec yet are in pending directory and are not
+included in make check
+
+Tests that are considered broken for some reason are not included. Most likely
+reason is producing FAIL or XFAIL on latest Adobe's Windows player
+
+The date when the tests were last imported/updated from Gnash's CVS repository
+can be found from UPDATED
diff --git a/test/gnash/misc-swfc.all/REMOVED b/test/gnash/misc-swfc.all/REMOVED
new file mode 100644
index 0000000..949349d
--- /dev/null
+++ b/test/gnash/misc-swfc.all/REMOVED
@@ -0,0 +1,3 @@
+button_test1.sc Interactive test
+button_test2.sc Interactive test
+opcode_guard_test3.sc Interactive test
diff --git a/test/gnash/misc-swfc.all/UPDATED b/test/gnash/misc-swfc.all/UPDATED
new file mode 100644
index 0000000..c63db71
--- /dev/null
+++ b/test/gnash/misc-swfc.all/UPDATED
@@ -0,0 +1 @@
+2008-07-10
diff --git a/test/gnash/misc-swfc.all/check.sc b/test/gnash/misc-swfc.all/check.sc
new file mode 100644
index 0000000..5a32598
--- /dev/null
+++ b/test/gnash/misc-swfc.all/check.sc
@@ -0,0 +1,53 @@
+// check.as - Include file for SWFC testcases providing common testing facilities
+//
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+//
+// Original author: David Rorex - drorex at gmail.com
+//
+
+#ifndef _CHECK_AS_
+#define _CHECK_AS_
+
+#define _INFO_ ' ['+__FILE__+':'+__LINE__+']'
+
+#define check_equals(a, b) Dejagnu.check_equals(a, b, _INFO_, #a);
+//#define check_equals(a, b, msg) Dejagnu.check(a, b, msg + _INFO_);
+
+#define xcheck_equals(a, b) Dejagnu.xcheck_equals(a, b, _INFO_, #a);
+//#define xcheck_equals(a, b, msg) Dejagnu.check(a, b, msg + _INFO_);
+
+#define check(a) Dejagnu.check(a, _INFO_);
+#define xcheck(a) Dejagnu.xcheck(a, _INFO_);
+
+#define pass(text) Dejagnu.pass(text + _INFO_)
+#define xpass(text) Dejagnu.xpass(text + _INFO_)
+#define fail(text) Dejagnu.fail(text + _INFO_)
+#define xfail(text) Dejagnu.xfail(text + _INFO_)
+#define pass(text) Dejagnu.pass(text + _INFO_)
+#define untested(text) Dejagnu.untested(text + _INFO_)
+#define unresolved(text) Dejagnu.unresolved(text + _INFO_)
+
+#define note(text) Dejagnu.note(text + _INFO_);
+
+#define totals(x) Dejagnu.totals(x, _INFO_)
+
+#define xtotals(x) Dejagnu.xtotals(x, _INFO_)
+
+#define MEDIA(x) MEDIADIR/x
+
+#endif
diff --git a/test/gnash/misc-swfc.all/default.stas b/test/gnash/misc-swfc.all/default.stas
new file mode 100644
index 0000000..844990a
--- /dev/null
+++ b/test/gnash/misc-swfc.all/default.stas
@@ -0,0 +1,54 @@
+/* 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);
+ var expected = Buffer.load (file + ".trace");
+ t.advance (0);
+ t.advance (Math.ceil (10000 / t.rate));
+ var diff = t.trace.diff (expected);
+ if (diff) {
+ error ("different trace output");
+ Native.print (diff);
+ return false;
+ }
+ } 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/gnash/misc-swfc.all/default.sts b/test/gnash/misc-swfc.all/default.sts
new file mode 100644
index 0000000..279dcda
Binary files /dev/null and b/test/gnash/misc-swfc.all/default.sts differ
diff --git a/test/gnash/misc-swfc.all/hello.sc b/test/gnash/misc-swfc.all/hello.sc
new file mode 100644
index 0000000..d9f7872
--- /dev/null
+++ b/test/gnash/misc-swfc.all/hello.sc
@@ -0,0 +1,18 @@
+.flash bbox=200x200 filename="hello.swf" version=6 fps=30
+
+//load dejagnu library. This must go after the .flash tag
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+
+ trace("Hello World!");
+ var abc = 123;
+ check_equals(abc, 123); // check something is equal
+ //xcheck_equals(abc, 456); // check something is equal, but expect gnash it to fail
+ var qux = true;
+ check(qux); // check a boolean is true
+ Dejagnu.done(); // don't forget to call this, or the test will not complete
+ // Note that done() automatically calls stop();
+ .end
+.end
diff --git a/test/gnash/misc-swfc.all/hello.swf b/test/gnash/misc-swfc.all/hello.swf
new file mode 100644
index 0000000..20da114
Binary files /dev/null and b/test/gnash/misc-swfc.all/hello.swf differ
diff --git a/test/gnash/misc-swfc.all/hello.swf.trace b/test/gnash/misc-swfc.all/hello.swf.trace
new file mode 100644
index 0000000..aec6822
--- /dev/null
+++ b/test/gnash/misc-swfc.all/hello.swf.trace
@@ -0,0 +1,4 @@
+Hello World!
+PASSED: abc == 123 [hello.sc:11]
+PASSED: [hello.sc:14]
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/action_execution_order_test10.sc b/test/gnash/misc-swfc.all/pending/action_execution_order_test10.sc
new file mode 100644
index 0000000..f913e50
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/action_execution_order_test10.sc
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test actions execution order
+ *
+ * Description:
+ *
+ * frame3: DoAction: Create user defined onContruct, onLoad and onUnload for both mc1 and mc2.
+ * Place mc1 by PlaceObject2.
+ * DoAction.
+ * Place mc2 by PlaceObject2.
+ * DoAction.
+ *
+ * frame4: DoAction.
+ * delete mc1 by RemoveObject2.
+ * DoAction.
+ * delete mc2 by RemoveObject2.
+ * DoAction.
+ *
+ * frame8:
+ * PlaceObject(mc4), DoInitAction(mc4), DoInitAction(mc5), PlaceObject(mc5)
+ * - user defined onInitialize(mc4) isn't called
+ * - user defined onInitialize(mc5) isn't called
+ * - user defined onConstruct(mc4) is called
+ * - user defined onConstruct(mc5) is called
+ *
+ * Expected behaviour:
+ * (1) user defined onLoad should not be triggered in this case(when allEventFlags == zero).
+ * (guess: might be a pp bug)
+ * (2) If DoAction is before RemoveObject2, then actions in DoAction should be executed before
+ * onUnload, otherwise after onUnload.
+ * (3) Frame actions(frameNum>0): first placed last executed.
+ *
+ */
+
+
+.flash bbox=800x600 filename="action_execution_order_test10.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+
+ _root.as_order1 = '0+';
+ _root.as_order2 = '0+';
+ check_equals(_root._currentframe, 1);
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box b1 fill=green width=100 height=100
+ .box b2 fill=red width=100 height=100
+ .box b3 fill=yellow width=100 height=100
+ .box b4 fill=blue width=100 height=100
+
+.frame 2
+
+ .sprite mc1 // Define a sprite mc1
+ .frame 1
+ .put b1
+ .action:
+ _root.as_order1 += '2+';
+ .end
+ .frame 3
+ .action:
+ _root.as_order2 += '3+';
+ .end
+ .frame 10
+ .end
+
+ .sprite mc2 // Define a sprite mc2
+ .frame 1
+ .put b2
+ .action:
+ _root.as_order1 += '4+';
+ .end
+ .frame 3
+ .action:
+ _root.as_order2 += '2+';
+ .end
+ .frame 10
+ .end
+
+ .sprite mc3 // Define a sprite mc3
+ .frame 2
+ .action:
+ _root.as_order2 += '1+';
+ .end
+ .frame 10
+ .end
+
+.frame 3
+
+ .action:
+ // user defined onConstruct has no chance to be executed
+ mc1.onConstruct = function () {_root.as_order1 += 'xx+';};
+ mc2.onConstruct = function () {_root.as_order1 += 'xx+';};
+
+ // user defined onLoad won't be triggered if allEventFlags is zero(this case),
+ // otherwise, it will be triggered. A PP bug???
+ mc1.onLoad = function () {_root.as_order1 += 'YY+';};
+ mc2.onLoad = function () {_root.as_order1 += 'YY+';};
+
+ mc1.onUnload = function () {_root.as_order1 += '7+';};
+ mc2.onUnload = function () {_root.as_order1 += '9+';};
+
+ _root.as_order1 += "1+";
+ .end
+
+ .put mc1 x = 0 y = 300 // Place mc1
+
+ .action:
+ _root.as_order1 += "3+";
+ .end
+
+ .put mc2 x = 100 y = 300 // Place mc2
+
+ .action:
+ _root.as_order1 += "5+";
+ .end
+
+
+
+.frame 4
+ .put mc3 // Place mc3
+
+
+.frame 6
+
+ .action:
+ _root.as_order1 += "6+";
+ .end
+
+ .del mc1 // delete mc1 by RemoveObject2
+
+ .action:
+ _root.as_order1 += "8+";
+ .end
+
+ .del mc2 // delete mc2 by RemoveObject2
+
+ .action:
+ _root.as_order1 += "10+";
+ .end
+
+ .del mc3 // delete mc3 by RemoveObject2
+
+.frame 7
+ .action:
+ check_equals(_root.as_order1, '0+1+2+3+4+5+6+7+8+9+10+');
+ check_equals(_root.as_order2, '0+1+2+3+');
+ .end
+
+
+//
+// seperate tests for user defined onInitialize, onConstruct, onLoad
+//
+.frame 8
+ .sprite mc4
+ .put b4 x=100 y=300
+ .end
+ .sprite mc5
+ .put b4 x=100 y=400
+ .end
+ .put mc4 // PlaceObject2(mc4)
+ .initaction mc4:
+ _root.mc4_onConstruct_executed = false;
+
+ _root.note("mc4 init actions");
+ _root.check_equals(typeof(mc4), 'movieclip');
+ // What a bad bug the pp has !
+ // First query of __proto__ turns it into the correct prototype
+ // (MovieClip.prototype) buf first query returns the *old* rather
+ // then the new value
+ // UPDATE: Company knew about this, he mentions that unless for SWF6
+ // the first time a movieclip's __proto__ is queried it always
+ // returns Object.prototype.
+ _root.xcheck(mc4.__proto__ == Object.prototype); // returns wrong answer at first, gnash does the right thing here
+ _root.check(mc4.__proto__ != Object.prototype); // and correct at second and subsequent queries
+ _root.check_equals(mc4.__proto__, MovieClip.prototype); // <--- this is the correct one
+
+ mc4.onInitialize = function () {
+ _root.note("mc4 user defined onInitialize");
+ _root.check(false); // should not be executed
+ };
+ mc4.onConstruct = function() {
+ _root.note("mc4 user defined onConstruct");
+ _root.mc4_onConstruct_executed = true;
+ };
+ mc4.onLoad = function() {
+ _root.note("mc4 user defined onLoad");
+ _root.check(false); // should not be executed
+ };
+ .end
+ .initaction mc5:
+ _root.mc5_onConstruct_executed = false;
+
+ mc5.onInitialize = function () {
+ _root.note("mc5 user defined onInitialize");
+ _root.check(false); // should not be executed
+ };
+ mc5.onConstruct = function() {
+ _root.note("mc5 user defined onConstruct");
+ _root.mc5_onConstruct_executed = true;
+ };
+ mc5.onLoad = function() {
+ _root.note("mc5 user defined onLoad");
+ _root.check(false); // should not be executed
+ };
+ .end
+ .put mc5 // PlaceObject2(mc5)
+
+.frame 9
+ .action:
+ check_equals(mc4_onConstruct_executed, true);
+ check_equals(mc5_onConstruct_executed, true);
+ .end
+
+.frame 15
+ .action:
+ totals(9);
+ stop();
+ .end
+
+
+.end // end of the file
+
+
diff --git a/test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf b/test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf
new file mode 100644
index 0000000..d57336b
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf.trace b/test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf.trace
new file mode 100644
index 0000000..f35efa1
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/action_execution_order_test10.swf.trace
@@ -0,0 +1,17 @@
+PASSED: _root._currentframe == 1 [action_execution_order_test10.sc:63]
+PASSED: _root.as_order1 == 0+1+2+3+4+5+6+7+8+9+10+ [action_execution_order_test10.sc:166]
+PASSED: _root.as_order2 == 0+1+2+3+ [action_execution_order_test10.sc:167]
+mc4 init actions [action_execution_order_test10.sc:185]
+PASSED: typeof(mc4) == movieclip [action_execution_order_test10.sc:186]
+XPASSED: [action_execution_order_test10.sc:194]
+PASSED: [action_execution_order_test10.sc:195]
+PASSED: mc4.__proto__ == [object Object] [action_execution_order_test10.sc:196]
+mc4 user defined onConstruct [action_execution_order_test10.sc:203]
+mc5 user defined onConstruct [action_execution_order_test10.sc:219]
+PASSED: mc4_onConstruct_executed == true [action_execution_order_test10.sc:231]
+PASSED: mc5_onConstruct_executed == true [action_execution_order_test10.sc:232]
+Total tests run: 9 typeof expected: number
+#passed: 8
+#failed: 0
+#unexpected successes: 1
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/action_execution_order_test12.sc b/test/gnash/misc-swfc.all/pending/action_execution_order_test12.sc
new file mode 100644
index 0000000..ba6c0a2
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/action_execution_order_test12.sc
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test actions execution order.
+ *
+ * movieclips hiberarchy:
+ *
+ * _root.frame2.mc1;
+ * _root.frame2.mc2;
+ *
+ * mc1.frame2.mc11
+ * mc1.frame4.mc12 (mc1 has 4 frames)
+ *
+ * mc2.frame3.mc21 (mc2 has 3 frames)
+ *
+ */
+
+
+.flash bbox=800x600 filename="action_execution_order_test12.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+
+ _root.loadOrder = '0+';
+ _root.enterFrameOrder = '0+';
+ _root.unloadOrder = '0+';
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box b1 fill=green width=100 height=100
+ .box b2 fill=red width=100 height=100
+ .box b3 fill=yellow width=100 height=100
+ .box b4 fill=blue width=100 height=100
+
+.frame 2
+
+ .sprite mc11 // Define mc11
+ .frame 1 .put b1
+ .end
+
+ .sprite mc12 // Define mc12
+ .frame 1 .put b2
+ .end
+
+ .sprite mc21 // Define mc21
+ .frame 1 .put b3
+ .end
+
+ .sprite mc1 // Define mc1
+ .frame 2 .put mc11
+ .frame 4 .put mc12
+ .end
+
+ .sprite mc2 // Define mc2
+ .frame 3 .put mc21
+ .end
+
+
+
+.frame 3
+ .put mc1 // Place mc1
+ .put mc2 // Place mc2
+
+
+ .action:
+ mc1.onLoad = function () {
+ _root.loadOrder += '1+';
+ };
+ mc1.onEnterFrame = function () {
+ _root.enterFrameOrder += '2+';
+ };
+ mc1.onUnload = function () {
+ _root.note('mc1 unloaded');
+ _root.unloadOrder += '4+';
+ };
+
+ mc2.onLoad = function () {
+ _root.loadOrder += '2+';
+ };
+ mc2.onEnterFrame = function () {
+ _root.enterFrameOrder += '1+';
+ };
+ mc2.onUnload = function () {
+ _root.note('mc2 unloaded');
+ _root.unloadOrder += '5+';
+ };
+
+ check_equals(typeof(mc2), 'movieclip');
+ check_equals(typeof(mc2), 'movieclip');
+ check_equals(typeof(mc1.mc11), 'undefined');
+ check_equals(typeof(mc1.mc12), 'undefined');
+ check_equals(typeof(mc1.mc21), 'undefined');
+ .end
+
+
+
+.frame 4
+ .action:
+ mc1.mc11.onLoad = function () {
+ _root.loadOrder += '3+';
+ };
+ mc1.mc11.onEnterFrame = function () {
+ _root.enterFrameOrder += '3+';
+ };
+ mc1.mc11.onUnload = function () {
+ _root.note('mc1.mc11 unloaded');
+ _root.unloadOrder += '2+';
+ };
+
+ check_equals(typeof(mc1.mc11), 'movieclip');
+ check_equals(typeof(mc1.mc12), 'undefined');
+ .end
+
+
+.frame 5
+ .action:
+ mc2.mc21.onLoad = function () {
+ _root.loadOrder += '4+';
+ };
+ mc2.mc21.onEnterFrame = function () {
+ _root.enterFrameOrder += '4+';
+ };
+ mc2.mc21.onUnload = function () {
+ _root.note('mc2.mc21 unloaded');
+ _root.unloadOrder += '1+';
+ };
+
+ check_equals(typeof(mc2.mc21), 'movieclip');
+ check_equals(typeof(mc1.mc12), 'undefined');
+ .end
+
+.frame 6
+ .action:
+ mc1.mc12.onLoad = function () {
+ _root.loadOrder += '5+';
+ };
+ mc1.mc12.onEnterFrame = function () {
+ _root.enterFrameOrder += '5+';
+ };
+ mc1.mc12.onUnload = function () {
+ _root.note('mc1.mc12 unloaded');
+ _root.unloadOrder += '3+';
+ };
+
+ check_equals(typeof(mc1.mc12), 'movieclip');
+ .end
+
+
+.frame 8
+ .del mc1
+ .del mc2
+ .action:
+ check_equals(_root.loadOrder, '0+');
+ check_equals(_root.enterFrameOrder, '0+1+2+3+1+2+3+1+2+1+2+');
+ // mc2.mc21, mc1.mc11 and mc1.mc12 were unloaded when loop back.
+ // mc1 and mc2 were unloaded by RemoveObject2 tags.
+ check_equals(_root.unloadOrder, '0+1+2+3+4+5+');
+ .end
+
+
+//
+// test2:
+// test that a single action block can be interrupted by passing-by init actions
+.frame 9
+ .action:
+ _root.asOrder = '0+';
+ gotoAndPlay(11);
+ _root.asOrder += '1+';
+ func = function () { _root.asOrder += '2+'; };
+ func();
+ _root.asOrder += '4+';
+ .end
+
+.frame 10
+ .sprite mc3
+ .end
+ .initaction mc3:
+ _root.asOrder += '3+';
+ .end
+
+.frame 11
+ .action:
+ check_equals(asOrder, '0+1+2+3+4+');
+ .end
+
+.frame 15
+ .action:
+ totals(); stop();
+ .end
+
+
+.end // end of the file
diff --git a/test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf b/test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf
new file mode 100644
index 0000000..f06a70a
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf.trace b/test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf.trace
new file mode 100644
index 0000000..5616713
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/action_execution_order_test12.swf.trace
@@ -0,0 +1,22 @@
+PASSED: typeof(mc2) == movieclip [action_execution_order_test12.sc:107]
+PASSED: typeof(mc2) == movieclip [action_execution_order_test12.sc:108]
+PASSED: typeof(mc1.mc11) == undefined [action_execution_order_test12.sc:109]
+PASSED: typeof(mc1.mc12) == undefined [action_execution_order_test12.sc:110]
+PASSED: typeof(mc1.mc21) == undefined [action_execution_order_test12.sc:111]
+PASSED: typeof(mc1.mc11) == movieclip [action_execution_order_test12.sc:129]
+PASSED: typeof(mc1.mc12) == undefined [action_execution_order_test12.sc:130]
+PASSED: typeof(mc2.mc21) == movieclip [action_execution_order_test12.sc:147]
+PASSED: typeof(mc1.mc12) == undefined [action_execution_order_test12.sc:148]
+mc2.mc21 unloaded [action_execution_order_test12.sc:143]
+PASSED: typeof(mc1.mc12) == movieclip [action_execution_order_test12.sc:164]
+mc1.mc11 unloaded [action_execution_order_test12.sc:125]
+mc1.mc12 unloaded [action_execution_order_test12.sc:160]
+mc1 unloaded [action_execution_order_test12.sc:92]
+mc2 unloaded [action_execution_order_test12.sc:103]
+PASSED: _root.loadOrder == 0+ [action_execution_order_test12.sc:172]
+PASSED: _root.enterFrameOrder == 0+1+2+3+1+2+3+1+2+1+2+ [action_execution_order_test12.sc:173]
+PASSED: _root.unloadOrder == 0+1+2+3+4+5+ [action_execution_order_test12.sc:176]
+PASSED: asOrder == 0+1+2+3+4+ [action_execution_order_test12.sc:202]
+#passed: 14
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/edittext_test1.sc b/test/gnash/misc-swfc.all/pending/edittext_test1.sc
new file mode 100644
index 0000000..7196176
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/edittext_test1.sc
@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ */
+
+
+.flash bbox=800x600 filename="edittext_test1.swf" background=white version=7 fps=1
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+ .edittext edtext1 size=200%
+ width=400 height=200
+ color=blue border multiline wordwrap
+ text="Hello"
+ variable="textVar1"
+
+ .put edtext1 x=10 y=300
+
+ .action:
+ // check the initial values
+ check_equals(typeof(edtext1), 'object');
+ check_equals(edtext1._name, 'edtext1');
+ check_equals(edtext1._target, '/edtext1');
+ check_equals(edtext1.text, 'Hello');
+ check_equals(edtext1.variable, 'textVar1');
+ check_equals(_root.textVar1, 'Hello');
+ .end
+
+
+.frame 2
+ .action:
+ // Update the registered variable
+ _root.textVar1 = 'new-string-frame2';
+ check_equals(_root.textVar1, 'new-string-frame2');
+ // The return value of TextField.text also updated
+ check_equals(edtext1.text, 'new-string-frame2');
+ .end
+
+.frame 3
+ .action:
+ // Update TextField.text
+ edtext1.text = 'new-string-frame3';
+ check_equals(edtext1.text, 'new-string-frame3');
+ // The return value of the registered variable also updated
+ check_equals(edtext1.text, 'new-string-frame3');
+ .end
+
+.frame 4
+ .action:
+ // rename the EditText variable to 'textVar2'
+ edtext1.variable = 'textVar2';
+ check_equals(_root.hasOwnProperty('textVar2'), true);
+ check_equals(edtext1.variable, 'textVar2');
+ // textVar2 automatically initialized to 'Hello'
+ // (the InitialText in DefineTextField tag, make sense!)
+ check_equals(_root.textVar2, 'Hello');
+ check_equals(edtext1.text, 'Hello');
+ check_equals(_root.textVar1, 'new-string-frame3');
+ .end
+
+
+.frame 5
+ .action:
+ // restore the EditText variable name to 'textVar1'
+ edtext1.variable = 'textVar1';
+ check_equals(edtext1.variable, 'textVar1');
+ // edtext1.text also restore to the value of
+ // _root.textVar1(the registered variable)
+ check_equals(edtext1.text, 'new-string-frame3');
+ .end
+
+
+.frame 6
+ .action:
+ edtext1.text = 'new-string-frame6';
+ check_equals(edtext1.text, 'new-string-frame6');
+ check_equals(_root.textVar1, 'new-string-frame6');
+
+ // Rename the EditText variable to 'textVar3'
+ edtext1.variable = 'textVar3';
+ // textVar3 automatically initialized to 'Hello'
+ // (the InitialText in DefineTextField tag, make sense!)
+ check_equals(_root.textVar3, 'Hello');
+ check_equals(_root.textVar1, 'new-string-frame6');
+ .end
+
+.frame 7
+ .action:
+ check_equals(_root.hasOwnProperty('textVar1'), true);
+ check_equals(_root.hasOwnProperty('textVar2'), true);
+ check_equals(_root.hasOwnProperty('textVar3'), true);
+ .end
+
+
+.frame 8
+ .del edtext1 // Remove edtext1
+ .action:
+ // after removing the TextField instance, all registered variables still keep alive
+ check_equals(_root.hasOwnProperty('textVar1'), true);
+ check_equals(_root.hasOwnProperty('textVar2'), true);
+ check_equals(_root.hasOwnProperty('textVar3'), true);
+ check_equals(typeof(edtext1), 'undefined');
+ .end
+
+//
+// new tests, seperate from the above
+//
+.frame 9
+ .action:
+ textVar4 = 'new_tests_begin';
+ .end
+
+.frame 10
+ .edittext edtext2 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="Hello"
+ variable="textVar4" // give a name already exists in main timeline.
+ .put edtext2 x=10 y=300
+ .action:
+ // returns the value of the registered variable in main timeline
+ check_equals(edtext2.text, 'new_tests_begin');
+ .end
+
+
+.frame 11
+ .action:
+ edtext2.text = 'value_changed';
+ check_equals(edtext2.text, 'value_changed');
+ check_equals(textVar4, 'value_changed');
+ .end
+
+//
+// new tests, seperate from the above
+//
+.frame 12
+ .edittext edtext10 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="AAA"
+ variable="textVar10"
+ .edittext edtext11 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="BBB"
+ variable="textVar11"
+ .edittext edtext12 size=200%
+ width=100 height=100
+ color=blue border multiline wordwrap
+ text="CCC"
+ variable="textVar12"
+
+ .put edtext10 x=100 y=300
+ .put edtext11 x=100 y=400
+ .put edtext12 x=100 y=500
+
+
+ .action:
+ check_equals(edtext10.text, 'AAA');
+ check_equals(edtext11.text, 'BBB');
+ check_equals(edtext12.text, 'CCC');
+ edtext10.variable = "textVar11";
+ edtext11.variable = "textVar12";
+ edtext12.variable = "textVar10";
+ check_equals(edtext10.text, 'BBB');
+ check_equals(edtext11.text, 'CCC');
+ check_equals(edtext12.text, 'AAA');
+ check_equals(textVar10, 'AAA');
+ check_equals(textVar11, 'BBB');
+ check_equals(textVar12, 'CCC');
+ .end
+
+
+.frame 13
+ .action:
+ edtext10.text = 'CCC';
+ edtext11.text = 'BBB';
+ edtext12.text = 'AAA';
+ check_equals(textVar10, 'AAA');
+ check_equals(textVar11, 'CCC');
+ check_equals(textVar12, 'BBB');
+ .end
+
+.frame 15
+ .action:
+ totals(43);
+ stop();
+ .end
+
+
+.end // file end
+
diff --git a/test/gnash/misc-swfc.all/pending/edittext_test1.swf b/test/gnash/misc-swfc.all/pending/edittext_test1.swf
new file mode 100644
index 0000000..ed4c18c
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/edittext_test1.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/edittext_test1.swf.trace b/test/gnash/misc-swfc.all/pending/edittext_test1.swf.trace
new file mode 100644
index 0000000..e4205be
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/edittext_test1.swf.trace
@@ -0,0 +1,47 @@
+PASSED: typeof(edtext1) == object [edittext_test1.sc:41]
+PASSED: edtext1._name == edtext1 [edittext_test1.sc:42]
+PASSED: edtext1._target == /edtext1 [edittext_test1.sc:43]
+PASSED: edtext1.text == Hello [edittext_test1.sc:44]
+PASSED: edtext1.variable == textVar1 [edittext_test1.sc:45]
+PASSED: _root.textVar1 == Hello [edittext_test1.sc:46]
+PASSED: _root.textVar1 == new-string-frame2 [edittext_test1.sc:54]
+PASSED: edtext1.text == new-string-frame2 [edittext_test1.sc:56]
+PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:63]
+PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:65]
+PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:72]
+PASSED: edtext1.variable == textVar2 [edittext_test1.sc:73]
+PASSED: _root.textVar2 == Hello [edittext_test1.sc:76]
+PASSED: edtext1.text == Hello [edittext_test1.sc:77]
+PASSED: _root.textVar1 == new-string-frame3 [edittext_test1.sc:78]
+PASSED: edtext1.variable == textVar1 [edittext_test1.sc:86]
+PASSED: edtext1.text == new-string-frame3 [edittext_test1.sc:89]
+PASSED: edtext1.text == new-string-frame6 [edittext_test1.sc:96]
+PASSED: _root.textVar1 == new-string-frame6 [edittext_test1.sc:97]
+PASSED: _root.textVar3 == Hello [edittext_test1.sc:103]
+PASSED: _root.textVar1 == new-string-frame6 [edittext_test1.sc:104]
+PASSED: _root.hasOwnProperty('textVar1') == true [edittext_test1.sc:109]
+PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:110]
+PASSED: _root.hasOwnProperty('textVar3') == true [edittext_test1.sc:111]
+PASSED: _root.hasOwnProperty('textVar1') == true [edittext_test1.sc:119]
+PASSED: _root.hasOwnProperty('textVar2') == true [edittext_test1.sc:120]
+PASSED: _root.hasOwnProperty('textVar3') == true [edittext_test1.sc:121]
+PASSED: typeof(edtext1) == undefined [edittext_test1.sc:122]
+PASSED: edtext2.text == new_tests_begin [edittext_test1.sc:142]
+PASSED: edtext2.text == value_changed [edittext_test1.sc:149]
+PASSED: textVar4 == value_changed [edittext_test1.sc:150]
+PASSED: edtext10.text == AAA [edittext_test1.sc:179]
+PASSED: edtext11.text == BBB [edittext_test1.sc:180]
+PASSED: edtext12.text == CCC [edittext_test1.sc:181]
+PASSED: edtext10.text == BBB [edittext_test1.sc:185]
+PASSED: edtext11.text == CCC [edittext_test1.sc:186]
+PASSED: edtext12.text == AAA [edittext_test1.sc:187]
+PASSED: textVar10 == AAA [edittext_test1.sc:188]
+PASSED: textVar11 == BBB [edittext_test1.sc:189]
+PASSED: textVar12 == CCC [edittext_test1.sc:190]
+PASSED: textVar10 == AAA [edittext_test1.sc:199]
+PASSED: textVar11 == CCC [edittext_test1.sc:200]
+PASSED: textVar12 == BBB [edittext_test1.sc:201]
+Total tests run: 43 typeof expected: number
+#passed: 43
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.sc b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.sc
new file mode 100644
index 0000000..0f9f99d
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.sc
@@ -0,0 +1,128 @@
+.flash bbox=800x600 filename="gotoFrameFromInterval.swf" background=white version=6 fps=10
+
+.frame 1
+ .action:
+#include "Dejagnu.sc"
+ asOrder = '0+';
+ .end
+
+.frame 2
+ .action:
+ stop();
+
+ function local_whatever() {}
+
+ intervalID = setInterval(
+ function() {
+ if (_currentframe != 2) return;
+ gotoAndPlay(6);
+ }
+ ,0.0001);
+
+
+ _root.framecount = 0;
+
+ this.onEnterFrame = function() {
+ _root.framecount++;
+
+ if (_root.framecount==10) {
+ totals(3);
+ }
+ };
+
+ .end
+
+.frame 6
+ .sprite mc1 // Define a sprite mc1
+ .action:
+ _parent.init_me(this);
+ .end
+ .end
+
+ .action:
+ clearInterval( intervalID );
+
+ function init_me(obj) {
+ // traces here are just for visual check, can be safely removed.
+ // Please don't use _root.note() here, we don't need extra function calls.
+ trace(obj);
+ trace(obj+" --> 1 =");
+ _root.asOrder += '1+';
+ trace(obj+" --> 2 ==");
+ _root.asOrder += '2+';
+ local_whatever();
+ trace(obj+" --> 3 ===");
+ _root.asOrder += '3+';
+ local_whatever();
+ trace(obj+" --> 4 ====");
+ _root.asOrder += '4+';
+ }
+ .end
+
+ .put clip1=mc1 // place a named sprite clip1
+ .put clip2=mc1 // place a named sprite clip2
+ .put clip3=mc1 // place a named sprite clip3
+
+ .action:
+ check_equals(asOrder, '0+1+2+3+4+1+2+3+4+1+2+3+4+');
+ .end
+
+
+//
+// --case2--
+// (1) test that a function block shouldn't be interrupted by init actions.
+// (2) test interval callbacks shouldn't be interrupted by init actions.
+.frame 7
+ .action:
+ _root.i = 0;
+ _root.asOrder = String();
+
+ function func() {
+ return 'x';
+ }
+
+ function callback() {
+ _root.asOrder += func();
+ _root.asOrder += (i++);
+ _root.gotoAndPlay(9);
+ _root.asOrder += func();
+ }
+
+ intervalID1 = setInterval(callback, 0.0001);
+ intervalID2 = setInterval(callback, 0.0001);
+ check(intervalID1 != intervalID2);
+
+ trace('frame7');
+ .end
+
+
+
+.frame 8
+ .sprite sp1
+ .end
+ .sprite sp2
+ .end
+ .sprite sp3
+ .end
+ .initaction sp1:
+ // clear the interval callbacks
+ clearInterval( intervalID1 );
+ clearInterval( intervalID2 );
+
+ _root.asOrder += (i++);
+ .end
+ .initaction sp2:
+ _root.asOrder += (i++);
+ .end
+ .initaction sp3:
+ _root.asOrder += (i++);
+ .end
+
+
+.frame 10
+ .action:
+ stop();
+ check_equals(_root.asOrder, 'x0xx1x234');
+ .end
+
+.end // end of file
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf
new file mode 100644
index 0000000..d4d011b
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf.trace b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf.trace
new file mode 100644
index 0000000..832e61d
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval.swf.trace
@@ -0,0 +1,23 @@
+_level0.clip1
+_level0.clip1 --> 1 =
+_level0.clip1 --> 2 ==
+_level0.clip1 --> 3 ===
+_level0.clip1 --> 4 ====
+_level0.clip2
+_level0.clip2 --> 1 =
+_level0.clip2 --> 2 ==
+_level0.clip2 --> 3 ===
+_level0.clip2 --> 4 ====
+_level0.clip3
+_level0.clip3 --> 1 =
+_level0.clip3 --> 2 ==
+_level0.clip3 --> 3 ===
+_level0.clip3 --> 4 ====
+PASSED: asOrder == 0+1+2+3+4+1+2+3+4+1+2+3+4+ [gotoFrameFromInterval.sc:67]
+PASSED: [gotoFrameFromInterval.sc:93]
+frame7
+PASSED: _root.asOrder == x0xx1x234 [gotoFrameFromInterval.sc:125]
+Total tests run: 3 typeof expected: number
+#passed: 3
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.sc b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.sc
new file mode 100644
index 0000000..1d99cbb
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.sc
@@ -0,0 +1,85 @@
+// just like gotoFrameFromInterval, but using gotoAndPlay
+
+.flash bbox=800x600 filename="gotoFrameFromInterval2.swf" version=6 fps=10
+
+.frame 1
+ .action:
+#include "Dejagnu.sc"
+ asOrder = '0+';
+ .end
+
+.frame 2
+ .action:
+ stop();
+
+ function local_whatever() {}
+
+ intervalID = setInterval(
+ function() {
+ if (_currentframe != 2) return;
+ trace("jumping...");
+ gotoAndPlay(6);
+ }
+ ,0.0001);
+
+
+ _root.framecount = 0;
+
+ this.onEnterFrame = function() {
+ _root.framecount++;
+
+ if (_root.framecount==10) {
+ check_equals(_root._currentframe, 6);
+ totals(2);
+ }
+ };
+
+ .end
+
+.frame 6
+ .sprite mc1 // Define a sprite mc1
+ .action:
+ _parent.init_me(this);
+ .end
+ .end
+
+ .action:
+ stop();
+
+ trace("Entering frame 6");
+ clearInterval( intervalID );
+
+ function init_me(obj) {
+ // traces here are just for visual check, can be safely removed.
+ // Please don't use _root.note() here, we don't need extra function calls.
+ trace(obj);
+ trace(obj+" --> 1 =");
+ _root.asOrder += '1+';
+ trace(obj+" --> 2 ==");
+ _root.asOrder += '2+';
+ local_whatever();
+ trace(obj+" --> 3 ===");
+ _root.asOrder += '3+';
+ local_whatever();
+ trace(obj+" --> 4 ====");
+ _root.asOrder += '4+';
+ }
+ .end
+
+ .put clip1=mc1 // place a named sprite clip1
+ .put clip2=mc1 // place a named sprite clip2
+ .put clip3=mc1 // place a named sprite clip3
+
+ .action:
+ check_equals(asOrder, '0+1+2+3+4+1+2+3+4+1+2+3+4+');
+ .end
+
+
+.frame 7
+ .action:
+ stop();
+ note("Entering unreachable frame 7 !");
+ .end
+
+
+.end // end of file
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf
new file mode 100644
index 0000000..d72b8de
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf.trace b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf.trace
new file mode 100644
index 0000000..2399bf1
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/gotoFrameFromInterval2.swf.trace
@@ -0,0 +1,23 @@
+jumping...
+Entering frame 6
+_level0.clip1
+_level0.clip1 --> 1 =
+_level0.clip1 --> 2 ==
+_level0.clip1 --> 3 ===
+_level0.clip1 --> 4 ====
+_level0.clip2
+_level0.clip2 --> 1 =
+_level0.clip2 --> 2 ==
+_level0.clip2 --> 3 ===
+_level0.clip2 --> 4 ====
+_level0.clip3
+_level0.clip3 --> 1 =
+_level0.clip3 --> 2 ==
+_level0.clip3 --> 3 ===
+_level0.clip3 --> 4 ====
+PASSED: asOrder == 0+1+2+3+4+1+2+3+4+1+2+3+4+ [gotoFrameFromInterval2.sc:74]
+PASSED: _root._currentframe == 6 [gotoFrameFromInterval2.sc:32]
+Total tests run: 2 typeof expected: number
+#passed: 2
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.sc b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.sc
new file mode 100644
index 0000000..c502202
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.sc
@@ -0,0 +1,47 @@
+// testcase for gotoAndXXXX(frame-label) when invoked as AS function
+
+.flash bbox=800x600 filename="gotoFrameLabelAsFunction.swf" version=6 fps=10
+
+.frame 1
+ .action:
+#include "Dejagnu.sc"
+ asOrder = '0+';
+ .end
+
+.frame 2
+ .action:
+
+ this.onEnterFrame = function() {
+ _root.framecount++;
+ if (_root.framecount==10) {
+ check_equals(_root._currentframe, 5);
+ totals(1);
+ }
+ };
+
+ // the "_root." part is important!
+ _root.gotoAndPlay("dest");
+
+ .end
+
+.frame 4
+ .action:
+ trace("reached label 4 (wrong)");
+ check(0);
+ stop();
+ .end
+
+.frame 5 name="dest"
+ .action:
+ trace("reached label 5 (correct)");
+ stop();
+ .end
+
+.frame 6
+ .action:
+ trace("reached label 6 (wrong)");
+ check(0);
+ stop();
+ .end
+
+.end // end of file
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf
new file mode 100644
index 0000000..bfc4729
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf.trace b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf.trace
new file mode 100644
index 0000000..f2ddd17
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/gotoFrameLabelAsFunction.swf.trace
@@ -0,0 +1,6 @@
+reached label 5 (correct)
+PASSED: _root._currentframe == 5 [gotoFrameLabelAsFunction.sc:17]
+Total tests run: 1 typeof expected: number
+#passed: 1
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.sc b/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.sc
new file mode 100644
index 0000000..83710df
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.sc
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *
+ *
+ * Test swf matrix related calculations.
+ * zou lunkai zoulunkai at gmail.com
+ */
+
+
+.flash bbox=800x600 filename="matrix_accuracy_test1.swf" background=white version=6 fps=10
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+ .box rbox width=100 height=30 fill=#FF0000 color=#000000
+ .sprite mc1
+ .put rbox
+ .end
+ .put mc1 x = 0 y = 0
+
+.frame 2
+ .action:
+ check_equals(mc1._xscale, 100);
+ check_equals(mc1._yscale, 100);
+ mc1._rotation = 30;
+ xcheck_equals(mc1._xscale, 100);
+ xcheck_equals(mc1._yscale, 100);
+ mc1._rotation = 60;
+ xcheck_equals(mc1._xscale, 100);
+ xcheck_equals(mc1._yscale, 100);
+ mc1._xscale = 200;
+ xcheck_equals(mc1._rotation, 60);
+
+ // reset mc1 to normal status for later tests.
+ mc1._xscale = 100;
+ mc1._rotation = 0;
+ .end
+
+.frame 3
+ .action:
+ mc1._x = 0x3fffffff;
+ check_equals(mc1._x, -1);
+ mc1._y = 0x3fffff00;
+ check_equals(mc1._y, -256);
+ mc1._x = mc1._y = 100;
+
+ mc1._xscale = -1;
+ xcheck_equals(mc1._xscale, -1);
+ mc1._xscale = 4294967295.0; // (unsigned)(0xffffffff);
+ xcheck_equals(mc1._xscale, 4294967295.0);
+ xcheck_equals(mc1._width, 2359295);
+ check_equals(mc1._height, 30);
+ mc1._yscale = 65536 * 100;
+ check_equals(mc1._height, 0);
+ mc1._yscale = 65530 * 100;
+ check_equals(mc1._height, 180);
+
+ // reset mc1 to normal status for later tests.
+ // Gnash aborts without this.
+ mc1._xscale = 100;
+ mc1._yscale = 100;
+ .end
+
+
+.frame 4
+ // TODO: More tests for MATRIX concatenation, but be aware of compiler overflows(bugs).
+ .action:
+ stop();
+ totals();
+ .end
+
+.end // file end
+
diff --git a/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf b/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf
new file mode 100644
index 0000000..ab5b035
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf.trace b/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf.trace
new file mode 100644
index 0000000..8e0c89e
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/matrix_accuracy_test1.swf.trace
@@ -0,0 +1,19 @@
+PASSED: mc1._xscale == 100 [matrix_accuracy_test1.sc:38]
+PASSED: mc1._yscale == 100 [matrix_accuracy_test1.sc:39]
+XPASSED: mc1._xscale == 100 [matrix_accuracy_test1.sc:41]
+XPASSED: mc1._yscale == 100 [matrix_accuracy_test1.sc:42]
+XPASSED: mc1._xscale == 100 [matrix_accuracy_test1.sc:44]
+XPASSED: mc1._yscale == 100 [matrix_accuracy_test1.sc:45]
+XPASSED: mc1._rotation == 60 [matrix_accuracy_test1.sc:47]
+PASSED: mc1._x == -1 [matrix_accuracy_test1.sc:57]
+PASSED: mc1._y == -256 [matrix_accuracy_test1.sc:59]
+XPASSED: mc1._xscale == -1 [matrix_accuracy_test1.sc:63]
+XPASSED: mc1._xscale == 4294967295 [matrix_accuracy_test1.sc:65]
+XPASSED: mc1._width == 2359295 [matrix_accuracy_test1.sc:66]
+PASSED: mc1._height == 30 [matrix_accuracy_test1.sc:67]
+PASSED: mc1._height == 0 [matrix_accuracy_test1.sc:69]
+PASSED: mc1._height == 180 [matrix_accuracy_test1.sc:71]
+#passed: 7
+#failed: 0
+#unexpected successes: 8
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/mouse_drag_test.sc b/test/gnash/misc-swfc.all/pending/mouse_drag_test.sc
new file mode 100644
index 0000000..79c095a
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/mouse_drag_test.sc
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test startDrag and endDrag
+ *
+ * Expected behaviour:
+ *
+ * static movieclips are immune to static transformation after startDrag.
+ */
+
+.flash bbox=800x600 filename="mouse_drag_test.sc" background=white version=6 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+.frame 2
+ .box b1 color=white fill=green width=50 height=50
+ .sprite mc1
+ .put shape1=b1 x=100 y=100
+ .end
+ .put mc1
+
+ .action:
+ // check the existence of mc1.shape1
+ check_equals(typeof(mc1.shape1), 'movieclip');
+ // the name of the shape is evaluated to its parent clip
+ check_equals(mc1.shape1, mc1);
+ mc1.startDrag(true);
+ check_equals(mc1._x, 0);
+ check_equals(mc1._y, 0);
+ .end
+
+.frame 3
+ .jump mc1 x=200 y=200 //MOVE
+ .action:
+ // static transformation does not work after startDrag
+ check(mc1._x != 200);
+ check(mc1._y != 200);
+ mc1.stopDrag();
+ .end
+
+.frame 4
+ .jump mc1 x=300 y=300
+ .action:
+ // static transformation does not work even after stopDrag
+ check(mc1._x != 300);
+ check(mc1._y != 300);
+ .end
+
+.frame 5
+ .action:
+ // enable dragging again, just for visual check.
+ mc1.startDrag(true, 200, 200, 300, 300);
+ .end
+
+.frame 6
+ .action:
+ totals(8);
+ stop();
+ .end
+
+.end // end of the file
+
+
diff --git a/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf b/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf
new file mode 100644
index 0000000..841fcb6
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf.trace b/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf.trace
new file mode 100644
index 0000000..b9b5b0b
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/mouse_drag_test.swf.trace
@@ -0,0 +1,12 @@
+PASSED: typeof(mc1.shape1) == movieclip [mouse_drag_test.sc:45]
+PASSED: mc1.shape1 == _level0.mc1 [mouse_drag_test.sc:47]
+PASSED: mc1._x == 0 [mouse_drag_test.sc:49]
+PASSED: mc1._y == 0 [mouse_drag_test.sc:50]
+PASSED: [mouse_drag_test.sc:57]
+PASSED: [mouse_drag_test.sc:58]
+PASSED: [mouse_drag_test.sc:66]
+PASSED: [mouse_drag_test.sc:67]
+Total tests run: 8 typeof expected: number
+#passed: 8
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.sc b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.sc
new file mode 100644
index 0000000..b45afec
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.sc
@@ -0,0 +1,300 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test the exact destruction time about movieclips
+ *
+ * Timeline:
+ *
+ * Frame | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
+ * --------+---+---+---+---+---+---+---+
+ * Event | |P J| | R | | * | |
+ *
+ * P = place (by PlaceObject2)
+ * R = Remove (by RemoveObject2 tag)
+ * J = jump
+ * * = jump target
+ *
+ * Description:
+ *
+ * frame2: character mc1 placed at depth -16381.
+ * mc1 has two frames, _root.gotoAndPlay(6) get executed in it's 2nd frame.
+ * frame3:
+ * frame4: remove character -16381
+ * frame6:
+ *
+ * Expected behaviour:
+ * (1) only part of the AS in a single action_buffer(in the 2nd frame of mc1)
+ * get executed;
+ * (2) character mc1 get destroied at frame 4.
+ * (3) init actions defined in a passing-by frame get executed (while normal actions don't)
+ *
+ */
+
+
+.flash bbox=800x600 filename="movieclip_destruction_test1.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box b1 fill=green width=100 height=100
+ .box b2 fill=red width=100 height=100
+ .box b3 fill=yellow width=100 height=100
+
+
+.frame 2
+
+ .sprite mc1 // Define a sprite named as mc1
+ .frame 1
+ .put b1 x = 300 y = 300
+ .action:
+ note("mc1.frame1");
+ .end
+ .frame 2
+ .action:
+ note("mc1.frame2");
+ check_equals(_root.mc1.getDepth(), -16383);
+ _root.x = 0;
+ _root.gotoAndPlay(6);
+ // AS below have no chance to be executed.
+ // Since mc1 will get removed during gotoFrame above.
+ _root.x = 100;
+ _root.note("If you see this message, your player is bogus with action execution order");
+ .end
+ .end //end of sprite
+
+ .put mc1 // Place mc1
+
+ .action:
+ note("root.frame2 (after put mc1)");
+ check_equals(typeof(mc1), 'movieclip');
+ check_equals(mc1.getDepth(), -16383);
+ .end
+
+
+.frame 3
+ .action: note("root.frame3 (before definesprite)");
+ .end
+
+ .sprite mc2 // Define mc2 and add init_actions for it
+ .frame 1
+ .put b2 x = 300 y = 300
+ .end
+
+ .initaction mc2: // Add initactions for mc2(mc2 is not placed)
+ note("initaction mc2");
+ _root.initActionExecuted = "mc2";
+ // mc1 is still alive here, _root.gotoAndPlay(6) hasn't been executed yet.
+ // Note mc1 has 2 frames.
+ check_equals(typeof(mc1), 'movieclip');
+ check_equals(mc1.getDepth(), -16383);
+ .end
+
+ .action: note("root.frame3 (after initaction)");
+ .end
+
+.frame 4
+
+ .sprite mc3 // Define mc2 and add initactions for it
+ .frame 1
+ .put b3 x = 300 y = 300
+ .end
+
+ .action:
+ note("root.frame4 (before initaction)");
+ _root.check(false); // should not be executed
+ .end
+
+ .initaction mc3: // Add initactions for mc3(mc3 is not placed)
+ note("initaction mc3 in root frame4");
+ _root.initActionExecuted += ", mc3";
+ _root.check_equals(typeof(mc1), 'undefined');
+ _root.check_equals(typeof(_root.getInstanceAtDepth(-16386)), 'undefined');
+ .end
+
+ .action:
+ note("root.frame4 (after initaction)");
+ _root.check(false); // should not be executed
+ .end
+
+ .del mc1 // Remove sprite mc1
+
+ .action:
+ note("root.frame4 (after del mc1)");
+ _root.check(false); // should not be executed
+ .end
+
+
+.frame 6 // target frame
+ .action:
+ check_equals(_root.x, 0);
+ .end
+
+
+//
+// Seperate tests.
+// Test that the whole function body still get executed even when
+// 'this' object is null(removed by MovieClip.removeMovieClip()).
+.frame 8
+ .action:
+ _root.createEmptyMovieClip("mc4", 100);
+ mc4Ref = mc4;
+ check_equals(typeof(_root.mc4), 'movieclip');
+
+ mc4.func = function (clip)
+ {
+ _root.check_equals(this.valueOf(), mc4);
+ _root.testvar1 = 100;
+ // don't use clip.removeMovieClip here, to avoid bogus compiler conversion.
+ // 'removeMovieClip' is converted to lower case with the above format.
+ // This is a swf7 file.
+ clip['removeMovieClip']();
+ _root.check_equals(typeof(_root.mc4), 'undefined');
+ _root.check_equals(typeof(this), 'movieclip');
+ _root.check_equals(this.valueOf(), null); // this pointer is null!
+ _root.testvar2 = 200;
+ };
+
+ mc4.func(mc4); // invoke the function and remove mc4
+
+ check_equals(_root.testvar1, 100);
+ check_equals(_root.testvar2, 200);
+ check_equals(typeof(_root.mc4Ref), 'movieclip');
+ check_equals(_root.mc4Ref.valueOf(), undefined);
+ .end
+
+//
+// seperate tests.
+// similar to tests in frame8, but onUnload is defined for the given movieClip
+.frame 10
+ .action:
+ _root.createEmptyMovieClip("mc5", 200);
+ check_equals(typeof(_root.mc5), 'movieclip');
+
+ mc5.onUnload = function () {}; // Define onUnload for mc5
+
+ mc5.func = function (clip)
+ {
+ _root.check_equals(this.valueOf(), mc5);
+ _root.testvar1 = 300;
+ clip['removeMovieClip']();
+ _root.check_equals(typeof(_root.mc5), 'movieclip');
+ _root.check_equals(typeof(this), 'movieclip');
+ _root.check_equals(this, _root.mc5);
+ _root.testvar2 = 400;
+ };
+
+ mc5.func(mc5); // invoke the function and remove mc5
+
+ check_equals(_root.testvar1, 300);
+ check_equals(_root.testvar2, 400);
+ check_equals(typeof(_root.mc5), 'movieclip');
+ check_equals(mc5.getDepth(), -32969);
+ .end
+
+//
+// Seperate tests for DoInitAction.
+//
+.frame 12
+ .sprite mc61 // Define a movieclip
+ .frame 1 .put b3
+ .end
+
+ .sprite mc6
+ .frame 1
+ .put mc61
+ .initaction mc61: // Add initactions for mc6
+ _root.initActionExecuted += ", mc61";
+ _root.check_equals(this, _root); // target is the root !
+ .end
+ .end
+
+ .put mc6 // Place the movieclip
+
+ .initaction mc6: // Add initactions for mc6
+ // Gnash fails by not respecting actions order for initactions
+ _root.initActionExecuted += ", mc6";
+
+
+ // Due to a bug in the proprietary player, we need to trace(__proto__) to
+ // force proper construction of the sprites.
+ _root.xcheck_equals(mc6.__proto__, Object.prototype); // returns wrong answer at first, gnash does the right thing here
+ _root.xcheck_equals(mc7.__proto__, Object.prototype); // returns wrong answer at first, gnash does the right thing here
+ trace(mc6.__proto__); trace(mc7.__proto__);
+ _root.check_equals(mc6.__proto__, MovieClip.prototype);
+ _root.check_equals(mc7.__proto__, MovieClip.prototype);
+
+ _root.check_equals(typeof(mc6), 'movieclip'); // Gnash fails because executes init actions before DLIST tags
+ _root.check_equals(typeof(mc6.mc61), 'movieclip'); // Gnash fails because executes init actions before DLIST tags
+ _root.check_equals(typeof(mc7), 'movieclip'); // Gnash fails because executes init actions before DLIST tags
+ _root.check_equals(typeof(mc7.mc71), 'movieclip'); // Gnash fails because executes init actions before DLIST tags
+ _root.check_equals(this, _root); // target is the root !
+ .end
+
+ .sprite mc71
+ .action:
+ _root.check_equals(this.__proto__, MovieClip.prototype);
+ .end
+ .frame 1 .put b3
+ .end
+
+ .sprite mc7 // Define a movieclip
+ .frame 1 .put mc71
+ .end
+
+ .put mc7 // Place the movieclip
+
+
+.frame 15
+ .initaction mc6: //Add initactions for mc6 again.
+ x = 0;
+ _root.initActionExecuted += ", mc6";
+ // This check should not be executed.
+ // We should ignore the second init actions for the same sprite.
+ // It is here just for detecting some bogus implementation
+ _root.check_equals(x, 1);
+ .end
+
+
+.frame 16
+ .sprite mc8
+ .end
+
+ .sprite mc9
+ .put mc8
+ .end
+
+ // test initactions for child sprite.
+ .initaction mc8:
+ _root.check_equals(this, _root);
+ _root.initActionExecuted += ", mc8";
+ .end
+
+ .action:
+ _root.check_equals(initActionExecuted, "mc2, mc3, mc61, mc6, mc8");
+ stop();
+ totals(39);
+ .end
+
+.end // file end
+
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf
new file mode 100644
index 0000000..b7edfa6
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf.trace b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf.trace
new file mode 100644
index 0000000..2289096
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test1.swf.trace
@@ -0,0 +1,53 @@
+mc1.frame1 [movieclip_destruction_test1.sc:71]
+root.frame2 (after put mc1) [movieclip_destruction_test1.sc:89]
+PASSED: typeof(mc1) == movieclip [movieclip_destruction_test1.sc:90]
+PASSED: mc1.getDepth() == -16383 [movieclip_destruction_test1.sc:91]
+initaction mc2 [movieclip_destruction_test1.sc:105]
+PASSED: typeof(mc1) == movieclip [movieclip_destruction_test1.sc:109]
+PASSED: mc1.getDepth() == -16383 [movieclip_destruction_test1.sc:110]
+mc1.frame2 [movieclip_destruction_test1.sc:75]
+PASSED: _root.mc1.getDepth() == -16383 [movieclip_destruction_test1.sc:76]
+initaction mc3 in root frame4 [movieclip_destruction_test1.sc:129]
+PASSED: typeof(mc1) == undefined [movieclip_destruction_test1.sc:131]
+PASSED: typeof(_root.getInstanceAtDepth(-16386)) == undefined [movieclip_destruction_test1.sc:132]
+root.frame3 (before definesprite) [movieclip_destruction_test1.sc:96]
+root.frame3 (after initaction) [movieclip_destruction_test1.sc:113]
+PASSED: _root.x == 0 [movieclip_destruction_test1.sc:150]
+PASSED: typeof(_root.mc4) == movieclip [movieclip_destruction_test1.sc:162]
+PASSED: this.valueOf() == _level0.mc4 [movieclip_destruction_test1.sc:166]
+PASSED: typeof(_root.mc4) == undefined [movieclip_destruction_test1.sc:172]
+PASSED: typeof(this) == movieclip [movieclip_destruction_test1.sc:173]
+PASSED: this.valueOf() == null [movieclip_destruction_test1.sc:174]
+PASSED: _root.testvar1 == 100 [movieclip_destruction_test1.sc:180]
+PASSED: _root.testvar2 == 200 [movieclip_destruction_test1.sc:181]
+PASSED: typeof(_root.mc4Ref) == movieclip [movieclip_destruction_test1.sc:182]
+PASSED: _root.mc4Ref.valueOf() == undefined [movieclip_destruction_test1.sc:183]
+PASSED: typeof(_root.mc5) == movieclip [movieclip_destruction_test1.sc:192]
+PASSED: this.valueOf() == _level0.mc5 [movieclip_destruction_test1.sc:198]
+PASSED: typeof(_root.mc5) == movieclip [movieclip_destruction_test1.sc:201]
+PASSED: typeof(this) == movieclip [movieclip_destruction_test1.sc:202]
+PASSED: this == _level0.mc5 [movieclip_destruction_test1.sc:203]
+PASSED: _root.testvar1 == 300 [movieclip_destruction_test1.sc:209]
+PASSED: _root.testvar2 == 400 [movieclip_destruction_test1.sc:210]
+PASSED: typeof(_root.mc5) == movieclip [movieclip_destruction_test1.sc:211]
+PASSED: mc5.getDepth() == -32969 [movieclip_destruction_test1.sc:212]
+PASSED: this == _level0 [movieclip_destruction_test1.sc:228]
+XPASSED: mc6.__proto__ == [object Object] [movieclip_destruction_test1.sc:241]
+XPASSED: mc7.__proto__ == [object Object] [movieclip_destruction_test1.sc:242]
+[object Object]
+[object Object]
+PASSED: mc6.__proto__ == [object Object] [movieclip_destruction_test1.sc:244]
+PASSED: mc7.__proto__ == [object Object] [movieclip_destruction_test1.sc:245]
+PASSED: typeof(mc6) == movieclip [movieclip_destruction_test1.sc:247]
+PASSED: typeof(mc6.mc61) == movieclip [movieclip_destruction_test1.sc:248]
+PASSED: typeof(mc7) == movieclip [movieclip_destruction_test1.sc:249]
+PASSED: typeof(mc7.mc71) == movieclip [movieclip_destruction_test1.sc:250]
+PASSED: this == _level0 [movieclip_destruction_test1.sc:251]
+PASSED: this.__proto__ == [object Object] [movieclip_destruction_test1.sc:256]
+PASSED: this == _level0 [movieclip_destruction_test1.sc:289]
+PASSED: initActionExecuted == mc2, mc3, mc61, mc6, mc8 [movieclip_destruction_test1.sc:294]
+Total tests run: 39 typeof expected: number
+#passed: 37
+#failed: 0
+#unexpected successes: 2
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.sc b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.sc
new file mode 100644
index 0000000..5a92ecb
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.sc
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test destruction of static movieclips and soft references
+ *
+ * Description:
+ *
+ * frame2: Place mc1, mc2, mc3 by PlaceObject2 tag.
+ * Create a soft reference mc1Ref for mc1, mc2Ref for mc2, mc3Ref for mc3.
+ * Define onUnload for mc2, define onUnload for mc3.
+ * Define mc2.testvar = 100, define mc3.testvar = new Number(100);
+ *
+ * frame3: Remove mc1, mc2, mc3 by RemovieObject2 tag
+ *
+ *
+ * Expected behaviour:
+ * (1) mc1Ref in frame3 is dangling.
+ * (2) mc2Ref, mc3Ref, mc2 and mc3 are still accessible in frame3.
+ * (3) Movieclip.swapDepths() does not work for mc2 and mc3 in frame3.
+ * (4) 'testvar' of mc2 and mc3 keep alive after onUnload called.
+ * (5) mc2Ref, mc3Ref are dangling at frame4.
+ *
+ */
+
+
+.flash bbox=800x600 filename="movieclip_destruction_test2.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box b1 fill=green width=100 height=100
+ .box b2 fill=red width=100 height=100
+ .box b3 fill=yellow width=100 height=100
+
+.frame 2
+
+ .sprite mc1 // Define a sprite mc1
+ .frame 1
+ .put b1 x = 0 y = 0
+ .end //end of sprite
+
+ .sprite mc2 // Define a sprite mc2
+ .frame 1
+ .put b2 x = 0 y = 0
+ .end
+
+ .sprite mc3 // Define a sprite mc3
+ .frame 1
+ .put b3 x = 0 y = 0
+ .end
+
+ .put mc1 x = 100 y = 300 // Place mc1
+ .put mc2 x = 200 y = 300 // Place mc2
+ .put mc3 x = 300 y = 300 // Place mc3
+
+ .action:
+
+ _root.mc2UnlaodedCount = 0;
+ _root.mc3UnlaodedCount = 0;
+ check_equals(typeof(mc1), 'movieclip');
+ check_equals(mc1.getDepth(), -16383);
+ check_equals(mc2.getDepth(), -16382);
+ check_equals(mc3.getDepth(), -16381);
+ // Define a onUnload for mc2 and mc3
+ mc2.onUnload = function ()
+ {
+ _root.check_equals(mc2.getDepth(), -16387); // already shifted inside unload handler !
+ _root.check_equals(this.getDepth(), -16387); // ...
+ _root.mc2UnlaodedCount++;
+ // mc2.testvar keeps alive as long as mc2 is alive
+ _root.check_equals(mc2.testvar, 100);
+ };
+ mc3.onUnload = function ()
+ {
+ _root.mc3UnlaodedCount++;
+ _root.check_equals(mc3.testvar, 100);
+ };
+
+ mc2.testvar = 100;
+ mc3.testvar = new Number(100);
+
+ // Create soft references for mc1 and mc2 and mc3
+ mc1Ref = mc1;
+ mc2Ref = mc2;
+ mc3Ref = mc3;
+ .end
+
+
+.frame 3
+ .del mc1 // Remove mc1 by RemoveObject2
+ .del mc2 // Remove mc2 by RemoveObject2
+ .del mc3 // Remove mc3 by RemoveObject2
+
+ .action:
+ check_equals(mc2UnlaodedCount, 1); // mc2.onUnload triggered
+ check_equals(mc3UnlaodedCount, 1); // mc3.onUnload triggered
+ check_equals(mc1Ref.valueOf(), null);
+ check_equals(mc2Ref, mc2);
+ check_equals(mc3Ref, mc3);
+
+ check_equals(typeof(mc1), 'undefined'); // cann't access the hard reference
+ // mc1 is destroyed. it is not in the removed depth zone.
+ check_equals(_root.getInstanceAtDepth(-16386), undefined);
+ check_equals(typeof(mc2), 'movieclip'); // mc2 is still accessable
+ check_equals(typeof(mc3), 'movieclip'); // mc3 is still accessable
+ check_equals(mc2.getDepth(), -16387); // depth of mc2 changed after onUnload
+ check_equals(mc3.getDepth(), -16388); // depth of mc3 changed after onUnload
+
+ mc2.swapDepths(mc3);
+ check_equals(mc2.getDepth(), -16387); // depth not change after swapDepths
+ check_equals(mc3.getDepth(), -16388); // depth not change after swapDepths
+
+ mc2.swapDephts(-10);
+ mc2.swapDephts(10);
+ check_equals(mc2.getDepth(), -16387); // depth not change after swapDepths
+ check_equals(mc3.getDepth(), -16388); // depth not change after swapDepths
+
+ check_equals(mc2.testvar, 100);
+ check_equals(mc3.testvar, 100);
+ mc2.removMovieClip();
+ mc3.removMovieClip();
+ check_equals(mc2UnlaodedCount, 1); // mc2.onUnload not triggered again
+ check_equals(mc2UnlaodedCount, 1); // mc3.onUnload not triggered again
+ check_equals(typeof(mc2), 'movieclip'); // mc2 is still accessible
+ check_equals(typeof(mc3), 'movieclip'); // mc3 is still accessible
+ check_equals(mc2.getDepth(), -16387);
+ check_equals(mc3.getDepth(), -16388);
+ check_equals(mc2._x, 200);
+ check_equals(mc3._y, 300);
+ check_equals(mc2.testvar, 100);
+ check_equals(mc3.testvar, 100);
+
+ mc2.onUnload();
+ mc3.onUnload();
+ check_equals(mc2UnlaodedCount, 2); // we can still invoke onUnload
+ check_equals(mc2UnlaodedCount, 2); // we can still invoke onUnload
+ .end
+
+
+.frame 4
+ .action:
+ check_equals(typeof(mc1), 'undefined');
+ check_equals(typeof(mc2), 'undefined');
+ check_equals(typeof(mc3), 'undefined');
+ check_equals(mc1Ref.valueOf(), null);
+ check_equals(mc2Ref.valueOf(), null);
+ check_equals(mc3Ref.valueOf(), null);
+ .end
+
+// Seperate tests for Movieclip.swapDepths
+.frame 5
+ .put mc1 x = 100 y = 300 // Place mc1
+ .action:
+ check_equals(mc1.getDepth(), -16380);
+ mc1.swapDepths(-16385); // doesn't work, can't swap mc1 to a depth below -16384
+ check_equals(mc1.getDepth(), -16380);
+ mc1.swapDepths(-16384); // works
+ check_equals(mc1.getDepth(), -16384);
+ mc1.swapDepths(-32769); // doesn't work, can't swap mc1 to a depth below -16384
+ check_equals(mc1.getDepth(), -16384);
+ mc1.swapDepths(-402770); // doesn't work, can't swap mc1 to a depth below -16384
+ check_equals(mc1.getDepth(), -16384);
+ .end
+
+.frame 6
+ .action:
+ totals(52);
+ stop();
+ .end
+
+
+.end // end of the file
+
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf
new file mode 100644
index 0000000..fb54709
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf.trace b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf.trace
new file mode 100644
index 0000000..51a1cea
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test2.swf.trace
@@ -0,0 +1,56 @@
+PASSED: typeof(mc1) == movieclip [movieclip_destruction_test2.sc:81]
+PASSED: mc1.getDepth() == -16383 [movieclip_destruction_test2.sc:82]
+PASSED: mc2.getDepth() == -16382 [movieclip_destruction_test2.sc:83]
+PASSED: mc3.getDepth() == -16381 [movieclip_destruction_test2.sc:84]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:88]
+PASSED: this.getDepth() == -16387 [movieclip_destruction_test2.sc:89]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:92]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:97]
+PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:116]
+PASSED: mc3UnlaodedCount == 1 [movieclip_destruction_test2.sc:117]
+PASSED: mc1Ref.valueOf() == null [movieclip_destruction_test2.sc:118]
+PASSED: mc2Ref == _level0.mc2 [movieclip_destruction_test2.sc:119]
+PASSED: mc3Ref == _level0.mc3 [movieclip_destruction_test2.sc:120]
+PASSED: typeof(mc1) == undefined [movieclip_destruction_test2.sc:122]
+PASSED: _root.getInstanceAtDepth(-16386) == undefined [movieclip_destruction_test2.sc:124]
+PASSED: typeof(mc2) == movieclip [movieclip_destruction_test2.sc:125]
+PASSED: typeof(mc3) == movieclip [movieclip_destruction_test2.sc:126]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:127]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:128]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:131]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:132]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:136]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:137]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:139]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:140]
+PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:143]
+PASSED: mc2UnlaodedCount == 1 [movieclip_destruction_test2.sc:144]
+PASSED: typeof(mc2) == movieclip [movieclip_destruction_test2.sc:145]
+PASSED: typeof(mc3) == movieclip [movieclip_destruction_test2.sc:146]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:147]
+PASSED: mc3.getDepth() == -16388 [movieclip_destruction_test2.sc:148]
+PASSED: mc2._x == 200 [movieclip_destruction_test2.sc:149]
+PASSED: mc3._y == 300 [movieclip_destruction_test2.sc:150]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:151]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:152]
+PASSED: mc2.getDepth() == -16387 [movieclip_destruction_test2.sc:88]
+PASSED: this.getDepth() == -16387 [movieclip_destruction_test2.sc:89]
+PASSED: mc2.testvar == 100 [movieclip_destruction_test2.sc:92]
+PASSED: mc3.testvar == 100 [movieclip_destruction_test2.sc:97]
+PASSED: mc2UnlaodedCount == 2 [movieclip_destruction_test2.sc:156]
+PASSED: mc2UnlaodedCount == 2 [movieclip_destruction_test2.sc:157]
+PASSED: typeof(mc1) == undefined [movieclip_destruction_test2.sc:163]
+PASSED: typeof(mc2) == undefined [movieclip_destruction_test2.sc:164]
+PASSED: typeof(mc3) == undefined [movieclip_destruction_test2.sc:165]
+PASSED: mc1Ref.valueOf() == null [movieclip_destruction_test2.sc:166]
+PASSED: mc2Ref.valueOf() == null [movieclip_destruction_test2.sc:167]
+PASSED: mc3Ref.valueOf() == null [movieclip_destruction_test2.sc:168]
+PASSED: mc1.getDepth() == -16380 [movieclip_destruction_test2.sc:175]
+PASSED: mc1.getDepth() == -16380 [movieclip_destruction_test2.sc:177]
+PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:179]
+PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:181]
+PASSED: mc1.getDepth() == -16384 [movieclip_destruction_test2.sc:183]
+Total tests run: 52 typeof expected: number
+#passed: 52
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.sc b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.sc
new file mode 100644
index 0000000..1208b33
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.sc
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test destruction of nested movieClips.
+ *
+ * Description:
+ * frame2: Define a nested movieclip mc1(mc1.mc11.mc111.mc111)
+ * frame3: attach the nested movieclip to stage with a name 'nestedMovieClip'
+ * frame10: nestedMovieClip get removed by one of its child(mc111)
+ *
+ * Expected behaviour:
+ * TODO: add it here.
+ *
+ */
+
+
+.flash bbox=800x600 filename="movieclip_destruction_test3.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ _root.as_order = '0+';
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box green_square fill=green width=100 height=100
+
+.frame 2
+
+ .sprite mc1111
+ .frame 1
+ .put green_square x=300 y=300
+ .frame 8
+ .action:
+ _root.x = 400;
+ _root.as_order += '1+';
+ .end
+ .end
+
+ .sprite mc111
+ .frame 1
+ .put mc1111
+ .frame 8
+ .action:
+ _root.note("nestedMovieClip removed at frame " + _root._currentframe);
+ _root.x = 300;
+ _root.as_order += '2+';
+ _parent._parent['removeMovieClip']();
+ _root.note("actions here should not be executed");
+ _root.x = 'as_should_be_discarded';
+ .end
+ .end
+
+ .sprite mc11
+ .frame 1
+ .put mc111
+ .frame 8
+ .action:
+ _root.x = 200;
+ _root.as_order += '3+';
+ .end
+
+ .end
+
+ .sprite mc1
+ .frame 1
+ .put mc11
+ .frame 8
+ .action:
+ _root.x = 100;
+ _root.as_order += '4+';
+ .end
+ .end
+
+
+.frame 3
+ .action:
+ _root.attachMovie("mc1", "nestedMovieClip", 10);
+ check_equals(typeof(nestedMovieClip), 'movieclip');
+ check_equals(nestedMovieClip.getDepth(), 10);
+ check_equals(typeof(nestedMovieClip.mc11), 'movieclip');
+ check_equals(typeof(nestedMovieClip.mc11.mc111), 'movieclip');
+ check_equals(typeof(nestedMovieClip.mc11.mc111.mc1111), 'movieclip');
+ .end
+
+#define DEFINE_ONUNLOAD
+#ifdef DEFINE_ONUNLOAD
+ .action:
+ // Define onUnload(for deduction)
+ nestedMovieClip.onUnload = function () {};
+ nestedMovieClip.mc11.mc111.onUnload = function () {};
+ nestedMovieClip.mc11.mc111.mc1111.onUnload = function () {};
+ .end
+
+.frame 10
+ .action:
+ // Check 'nestedMovieClip' has unloaded but not destroyed
+ check_equals(nestedMovieClip.getDepth(), -32779);
+ .end
+#endif
+
+
+.frame 12
+ .action:
+ check_equals(_root.x, 300);
+ check_equals(typeof(nestedMovieClip), 'undefined');
+ check_equals(_root.as_order, "0+1+2+");
+ .end
+
+
+.frame 15
+ .action:
+ _root.createEmptyMovieClip("mcA", 10);
+ mcARef = mcA;
+ mcA.onUnload = function () {
+ _root.check_equals(mcA['_root'], _level0);
+ };
+ mcA['removeMovieClip']();
+ _root.check_equals(mcARef.getDepth(), -32779);
+ _root.check_equals(mcARef['_root'], _level0);
+ .end
+
+.frame 16
+ .action:
+ stop();
+ totals(12);
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf
new file mode 100644
index 0000000..4123d3a
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf.trace b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf.trace
new file mode 100644
index 0000000..26625bd
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test3.swf.trace
@@ -0,0 +1,17 @@
+PASSED: typeof(nestedMovieClip) == movieclip [movieclip_destruction_test3.sc:97]
+PASSED: nestedMovieClip.getDepth() == 10 [movieclip_destruction_test3.sc:98]
+PASSED: typeof(nestedMovieClip.mc11) == movieclip [movieclip_destruction_test3.sc:99]
+PASSED: typeof(nestedMovieClip.mc11.mc111) == movieclip [movieclip_destruction_test3.sc:100]
+PASSED: typeof(nestedMovieClip.mc11.mc111.mc1111) == movieclip [movieclip_destruction_test3.sc:101]
+nestedMovieClip removed at frame 10 [movieclip_destruction_test3.sc:63]
+PASSED: nestedMovieClip.getDepth() == -32779 [movieclip_destruction_test3.sc:116]
+PASSED: _root.x == 300 [movieclip_destruction_test3.sc:123]
+PASSED: typeof(nestedMovieClip) == undefined [movieclip_destruction_test3.sc:124]
+PASSED: _root.as_order == 0+1+2+ [movieclip_destruction_test3.sc:125]
+PASSED: mcARef.getDepth() == -32779 [movieclip_destruction_test3.sc:137]
+PASSED: mcARef['_root'] == _level0 [movieclip_destruction_test3.sc:138]
+PASSED: mcA['_root'] == _level0 [movieclip_destruction_test3.sc:134]
+Total tests run: 12 typeof expected: number
+#passed: 12
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.sc b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.sc
new file mode 100644
index 0000000..4e52ec7
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.sc
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test destruction of brother movieClips.
+ *
+ * Description:
+ * frame2: Export three movieclips: mc1-->mc11, mc2, mc3-->mc31
+ * frame3: attach 6 brother movieclips: brother{1,2,3,4,5,6}
+ * frame5: brother{1,3,4,5,6} are removed by brother2
+ *
+ * Expected behaviour:
+ * (1)clipA.removeMovieClip() won't shift its parent or child.
+ * (2)unload a parent automatically unload its children.
+ * (3)whether a child should be unreachable(destroyed) after unload
+ * is not dependent its parent's onUnload.
+ * (4)whether a parent should be unreachable(destroyed) after unload
+ * is dependent on its children' onUnload
+ *
+ */
+
+
+.flash bbox=800x600 filename="movieclip_destruction_test4.swf" background=white version=7 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ _root.as_order = '0+';
+ .end
+
+ // Define 3 shapes(b1, b2, b3)
+ .box green_square fill=green width=100 height=100
+ .box red_square fill=red width=100 height=100
+ .box blue_square fill=blue width=100 height=100
+
+.frame 2
+
+ .sprite mc11
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc11["+this._target+"] (adding green square @ 400,200)");
+ .end
+ .put green_square x=400 y=200
+ .end
+
+ .sprite mc1
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc1["+this._target+"] (adding green square @ 300,200 and mc11)");
+ .end
+ .put green_square x=300 y=200
+ .put mc11
+ .frame 6
+ .end
+
+ .sprite mc2
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc2["+this._target+"] (adding red square)");
+ .end
+ .put red_square x=300 y=300
+ .frame 2
+ .action:
+ _root.note("Running frame2["+this._currentframe+"] actions of mc2["+this._target+"] (nothing new)");
+ .end
+ .frame 3
+ .action:
+ _root.note("Running frame3["+this._currentframe+"] actions of mc2["+this._target+"] (removing brothers 1,3,4,5,6)");
+ _root.brother1['removeMovieClip']();
+ _root.brother3['removeMovieClip']();
+ _root.brother4['removeMovieClip']();
+ _root.brother5['removeMovieClip']();
+ _root.brother6['removeMovieClip']();
+ .end
+ .end
+
+ .sprite mc31
+ .put blue_square x=400 y=400
+ .end
+
+ .sprite mc3
+ .frame 1
+ .action:
+ _root.note("Running frame1["+this._currentframe+"] actions of mc3["+this._target+"] (adding blue square)");
+ .end
+ .put blue_square x=300 y=400
+ .put mc31
+ .frame 6
+ .end
+
+
+.frame 3
+ .action:
+ _root.note("Running frame3 actions of _root (attach brothers)");
+ _root.attachMovie("mc1", "brother1", 10);
+ _root.attachMovie("mc2", "brother2", 20);
+ _root.attachMovie("mc3", "brother3", 30);
+ _root.attachMovie("mc3", "brother4", 40);
+ _root.attachMovie("mc3", "brother5", 50);
+ _root.attachMovie("mc3", "brother6", 60);
+
+ // Define a parent onUnload
+ brother4.onUnload = function () {
+ _root.check_equals(this.getDepth(), -32809);
+ // child mc31 has no onUnload defined. child mc31 has been destroyed.
+ // Gnash fails by keeping the child alive(referenceable)
+ _root.check_equals(typeof(this.mc31), 'undefined');
+ };
+
+ // Define child onUnload
+ brother5.mc31.onUnload = function () {
+ // child mc31 has onUnload defined, not shifted.
+ _root.check_equals(this.getDepth(), -16382);
+ _root.check_equals(typeof(this), 'movieclip');
+ _root.check_equals(typeof(this._parent), 'movieclip');
+ _root.check_equals(this._parent.getDepth(), -32819);
+ };
+
+ //
+ // Define both parent onUnload and child onUnload
+ //
+ brother6.onUnload = function () {
+ _root.check_equals(this.getDepth(), -32829);
+ // child mc31 has onUnload defined, not shifted.
+ _root.check_equals(typeof(this.mc31), 'movieclip');
+ _root.check_equals(this.mc31.getDepth(), -16382);
+ };
+
+ brother6.mc31.onUnload = function () {
+ // child mc31 not shifted
+ _root.check_equals(this.getDepth(), -16382);
+ };
+ .end
+
+.frame 4
+ .action:
+ _root.note("Running frame3 actions of _root (nothing new)");
+ .end
+
+
+.frame 5
+ .action:
+ _root.note("Running frame5 actions of _root");
+ check_equals(typeof(brother1), 'undefined');
+ check_equals(typeof(brother2), 'movieclip');
+ check_equals(typeof(brother3), 'undefined');
+ check_equals(typeof(brother4), 'movieclip');
+ check_equals(typeof(brother5), 'movieclip');
+ check_equals(typeof(brother6), 'movieclip');
+ .end
+
+
+.frame 10
+ .action:
+ check_equals(typeof(brother1), 'undefined');
+ check_equals(typeof(brother2), 'movieclip');
+ check_equals(typeof(brother3), 'undefined');
+ stop();
+ totals(19);
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf
new file mode 100644
index 0000000..754181d
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf.trace b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf.trace
new file mode 100644
index 0000000..592c1f4
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/movieclip_destruction_test4.swf.trace
@@ -0,0 +1,40 @@
+Running frame3 actions of _root (attach brothers) [movieclip_destruction_test4.sc:111]
+Running frame1[1] actions of mc1[/brother1] (adding green square @ 300,200 and mc11) [movieclip_destruction_test4.sc:66]
+Running frame1[1] actions of mc11[/brother1/mc11] (adding green square @ 400,200) [movieclip_destruction_test4.sc:58]
+Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
+Running frame1[1] actions of mc3[/brother3] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame1[1] actions of mc3[/brother4] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame1[1] actions of mc3[/brother5] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame1[1] actions of mc3[/brother6] (adding blue square) [movieclip_destruction_test4.sc:101]
+Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
+Running frame3 actions of _root (nothing new) [movieclip_destruction_test4.sc:154]
+Running frame3[3] actions of mc2[/brother2] (removing brothers 1,3,4,5,6) [movieclip_destruction_test4.sc:85]
+Running frame5 actions of _root [movieclip_destruction_test4.sc:160]
+PASSED: typeof(brother1) == undefined [movieclip_destruction_test4.sc:161]
+PASSED: typeof(brother2) == movieclip [movieclip_destruction_test4.sc:162]
+PASSED: typeof(brother3) == undefined [movieclip_destruction_test4.sc:163]
+PASSED: typeof(brother4) == movieclip [movieclip_destruction_test4.sc:164]
+PASSED: typeof(brother5) == movieclip [movieclip_destruction_test4.sc:165]
+PASSED: typeof(brother6) == movieclip [movieclip_destruction_test4.sc:166]
+PASSED: this.getDepth() == -32809 [movieclip_destruction_test4.sc:121]
+PASSED: typeof(this.mc31) == undefined [movieclip_destruction_test4.sc:124]
+PASSED: this.getDepth() == -16382 [movieclip_destruction_test4.sc:130]
+PASSED: typeof(this) == movieclip [movieclip_destruction_test4.sc:131]
+PASSED: typeof(this._parent) == movieclip [movieclip_destruction_test4.sc:132]
+PASSED: this._parent.getDepth() == -32819 [movieclip_destruction_test4.sc:133]
+PASSED: this.getDepth() == -16382 [movieclip_destruction_test4.sc:148]
+PASSED: this.getDepth() == -32829 [movieclip_destruction_test4.sc:140]
+PASSED: typeof(this.mc31) == movieclip [movieclip_destruction_test4.sc:142]
+PASSED: this.mc31.getDepth() == -16382 [movieclip_destruction_test4.sc:143]
+Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
+Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
+Running frame3[3] actions of mc2[/brother2] (removing brothers 1,3,4,5,6) [movieclip_destruction_test4.sc:85]
+Running frame1[1] actions of mc2[/brother2] (adding red square) [movieclip_destruction_test4.sc:76]
+Running frame2[2] actions of mc2[/brother2] (nothing new) [movieclip_destruction_test4.sc:81]
+PASSED: typeof(brother1) == undefined [movieclip_destruction_test4.sc:172]
+PASSED: typeof(brother2) == movieclip [movieclip_destruction_test4.sc:173]
+PASSED: typeof(brother3) == undefined [movieclip_destruction_test4.sc:174]
+Total tests run: 19 typeof expected: number
+#passed: 19
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.sc b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.sc
new file mode 100644
index 0000000..3257385
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.sc
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * test opcode guard and setTarget
+ */
+
+
+.flash bbox=800x600 filename="opcode_guard_test2.swf" background=white version=6 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+ .end
+
+
+.frame 2
+ .sprite mc1 // Define a sprite
+ .frame 2
+ .action:
+ setTarget('/mc1');
+ _root.gotoAndPlay(5);
+ _root.check(false); // shoudn't be executed
+ setTarget('');
+ .end
+ .end
+ .put mc1 // Place mc1
+
+
+.frame 4
+ .del mc1
+
+.frame 5
+ .sprite mc2 // Define mc2
+ .end
+ .put mc2 // Place mc2
+ .action:
+ mc2.duplicateMovieClip('dup1', 10);
+ mc2.duplicateMovieClip('dup2', 20);
+ mc2.duplicateMovieClip('dup3', 30);
+
+ _root.dup3.onUnload = function() {};
+
+ _root.check_equals(typeof(_root.dup1), 'movieclip');
+ _root.check_equals(typeof(_root.dup2), 'movieclip');
+
+ dup1.testVar = 'dup1_var'; //
+ setTarget('dup1');
+ removeMovieClip(_root.dup1);
+ // seems Gnash discarded the following 2 tests, caused by opcode guard with
+ // current target. I think we should use the original target.
+ _root.check_equals(typeof(_root.dup1), 'undefined');
+ _root.check_equals(testVar, undefined);
+ setTarget('');
+
+ dup2.testVar = 'dup2_var';
+ with('dup2'){
+ removeMovieClip(_root.dup2);
+ // seems Gnash discarded the following 2 tests
+ _root.check_equals(typeof(_root.dup2), 'undefined');
+ _root.check_equals(testVar, undefined);
+ }
+
+ dup3.testVar = 'dup3_var'; //
+ setTarget('dup3');
+ removeMovieClip(_root.dup3);
+ // dup3 is unloaded but not destroyed
+ _root.check_equals(typeof(_root.dup3), 'movieclip');
+ _root.check_equals(testVar, 'dup3_var');
+ setTarget('');
+
+ .end
+
+
+.frame 6
+ .sprite mc31
+ .action:
+ setTarget('/mc3/mc32');
+ _root.gotoAndPlay(8); // unload it's parent mc3
+ _root.check(false); // shouldn't be executed
+ setTarget('');
+ .end
+ .end
+ .sprite mc32
+ .end
+ .sprite mc3
+ .put mc31
+ .put mc32
+ .end
+ .put mc3
+
+
+.frame 7
+ .del mc3
+
+.frame 8
+ .sprite mc4
+ .end
+ .sprite mc5
+ .action:
+ setTarget('/mc4');
+ _root.gotoAndPlay(9);
+ _root.testvar = true; // should be executed
+ setTarget('');
+ .end
+ .end
+ .put mc4
+ .put mc5
+
+.frame 9
+ .del mc4
+
+.frame 10
+ .action:
+ _root.xcheck_equals(testvar, true);
+ .end
+
+//
+// separate tests for setTargetExpression
+//
+.frame 12
+ .action:
+ mc100Ref = _root.createEmptyMovieClip("mcA", 100);
+ mc100Ref.testvar = 100;
+ mc101Ref = _root.createEmptyMovieClip("mcA", 101);
+ mc101Ref.testvar = 101;
+ _root.check_equals(mc100Ref.testvar, 100);
+ _root.check_equals(mc101Ref.testvar, 101);
+
+ setTarget(mc100Ref);
+ _root.check_equals(testvar, 100);
+ setTarget('');
+
+ setTarget(mc101Ref);
+ // reference mc100Ref.testvar
+ _root.check_equals(testvar, 100);
+
+ _root.mc99Ref = _root.createEmptyMovieClip("mcA", 99);
+ _root.mc99Ref.testvar = 99;
+ // still reference mc100Ref.testvar
+ _root.check_equals(testvar, 100);
+ setTarget('');
+
+ _root.check_equals(mc99Ref.testvar, 99);
+
+
+ ref200=createEmptyMovieClip('name', 200);
+ ref200.testvar = 200;
+ ref200.onUnload = function() {};
+ ref201=createEmptyMovieClip('name', 201);
+ ref201.testvar = 201;
+ ref200.removeMovieClip();
+ _root.check_equals(ref200.getDepth(), -32969);
+ _root.check_equals(ref201.getDepth(), 201);
+ setTarget(ref200);
+ _root.check_equals(testvar, 200);
+ setTarget('');
+
+ setTarget(ref201);
+ _root.check_equals(testvar, 200);
+ setTarget('');
+ .end
+
+
+//
+// separate tests for setTarget('/')
+//
+.frame 13
+ .sprite mc6
+ .action:
+ setTarget('/');
+ _root.check_equals(_target, "/");
+ gotoAndPlay(15);
+ setTarget('');
+ .end
+ .end
+ .put mc6
+
+.frame 14
+ .action:
+ _root.check(false); // shoudn't executed!
+ .end
+
+.frame 15
+
+ .action:
+ stop();
+ // Gnash failed on totals() by discarding some checks.
+ xtotals(20);
+ .end
+
+.end // file end
+
diff --git a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf
new file mode 100644
index 0000000..b717e7f
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf.trace b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf.trace
new file mode 100644
index 0000000..5635c01
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/opcode_guard_test2.swf.trace
@@ -0,0 +1,26 @@
+PASSED: typeof(_root.dup1) == movieclip [opcode_guard_test2.sc:61]
+PASSED: typeof(_root.dup2) == movieclip [opcode_guard_test2.sc:62]
+PASSED: typeof(_root.dup1) == undefined [opcode_guard_test2.sc:69]
+PASSED: testVar == [opcode_guard_test2.sc:70]
+PASSED: typeof(_root.dup2) == undefined [opcode_guard_test2.sc:77]
+PASSED: testVar == [opcode_guard_test2.sc:78]
+PASSED: typeof(_root.dup3) == movieclip [opcode_guard_test2.sc:85]
+PASSED: testVar == dup3_var [opcode_guard_test2.sc:86]
+XPASSED: testvar == true [opcode_guard_test2.sc:132]
+PASSED: mc100Ref.testvar == 100 [opcode_guard_test2.sc:144]
+PASSED: mc101Ref.testvar == 101 [opcode_guard_test2.sc:145]
+PASSED: testvar == 100 [opcode_guard_test2.sc:148]
+PASSED: testvar == 100 [opcode_guard_test2.sc:153]
+PASSED: testvar == 100 [opcode_guard_test2.sc:158]
+PASSED: mc99Ref.testvar == 99 [opcode_guard_test2.sc:161]
+PASSED: ref200.getDepth() == -32969 [opcode_guard_test2.sc:170]
+PASSED: ref201.getDepth() == 201 [opcode_guard_test2.sc:171]
+PASSED: testvar == 200 [opcode_guard_test2.sc:173]
+PASSED: testvar == 200 [opcode_guard_test2.sc:177]
+PASSED: _target == / [opcode_guard_test2.sc:189]
+Total tests run: 20 typeof expected: number
+XPASSED: TOTAL tests run: 20 [ [opcode_guard_test2.sc:206]]
+#passed: 19
+#failed: 0
+#unexpected successes: 2
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/registerclass_test3.sc b/test/gnash/misc-swfc.all/pending/registerclass_test3.sc
new file mode 100644
index 0000000..95a0462
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/registerclass_test3.sc
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Test registerClass
+ *
+ * Description:
+ * frame1: tests simulate the layout of youtube player2.swf
+ * frame2: export libItem1, export libItem2
+ * frame3: DoInitAction(libItem1), DoInitAction(libItem2), PlaceObject(libItem2)
+ * "Object.registerClass('libItem1', theClass1)" is called in DoInitAction(libItem1)
+ * "Object.registerClass('libItem2', theClass2)" is called in DoInitAction(libItem2)
+ * Observed:
+ * the effect of "Object.registerClass('libItem2', theClass2)" is not visible
+ * in DoInitAction(libItem2). Note: there's no attachMovie for libItem2 in DoInitAction(libItem2)
+ */
+
+// use swf6 for case sensitiviness
+.flash bbox=800x600 filename="registerclass_test3.sc" background=white version=6 fps=12
+
+.frame 1
+ .box b1 fill=green width=100 height=100
+
+ .sprite xxx
+ .end
+
+ .initaction xxx:
+ // make sure Dejagnu is available in the first frame
+ #include "Dejagnu.sc"
+ .end
+
+ // Define fullDisplay and export it
+ .sprite fullDisplay
+ .end
+
+ .action:
+ note("root DoAction of frame1");
+ check_equals(typeof(player.movie), 'movieclip');
+ check_equals(player.movie.__proto__, logic_Movie.prototype);
+ player.movie.setMovie();
+ check_equals(_root.testvar, 100);
+ .end
+
+ .sprite id141
+ // Place a child sprite name it as 'movie'
+ .put movie=fullDisplay
+ .end
+
+ .initaction id141:
+ note("root first InitAction of frame1 (where we check if object placed after is visible)");
+ check_equals(typeof(player.movie), 'movieclip');
+ check_equals(player.movie.__proto__, MovieClip.prototype);
+ .end
+
+ // Place sprite id141 and name it as 'player'
+ .put player=id141
+
+ // Define _Packages.logic.Movie and export it
+ .sprite _Packages.logic.Movie
+ .end
+
+ // Define class logic_Movie
+ .initaction _Packages.logic.Movie:
+ note("root second InitAction of frame1 (where the class is defined)");
+ check_equals(typeof(player.movie), 'movieclip');
+ check_equals(player.movie.__proto__, MovieClip.prototype);
+ logic_Movie = function() {};
+ logic_Movie.prototype = new MovieClip();
+ logic_Movie.prototype.setMovie = function () { _root.testvar = 100; };
+ .end
+
+ // register sprite player.movie to class logic_Movie
+ .initaction fullDisplay:
+ note("root third InitAction of frame1 (where registerClass is invoked)");
+ Object.registerClass("fullDisplay", logic_Movie);
+ .end
+
+
+.frame 2
+ .sprite child1
+ .put b1 x=100 y=100
+ .end
+
+ .sprite child2
+ .put b1 x=100 y=200
+ .end
+
+ .sprite libItem1 // Define a sprite libItem1
+ .put child1
+ .end
+ .sprite libItem2 // Define a sprite libItem2
+ .put child2
+ .end
+
+
+.frame 3
+
+ .action:
+ // registerClass effects are visible here
+ check_equals(libItem2.__proto__, theClass2.prototype);
+ .end
+
+ .initaction libItem1:
+ theClass1 = function() { this.testvar = 60;};
+ theClass1.prototype = new MovieClip();
+ Object.registerClass('libItem1', theClass1);
+
+ _root.attachMovie('libItem1', 'clip1', 10);
+ check_equals(typeof(clip1), 'movieclip');
+ check_equals(clip1.__proto__, theClass1.prototype);
+
+ clip1.duplicateMovieClip("dup1", 10);
+ check_equals(typeof(dup1), 'movieclip');
+ check_equals(dup1.__proto__, theClass1.prototype);
+ check_equals(dup1.testvar, 60);
+
+ // sprite libItem1 never placed.
+ check_equals(typeof(libItem1), 'undefined');
+ .end
+ .initaction libItem2:
+ theClass2 = function() { this.testvar = 60;};
+ theClass2.prototype = new MovieClip();
+ Object.registerClass('libItem2', theClass2);
+
+ // Gnash failed by executing init actions before DLIST tags.
+ check_equals(typeof(libItem2), 'movieclip');
+ check_equals(libItem2.__proto__, MovieClip.prototype);
+ check_equals(libItem2.__proto__, MovieClip.prototype);
+
+ // Childs of libItem2 have also been placed already
+ // Gnash fails by executing init actions before frame0 tags
+ check_equals(typeof(libItem2.child2), 'movieclip');
+ .end
+
+ .put libItem2
+
+.frame 4
+ .action:
+ check_equals(libItem2.__proto__, theClass2.prototype);
+ .end
+
+.frame 5
+ .action:
+ totals(19);
+ stop();
+ .end
+
+
+.end // end of the file
+
+
diff --git a/test/gnash/misc-swfc.all/pending/registerclass_test3.swf b/test/gnash/misc-swfc.all/pending/registerclass_test3.swf
new file mode 100644
index 0000000..1ee0aff
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/registerclass_test3.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/registerclass_test3.swf.trace b/test/gnash/misc-swfc.all/pending/registerclass_test3.swf.trace
new file mode 100644
index 0000000..e8c4d94
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/registerclass_test3.swf.trace
@@ -0,0 +1,27 @@
+root first InitAction of frame1 (where we check if object placed after is visible) [registerclass_test3.sc:67]
+PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:68]
+PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:69]
+root second InitAction of frame1 (where the class is defined) [registerclass_test3.sc:81]
+PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:82]
+PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:83]
+root third InitAction of frame1 (where registerClass is invoked) [registerclass_test3.sc:91]
+root DoAction of frame1 [registerclass_test3.sc:54]
+PASSED: typeof(player.movie) == movieclip [registerclass_test3.sc:55]
+PASSED: player.movie.__proto__ == [object Object] [registerclass_test3.sc:56]
+PASSED: _root.testvar == 100 [registerclass_test3.sc:58]
+PASSED: typeof(clip1) == movieclip [registerclass_test3.sc:126]
+PASSED: clip1.__proto__ == [object Object] [registerclass_test3.sc:127]
+PASSED: typeof(dup1) == movieclip [registerclass_test3.sc:130]
+PASSED: dup1.__proto__ == [object Object] [registerclass_test3.sc:131]
+PASSED: dup1.testvar == 60 [registerclass_test3.sc:132]
+PASSED: typeof(libItem1) == undefined [registerclass_test3.sc:135]
+PASSED: typeof(libItem2) == movieclip [registerclass_test3.sc:143]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:144]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:145]
+PASSED: typeof(libItem2.child2) == movieclip [registerclass_test3.sc:149]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:117]
+PASSED: libItem2.__proto__ == [object Object] [registerclass_test3.sc:156]
+Total tests run: 19 typeof expected: number
+#passed: 19
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/soft_reference_test1.sc b/test/gnash/misc-swfc.all/pending/soft_reference_test1.sc
new file mode 100644
index 0000000..47bf694
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/soft_reference_test1.sc
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * Tests about soft reference to sprites.
+ *
+ * Description:
+ * frame1: create an movieclip and rename it;
+ * frame3: remove the movieclip;
+ * frame5: re-create an movieclip with the original name.
+ */
+
+
+.flash bbox=800x600 filename="soft_reference_test1.swf" background=white version=6 fps=12
+
+.frame 1
+ .action:
+ #include "Dejagnu.sc"
+
+ //create a movieclip
+ mcRef = this.createEmptyMovieClip("mc", 10);
+ check(typeof(mc)=='movieclip');
+ check(typeof(mcRef)=='movieclip');
+ check(mc == _level0.mc);
+ check(mcRef == _level0.mc);
+
+ //change the "_name" property
+ mc._name = 'changed';
+ .end
+
+.frame 3
+ .action:
+ check(typeof(mc)=='undefined');
+ check(typeof(mcRef)=='movieclip');
+ check(mc == undefined);
+ check(mcRef == _level0.changed);
+
+ // remove the created moiveclip in frame1
+ changed.removeMovieClip();
+ .end
+
+.frame 5
+ .action:
+ check(typeof(mc) == 'undefined');
+ check(typeof(mcRef) == 'movieclip');
+ check(mc == undefined);
+ check(mcRef.valueOf() == null);
+
+ //re-create a movieclip again, mcRef connects to the newly created movieclip
+ this.createEmptyMovieClip("mc", 20);
+ check(typeof(mc)=='movieclip');
+ check(typeof(mcRef)=='movieclip');
+ check(mc == _level0.mc);
+ // Gnash bug:
+ // Target of the sprite mcRef points to changed, so seeking
+ // for the new target fails (_level0.changed doesn't exist)
+ check(mcRef == _level0.mc);
+ .end
+
+.frame 7
+ .action:
+ // change the instance name again
+ mc._name = "changed_again";
+
+ check(typeof(changed_again)=='movieclip');
+ check(mcRef != _level0.changed_again);
+
+ check(mc == undefined);
+ check(typeof(mcRef)=='movieclip');
+ check(mcRef.valueOf() == null);
+
+ // change the instance name back
+ mc._name = "mc";
+ check(typeof(mc)=='undefined');
+ check(mc == undefined);
+
+ check(typeof(mcRef)=='movieclip');
+ check(mcRef.valueOf() == null);
+
+ // Release resources after testing
+ delete mc;
+ delete mcRef;
+ changed_again.removeMovieClip();
+ .end
+
+
+// seperate tests in frame9
+.frame 9
+ .action:
+ _root.createEmptyMovieClip("mc1", 30);
+ mc1._name = "mc2";
+ mcRef = mc2;
+
+ check(typeof(mcRef)=='movieclip');
+ check_equals(mcRef.getDepth(), 30);
+ check(mcRef == _level0.mc2);
+
+ mc2.removeMovieClip();
+ _root.createEmptyMovieClip("mc2", 40);
+
+ check(typeof(mcRef)=='movieclip');
+ // Gnash bug:
+ // Target of the sprite pointed to by mcRef is
+ // not the one used on creation (_level0.mc1) but the one
+ // subsequently changed to by effect of _name assignment: _level0.mc2.
+ // Thus, when finding a *new* character (the old one was unloaded)
+ // we find the *new* _level0.mc2.
+ // Should be fixed in the same way as for the bug exposed in frame 5
+ check(mcRef.valueOf() == null)
+
+ // release resources after testing
+ delete mcRef;
+ mc2.removeMovieClip();
+ .end
+
+// seperate tests in frame11
+.frame 11
+ .action:
+ mcContainer = new Array(10);
+ i = 0;
+ MovieClip.prototype.onConstruct = function ()
+ {
+ mcContainer[i++] = this;
+ note("Constructed "+this+" in depth "+this.getDepth()+" and assigned to mcContainer["+(i-1)+"]");
+ };
+ _root.createEmptyMovieClip("mc1", 50);
+ _root.createEmptyMovieClip("mc1", 51);
+ check_equals(mcContainer[0].getDepth(), 50);
+ check_equals(mcContainer[1].getDepth(), 51);
+ check_equals(mc1.getDepth(), 50);
+
+ mc1._name = "mc2"; // char at depth 50 changes name
+ mcRef = mc2; // mcRef now points to char at depth 50, and target _level0.mc2
+
+ check(typeof(mcRef)=='movieclip');
+ check_equals(mcRef.getDepth(), 50);
+ check(mcRef == _level0.mc2);
+
+ mc2.removeMovieClip();
+ _root.createEmptyMovieClip("mc2", 60);
+
+ check(typeof(mcRef)=='movieclip');
+
+ // Gnash bug:
+ // Still the same bug: the ref uses *current* target instead of the one
+ // as of creation time.
+ check(mcRef == _level0.mc1);
+
+ _root.totals(38);
+ stop();
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf b/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf
new file mode 100644
index 0000000..3c24f1b
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf.trace b/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf.trace
new file mode 100644
index 0000000..cb94bb4
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/soft_reference_test1.swf.trace
@@ -0,0 +1,45 @@
+PASSED: [soft_reference_test1.sc:39]
+PASSED: [soft_reference_test1.sc:40]
+PASSED: [soft_reference_test1.sc:41]
+PASSED: [soft_reference_test1.sc:42]
+PASSED: [soft_reference_test1.sc:50]
+PASSED: [soft_reference_test1.sc:51]
+PASSED: [soft_reference_test1.sc:52]
+PASSED: [soft_reference_test1.sc:53]
+PASSED: [soft_reference_test1.sc:61]
+PASSED: [soft_reference_test1.sc:62]
+PASSED: [soft_reference_test1.sc:63]
+PASSED: [soft_reference_test1.sc:64]
+PASSED: [soft_reference_test1.sc:68]
+PASSED: [soft_reference_test1.sc:69]
+PASSED: [soft_reference_test1.sc:70]
+PASSED: [soft_reference_test1.sc:74]
+PASSED: [soft_reference_test1.sc:82]
+PASSED: [soft_reference_test1.sc:83]
+PASSED: [soft_reference_test1.sc:85]
+PASSED: [soft_reference_test1.sc:86]
+PASSED: [soft_reference_test1.sc:87]
+PASSED: [soft_reference_test1.sc:91]
+PASSED: [soft_reference_test1.sc:92]
+PASSED: [soft_reference_test1.sc:94]
+PASSED: [soft_reference_test1.sc:95]
+PASSED: [soft_reference_test1.sc:111]
+PASSED: mcRef.getDepth() == 30 [soft_reference_test1.sc:112]
+PASSED: [soft_reference_test1.sc:113]
+PASSED: [soft_reference_test1.sc:118]
+PASSED: [soft_reference_test1.sc:126]
+Constructed _level0.mc1 in depth 50 and assigned to mcContainer[0] [soft_reference_test1.sc:141]
+Constructed _level0.mc1 in depth 51 and assigned to mcContainer[1] [soft_reference_test1.sc:141]
+PASSED: mcContainer[0].getDepth() == 50 [soft_reference_test1.sc:145]
+PASSED: mcContainer[1].getDepth() == 51 [soft_reference_test1.sc:146]
+PASSED: mc1.getDepth() == 50 [soft_reference_test1.sc:147]
+PASSED: [soft_reference_test1.sc:152]
+PASSED: mcRef.getDepth() == 50 [soft_reference_test1.sc:153]
+PASSED: [soft_reference_test1.sc:154]
+Constructed _level0.mc2 in depth 60 and assigned to mcContainer[2] [soft_reference_test1.sc:141]
+PASSED: [soft_reference_test1.sc:159]
+PASSED: [soft_reference_test1.sc:164]
+Total tests run: 38 typeof expected: number
+#passed: 38
+#failed: 0
+__END_OF_TEST__
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.sc b/test/gnash/misc-swfc.all/pending/swf4opcode.sc
new file mode 100644
index 0000000..316c030
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/swf4opcode.sc
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * test opcodes defined in swf4.
+ *
+ * Deduction:
+ *
+ * There is no NaN number in swf4 at all, invalid numbers are converted to 0.
+ *
+ */
+
+//
+// Dejagnu clip does not work/compile in swf4.
+//
+
+//-------------------------------------------------------------------------------------------
+// Dejagnu-like interface for SWF4
+// TODO: expose in check.as based on OUTPUT_VERSION ?
+//-------------------------------------------------------------------------------------------
+
+#define _INFO_ concat(' [', concat(__FILE__, concat(':', concat(__LINE__,']'))))
+
+#define pass_check(lbl) { trace(concat("PASSED: ", concat(lbl, _INFO_))); }
+#define xpass_check(lbl) { trace(concat("XPASSED: ", concat(lbl, _INFO_))); }
+#define fail_check(lbl) { trace(concat("FAILED: ", concat(lbl, _INFO_))); }
+#define xfail_check(lbl) { trace(concat("XFAILED: ", concat(lbl, _INFO_))); }
+
+
+//
+// Use check_equals(<obtained>, <expected>)
+//
+#define check_equals(obt, exp) \
+ if ( obt == exp ) pass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else fail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define xcheck_equals(obt, exp) \
+ if ( obt == exp ) xpass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else xfail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define check(expr) \
+ if ( expr ) pass_check(#expr) \
+ else fail_check(#expr)
+
+#define xcheck(expr) \
+ if ( expr ) xpass_check(#expr) \
+ else xfail_check(#expr)
+
+//-------------------------------------------------------------------------------------------
+
+.flash bbox=800x600 filename="swf4opcode.swf" background=white version=4 fps=12
+
+.frame 1
+ .action:
+ //
+ // test opcode ActionEquals
+ //
+ testvar = (uninitialized1 == '');
+ check_equals(testvar, 1);
+ testvar = ('' == uninitialized2);
+ check_equals(testvar, 1);
+ testvar = ('' == '');
+ check_equals(testvar, 1);
+ testvar = ('xyz' == 'abc');
+ //Ref: http://swishtutor.com
+ // both hands are converted to zero
+ check_equals(testvar, 1);
+ check_equals('xyz', 0);
+ check_equals('abc', 0);
+ check_equals('xyz', 'xyz');
+ check_equals('xyz', 'abc');
+
+ // test 'undefined' in swf4
+ check_equals(uninitialized2, uninitialized3);
+ check_equals(uninitialized2, 0);
+ check_equals(undefined, 0);
+ check_equals(0, undefined);
+ check_equals(undefined, undefined);
+
+ // test 'Infinity' in swf4
+ // there's no 'Infinity' constant in swf4
+ check_equals(Infinity, undefined);
+ check_equals(Infinity, Infinity);
+ check_equals(Infinity, -Infinity);
+
+ // test 'null' in swf4
+ // there's no null in swf4
+ check_equals(null, undefined);
+ check_equals(null, 0);
+
+ // test 'NaN' in swf4
+ // there's no 'NaN' constant in swf4
+ check_equals(NaN, 0);
+ .end
+
+
+.frame 2
+ .action:
+
+ //
+ // test convertion to number (and thus bool)
+ //
+ x = '2/';
+ y = '3/';
+ // x and y are converted to number 0 before comparision
+ check_equals( (x+y), 5 );
+ check( y > x );
+ neg = !x;
+ check(!neg);
+ neg = !y;
+ check(!neg);
+ y = '/';
+ check_equals( y, 0 );
+ y = ' 4';
+ check_equals( y, 4 );
+ // This needs to work in all locales
+ y = '4.5';
+ check_equals( y, 4.5 );
+ y = '4,5';
+ check_equals( y, 4 );
+ // exponent
+ y = '4.5e4';
+ check_equals( y, 45000 );
+ y = '4.5E4';
+ check_equals( y, 45000 );
+ y = '+4.5e4';
+ check_equals( y, 45000 );
+ y = '-4.5e4';
+ check_equals( y, -45000 );
+ y = '4.5e+4';
+ check_equals( y, 45000 );
+ y = '4.5e-4';
+ check_equals( y, 0.00045 );
+ y = '-4.5e-4';
+ check_equals( y, -0.00045 );
+ x = '2e1';
+ check_equals(x+1, 21);
+ //
+ // test ActionLogicalNot (0x12)
+ //
+ check(!"");
+ check(!"a");
+ check(!"true");
+ check(!"false");
+ check("1");
+ check(!"0000.000");
+ check(!false); // doh !
+ check(true); // doh !
+ check(!0);
+ check(4);
+ xcheck(!_root); // undefined ?
+ check(!null);
+ check(!undefined);
+
+ //
+ // test ActionLessThan
+ //
+ x = 'ab';
+ y = 'abc';
+ // should return 0(false)
+ // x and y are converted to number 0 before comparision
+ check( ! (x < y) );
+ check( ! (x > y) );
+ check( x == y );
+ check( x == 0);
+
+ //
+ // test swf4 ActionMultiply, ActionDivide, ActionAdd, ActionSubstract
+ //
+ x = "abc";
+ y = 0;
+ z = x * y;
+ check_equals(z, 0);
+ z = x / 1;
+ check_equals(z, 0);
+ z = x + 1;
+ check_equals(z, 1);
+ z = x - 1;
+ check_equals(z, -1);
+
+ //
+ // TODO: add tests for ActionStringEq, ActionStringGreater,
+ // ActionStringCompare
+ //
+ // Question: how to generate the above opcodes?
+ .end
+
+
+.frame 3
+ .action:
+ stop();
+ getURL("fscommand:quit", "");
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.sc.original b/test/gnash/misc-swfc.all/pending/swf4opcode.sc.original
new file mode 100644
index 0000000..23f1a0e
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/swf4opcode.sc.original
@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2007 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*
+ * Zou Lunkai, zoulunkai at gmail.com
+ *
+ * test opcodes defined in swf4.
+ *
+ * Deduction:
+ *
+ * There is no NaN number in swf4 at all, invalid numbers are converted to 0.
+ *
+ */
+
+//
+// Dejagnu clip does not work/compile in swf4.
+//
+
+//-------------------------------------------------------------------------------------------
+// Dejagnu-like interface for SWF4
+// TODO: expose in check.as based on OUTPUT_VERSION ?
+//-------------------------------------------------------------------------------------------
+
+#define _INFO_ concat(' [', concat(__FILE__, concat(':', concat(__LINE__,']'))))
+
+#define pass_check(lbl) { trace(concat("PASSED: ", concat(lbl, _INFO_))); }
+#define xpass_check(lbl) { trace(concat("XPASSED: ", concat(lbl, _INFO_))); }
+#define fail_check(lbl) { trace(concat("FAILED: ", concat(lbl, _INFO_))); }
+#define xfail_check(lbl) { trace(concat("XFAILED: ", concat(lbl, _INFO_))); }
+
+
+//
+// Use check_equals(<obtained>, <expected>)
+//
+#define check_equals(obt, exp) \
+ if ( obt == exp ) pass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else fail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define xcheck_equals(obt, exp) \
+ if ( obt == exp ) xpass_check( concat(#obt, concat(" == ", #exp)) ) \
+ else xfail_check( concat("expected: ", concat(#exp, concat(" obtained: ", obt))) )
+
+#define check(expr) \
+ if ( expr ) pass_check(#expr) \
+ else fail_check(#expr)
+
+#define xcheck(expr) \
+ if ( expr ) xpass_check(#expr) \
+ else xfail_check(#expr)
+
+//-------------------------------------------------------------------------------------------
+
+.flash bbox=800x600 filename="swf4opcode.swf" background=white version=4 fps=12
+
+.frame 1
+ .action:
+ //
+ // test opcode ActionEquals
+ //
+ testvar = (uninitialized1 == '');
+ check_equals(testvar, 1);
+ testvar = ('' == uninitialized2);
+ check_equals(testvar, 1);
+ testvar = ('' == '');
+ check_equals(testvar, 1);
+ testvar = ('xyz' == 'abc');
+ //Ref: http://swishtutor.com
+ // both hands are converted to zero
+ check_equals(testvar, 1);
+ check_equals('xyz', 0);
+ check_equals('abc', 0);
+ check_equals('xyz', 'xyz');
+ check_equals('xyz', 'abc');
+
+ // test 'undefined' in swf4
+ check_equals(uninitialized2, uninitialized3);
+ check_equals(uninitialized2, 0);
+ check_equals(undefined, 0);
+ check_equals(0, undefined);
+ check_equals(undefined, undefined);
+
+ // test 'Infinity' in swf4
+ // there's no 'Infinity' constant in swf4
+ check_equals(Infinity, undefined);
+ check_equals(Infinity, Infinity);
+ check_equals(Infinity, -Infinity);
+
+ // test 'null' in swf4
+ // there's no null in swf4
+ check_equals(null, undefined);
+ check_equals(null, 0);
+
+ // test 'NaN' in swf4
+ // there's no 'NaN' constant in swf4
+ check_equals(NaN, 0);
+ .end
+
+
+.frame 2
+ .action:
+
+ //
+ // test convertion to number (and thus bool)
+ //
+ x = '2/';
+ y = '3/';
+ // x and y are converted to number 0 before comparision
+ check_equals( (x+y), 5 );
+ check( y > x );
+ neg = !x;
+ check(!neg);
+ neg = !y;
+ check(!neg);
+ y = '/';
+ check_equals( y, 0 );
+ y = ' 4';
+ check_equals( y, 4 );
+ // This needs to work in all locales
+ y = '4.5';
+ check_equals( y, 4.5 );
+ y = '4,5';
+ check_equals( y, 4 );
+ // exponent
+ y = '4.5e4';
+ check_equals( y, 45000 );
+ y = '4.5E4';
+ check_equals( y, 45000 );
+ y = '+4.5e4';
+ check_equals( y, 45000 );
+ y = '-4.5e4';
+ check_equals( y, -45000 );
+ y = '4.5e+4';
+ check_equals( y, 45000 );
+ y = '4.5e-4';
+ check_equals( y, 0.00045 );
+ y = '-4.5e-4';
+ check_equals( y, -0.00045 );
+ x = '2e1';
+ check_equals(x+1, 21);
+ //
+ // test ActionLogicalNot (0x12)
+ //
+ check(!"");
+ check(!"a");
+ check(!"true");
+ check(!"false");
+ check("1");
+ check(!"0000.000");
+ check(!false); // doh !
+ check(true); // doh !
+ check(!0);
+ check(4);
+ xcheck(!_root); // undefined ?
+ check(!null);
+ check(!undefined);
+
+ //
+ // test ActionLessThan
+ //
+ x = 'ab';
+ y = 'abc';
+ // should return 0(false)
+ // x and y are converted to number 0 before comparision
+ check( ! (x < y) );
+ check( ! (x > y) );
+ check( x == y );
+ check( x == 0);
+
+ //
+ // test swf4 ActionMultiply, ActionDivide, ActionAdd, ActionSubstract
+ //
+ x = "abc";
+ y = 0;
+ z = x * y;
+ check_equals(z, 0);
+ z = x / 1;
+ check_equals(z, 0);
+ z = x + 1;
+ check_equals(z, 1);
+ z = x - 1;
+ check_equals(z, -1);
+
+ //
+ // TODO: add tests for ActionStringEq, ActionStringGreater,
+ // ActionStringCompare
+ //
+ // Question: how to generate the above opcodes?
+ .end
+
+
+.frame 3
+ .action:
+ stop();
+ .end
+
+.end
+
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.swf b/test/gnash/misc-swfc.all/pending/swf4opcode.swf
new file mode 100644
index 0000000..031751c
Binary files /dev/null and b/test/gnash/misc-swfc.all/pending/swf4opcode.swf differ
diff --git a/test/gnash/misc-swfc.all/pending/swf4opcode.swf.trace b/test/gnash/misc-swfc.all/pending/swf4opcode.swf.trace
new file mode 100644
index 0000000..a817028
--- /dev/null
+++ b/test/gnash/misc-swfc.all/pending/swf4opcode.swf.trace
@@ -0,0 +1,56 @@
+PASSED: testvar == 1 [swf4opcode.sc:76]
+PASSED: testvar == 1 [swf4opcode.sc:78]
+PASSED: testvar == 1 [swf4opcode.sc:80]
+PASSED: testvar == 1 [swf4opcode.sc:84]
+PASSED: 'xyz' == 0 [swf4opcode.sc:85]
+PASSED: 'abc' == 0 [swf4opcode.sc:86]
+PASSED: 'xyz' == 'xyz' [swf4opcode.sc:87]
+PASSED: 'xyz' == 'abc' [swf4opcode.sc:88]
+PASSED: uninitialized2 == uninitialized3 [swf4opcode.sc:91]
+PASSED: uninitialized2 == 0 [swf4opcode.sc:92]
+PASSED: undefined == 0 [swf4opcode.sc:93]
+PASSED: 0 == undefined [swf4opcode.sc:94]
+PASSED: undefined == undefined [swf4opcode.sc:95]
+PASSED: Infinity == undefined [swf4opcode.sc:99]
+PASSED: Infinity == Infinity [swf4opcode.sc:100]
+PASSED: Infinity == -Infinity [swf4opcode.sc:101]
+PASSED: null == undefined [swf4opcode.sc:105]
+PASSED: null == 0 [swf4opcode.sc:106]
+PASSED: NaN == 0 [swf4opcode.sc:110]
+PASSED: (x+y) == 5 [swf4opcode.sc:123]
+PASSED: y > x [swf4opcode.sc:124]
+PASSED: !neg [swf4opcode.sc:126]
+PASSED: !neg [swf4opcode.sc:128]
+PASSED: y == 0 [swf4opcode.sc:130]
+PASSED: y == 4 [swf4opcode.sc:132]
+PASSED: y == 4.5 [swf4opcode.sc:135]
+PASSED: y == 4 [swf4opcode.sc:137]
+PASSED: y == 45000 [swf4opcode.sc:140]
+PASSED: y == 45000 [swf4opcode.sc:142]
+PASSED: y == 45000 [swf4opcode.sc:144]
+PASSED: y == -45000 [swf4opcode.sc:146]
+PASSED: y == 45000 [swf4opcode.sc:148]
+PASSED: y == 0.00045 [swf4opcode.sc:150]
+PASSED: y == -0.00045 [swf4opcode.sc:152]
+PASSED: x+1 == 21 [swf4opcode.sc:154]
+PASSED: !"" [swf4opcode.sc:158]
+PASSED: !"a" [swf4opcode.sc:159]
+PASSED: !"true" [swf4opcode.sc:160]
+PASSED: !"false" [swf4opcode.sc:161]
+PASSED: "1" [swf4opcode.sc:162]
+PASSED: !"0000.000" [swf4opcode.sc:163]
+PASSED: !false [swf4opcode.sc:164]
+PASSED: true [swf4opcode.sc:165]
+PASSED: !0 [swf4opcode.sc:166]
+PASSED: 4 [swf4opcode.sc:167]
+XPASSED: !_root [swf4opcode.sc:168]
+PASSED: !null [swf4opcode.sc:169]
+PASSED: !undefined [swf4opcode.sc:170]
+PASSED: ! (x < y) [swf4opcode.sc:179]
+PASSED: ! (x > y) [swf4opcode.sc:180]
+PASSED: x == y [swf4opcode.sc:181]
+PASSED: x == 0 [swf4opcode.sc:182]
+PASSED: z == 0 [swf4opcode.sc:190]
+PASSED: z == 0 [swf4opcode.sc:192]
+PASSED: z == 1 [swf4opcode.sc:194]
+PASSED: z == -1 [swf4opcode.sc:196]
commit 33e3340d69c4820dccf74f436d0f7dc12cf7223c
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 16:39:02 2008 +0300
Set correct propflags for arguments' properties. Add arguments-properties test
diff --git a/swfdec/swfdec_as_frame.c b/swfdec/swfdec_as_frame.c
index 52e311c..439c0c6 100644
--- a/swfdec/swfdec_as_frame.c
+++ b/swfdec/swfdec_as_frame.c
@@ -702,14 +702,16 @@ swfdec_as_frame_preload (SwfdecAsFrame *frame)
} else {
SWFDEC_AS_VALUE_SET_NULL (&val);
}
- swfdec_as_object_set_variable (args, SWFDEC_AS_STR_caller, &val);
+ swfdec_as_object_set_variable_and_flags (args, SWFDEC_AS_STR_caller, &val,
+ SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
if (frame->function != NULL) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (frame->function));
} else {
SWFDEC_AS_VALUE_SET_NULL (&val);
}
- swfdec_as_object_set_variable (args, SWFDEC_AS_STR_callee, &val);
+ swfdec_as_object_set_variable_and_flags (args, SWFDEC_AS_STR_callee, &val,
+ SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
} else {
/* silence gcc */
args = NULL;
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index c999270..cdccc32 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -99,6 +99,15 @@ EXTRA_DIST = \
arguments-7.swf.trace \
arguments-8.swf \
arguments-8.swf.trace \
+ arguments-properties.as \
+ arguments-properties-5.swf \
+ arguments-properties-5.swf.trace \
+ arguments-properties-6.swf \
+ arguments-properties-6.swf.trace \
+ arguments-properties-7.swf \
+ arguments-properties-7.swf.trace \
+ arguments-properties-8.swf \
+ arguments-properties-8.swf.trace \
array.swf \
array.swf.trace \
array-init.xml \
diff --git a/test/trace/arguments-properties-5.swf b/test/trace/arguments-properties-5.swf
new file mode 100644
index 0000000..060f2c5
Binary files /dev/null and b/test/trace/arguments-properties-5.swf differ
diff --git a/test/trace/arguments-properties-5.swf.trace b/test/trace/arguments-properties-5.swf.trace
new file mode 100644
index 0000000..656e0a1
--- /dev/null
+++ b/test/trace/arguments-properties-5.swf.trace
@@ -0,0 +1,13 @@
+local.arguments = object
+ 0 = undefined
+ 1 = undefined
+ __proto__ (hp) = _global.Array.prototype
+ callee (hp) = function
+ __proto__ (hpn) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = local.arguments.callee
+ caller (hp) = null
+ constructor (hp) = _global.Array
+ length (hp) = number : 2
diff --git a/test/trace/arguments-properties-6.swf b/test/trace/arguments-properties-6.swf
new file mode 100644
index 0000000..291039a
Binary files /dev/null and b/test/trace/arguments-properties-6.swf differ
diff --git a/test/trace/arguments-properties-6.swf.trace b/test/trace/arguments-properties-6.swf.trace
new file mode 100644
index 0000000..a729015
--- /dev/null
+++ b/test/trace/arguments-properties-6.swf.trace
@@ -0,0 +1,13 @@
+local.arguments = object
+ 0 = undefined
+ 1 = undefined
+ __proto__ (hp) = _global.Array.prototype
+ callee (hp) = function
+ __proto__ (hp) = _global.Function.prototype
+ constructor (hp) = _global.Function
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = local.arguments.callee
+ caller (hp) = null
+ constructor (hp) = _global.Array
+ length (hp) = number : 2
diff --git a/test/trace/arguments-properties-7.swf b/test/trace/arguments-properties-7.swf
new file mode 100644
index 0000000..1a92f07
Binary files /dev/null and b/test/trace/arguments-properties-7.swf differ
diff --git a/test/trace/arguments-properties-7.swf.trace b/test/trace/arguments-properties-7.swf.trace
new file mode 100644
index 0000000..a729015
--- /dev/null
+++ b/test/trace/arguments-properties-7.swf.trace
@@ -0,0 +1,13 @@
+local.arguments = object
+ 0 = undefined
+ 1 = undefined
+ __proto__ (hp) = _global.Array.prototype
+ callee (hp) = function
+ __proto__ (hp) = _global.Function.prototype
+ constructor (hp) = _global.Function
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = local.arguments.callee
+ caller (hp) = null
+ constructor (hp) = _global.Array
+ length (hp) = number : 2
diff --git a/test/trace/arguments-properties-8.swf b/test/trace/arguments-properties-8.swf
new file mode 100644
index 0000000..9bb02ea
Binary files /dev/null and b/test/trace/arguments-properties-8.swf differ
diff --git a/test/trace/arguments-properties-8.swf.trace b/test/trace/arguments-properties-8.swf.trace
new file mode 100644
index 0000000..a729015
--- /dev/null
+++ b/test/trace/arguments-properties-8.swf.trace
@@ -0,0 +1,13 @@
+local.arguments = object
+ 0 = undefined
+ 1 = undefined
+ __proto__ (hp) = _global.Array.prototype
+ callee (hp) = function
+ __proto__ (hp) = _global.Function.prototype
+ constructor (hp) = _global.Function
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = local.arguments.callee
+ caller (hp) = null
+ constructor (hp) = _global.Array
+ length (hp) = number : 2
diff --git a/test/trace/arguments-properties.as b/test/trace/arguments-properties.as
new file mode 100644
index 0000000..19583c0
--- /dev/null
+++ b/test/trace/arguments-properties.as
@@ -0,0 +1,11 @@
+// makeswf -v 7 -r 1 -o array-properties-7.swf array-properties.as
+
+#include "trace_properties.as"
+
+function test () {
+ trace_properties (arguments, "local", "arguments");
+}
+
+test ("a", 2);
+
+getURL ("FSCommand:quit", "");
commit 3d3452d23d48d65caa76da7412ac1500b6c81da3
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 16:11:06 2008 +0300
Move Gnash's String test from pending to normal, it passes now
diff --git a/test/gnash/actionscript.all/Makefile.am b/test/gnash/actionscript.all/Makefile.am
index ee3e74e..4484f9d 100644
--- a/test/gnash/actionscript.all/Makefile.am
+++ b/test/gnash/actionscript.all/Makefile.am
@@ -128,6 +128,15 @@ EXTRA_DIST = \
Selection-8.swf \
Selection-8.swf.trace \
Selection.as \
+ String-5.swf \
+ String-5.swf.trace \
+ String-6.swf \
+ String-6.swf.trace \
+ String-7.swf \
+ String-7.swf.trace \
+ String-8.swf \
+ String-8.swf.trace \
+ String.as \
swap-5.swf \
swap-5.swf.trace \
swap-6.swf \
diff --git a/test/gnash/actionscript.all/String-5.swf b/test/gnash/actionscript.all/String-5.swf
new file mode 100644
index 0000000..2d3c57b
Binary files /dev/null and b/test/gnash/actionscript.all/String-5.swf differ
diff --git a/test/gnash/actionscript.all/String-5.swf.trace b/test/gnash/actionscript.all/String-5.swf.trace
new file mode 100644
index 0000000..c3d4e6d
--- /dev/null
+++ b/test/gnash/actionscript.all/String-5.swf.trace
@@ -0,0 +1,259 @@
+PASSED: typeof(String) == 'function' [String.as:23]
+PASSED: typeof(String.prototype) == 'object' [String.as:24]
+PASSED: String.__proto__ == Function.prototype [String.as:25]
+PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
+PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
+PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
+PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
+PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
+PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
+PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
+PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
+PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
+PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
+PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
+PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
+PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
+PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
+PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
+PASSED: typeof(String.valueOf) == 'undefined' [String.as:45]
+PASSED: typeof(String.toString) == 'undefined' [String.as:46]
+PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
+PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
+PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
+PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
+PASSED: typeof(String.concat) == 'undefined' [String.as:52]
+PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
+PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
+PASSED: typeof(String.slice) == 'undefined' [String.as:55]
+PASSED: typeof(String.substring) == 'undefined' [String.as:56]
+PASSED: typeof(String.split) == 'undefined' [String.as:57]
+PASSED: typeof(String.substr) == 'undefined' [String.as:58]
+PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
+PASSED: typeof(String()) == 'string' [String.as:86]
+PASSED: a.length == 20 [String.as:90]
+PASSED: typeof(a) == 'object' [String.as:94]
+PASSED: a instanceof String [String.as:95]
+PASSED: a instanceof Object [String.as:96]
+PASSED: a.charCodeAt(0) == 119 [String.as:97]
+PASSED: a.charCodeAt(1) == 97 [String.as:98]
+PASSED: a.charCodeAt(2) == 108 [String.as:99]
+PASSED: a.charCodeAt(3) == 108 [String.as:100]
+PASSED: a.charCodeAt(4) == 97 [String.as:101]
+PASSED: a.charAt(0) == "w" [String.as:102]
+PASSED: a.charAt(1) == "a" [String.as:103]
+PASSED: a.charAt(2) == "l" [String.as:104]
+PASSED: a.charAt(3) == "l" [String.as:105]
+PASSED: a.charAt(4) == "a" [String.as:106]
+PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
+PASSED: a.indexOf("lawa") == 3 [String.as:118]
+PASSED: a.indexOf("lawas") == 8 [String.as:119]
+PASSED: a.indexOf("hinG") == 13 [String.as:120]
+PASSED: a.indexOf("hing") == -1 [String.as:121]
+PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
+PASSED: a.indexOf("a", 2) == 4 [String.as:123]
+PASSED: a.indexOf("a", -1) == 1 [String.as:124]
+PASSED: a.indexOf("a", -2) == 1 [String.as:125]
+PASSED: a.indexOf("l") == 2 [String.as:126]
+PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
+PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
+PASSED: a.indexOf("l", 3) == 3 [String.as:129]
+PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
+PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
+PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
+PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
+PASSED: a.indexOf("l", -4) == 2 [String.as:134]
+PASSED: a.indexOf("a", o) == 4 [String.as:136]
+PASSED: a.indexOf(o2, o) == 4 [String.as:138]
+PASSED: typeof(a.split) == 'function' [String.as:145]
+PASSED: ! a.hasOwnProperty('split') [String.as:146]
+PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
+PASSED: a.split().length == 1 [String.as:153]
+PASSED: a.split() instanceof Array [String.as:154]
+PASSED: a.split("w").length == 4 [String.as:155]
+PASSED: a.split(" w").length == 1 [String.as:156]
+PASSED: a.split("")[0] == "wallawallawashinGTON" [String.as:176]
+PASSED: a.split("")[19] == undefined [String.as:177]
+PASSED: a.split("la")[0] == "wallawallawashinGTON" [String.as:179]
+PASSED: a.split("la")[1] == undefined [String.as:180]
+PASSED: a.split("la")[2] == undefined [String.as:181]
+PASSED: a.split("la").length == 1 [String.as:182]
+PASSED: typeof(ret) == 'object' [String.as:189]
+PASSED: ret.length == 1 [String.as:190]
+PASSED: typeof(ret[0]) == 'string' [String.as:191]
+PASSED: ret[0] == '' [String.as:192]
+PASSED: ret.length == 0 [String.as:196]
+PASSED: ret.length == 0 [String.as:202]
+PASSED: ret.length == 1 [String.as:207]
+PASSED: ret.length == 1 [String.as:209]
+PASSED: typeof(ret) == 'object' [String.as:213]
+PASSED: ret.length == 1 [String.as:214]
+PASSED: typeof(ret[0]) == 'string' [String.as:215]
+PASSED: ret[0] == 'abcde' [String.as:216]
+PASSED: g.length == 1 [String.as:225]
+PASSED: typeof(g[0]) == "string" [String.as:226]
+PASSED: g[0] == "" [String.as:227]
+PASSED: g.length == 0 [String.as:237]
+PASSED: typeof(g[0]) == "undefined" [String.as:238]
+PASSED: g[0] == undefined [String.as:239]
+PASSED: g.length == 1 [String.as:244]
+PASSED: typeof(g[0]) == "string" [String.as:245]
+PASSED: g[0] == "" [String.as:246]
+PASSED: g.length == 1 [String.as:255]
+PASSED: typeof(g[0]) == "string" [String.as:256]
+PASSED: g[0] == "f" [String.as:257]
+PASSED: g.length == 0 [String.as:263]
+PASSED: typeof(g[0]) == "undefined" [String.as:264]
+PASSED: g[0] == undefined [String.as:265]
+PASSED: g.length == 1 [String.as:269]
+PASSED: typeof(g[0]) == "string" [String.as:270]
+PASSED: g[0] == "f" [String.as:271]
+PASSED: b == "abcd" [String.as:282]
+PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
+PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
+PASSED: a.substr(5,2) == "fg" [String.as:298]
+PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
+PASSED: a.substr(-1,1) == "z" [String.as:300]
+PASSED: a.substr(-2,3) == "yz" [String.as:301]
+PASSED: a.substr(-3,2) == "xy" [String.as:302]
+PASSED: b.substr(3, 6) == "4" [String.as:304]
+PASSED: a.slice(-5,-3) == "vw" [String.as:312]
+PASSED: typeof(a.slice()) == "undefined" [String.as:313]
+PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
+PASSED: a.slice(-5,3) == "" [String.as:315]
+PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
+PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
+PASSED: a.slice(0,0) == "" [String.as:318]
+PASSED: a.slice(0,1) == "a" [String.as:319]
+PASSED: a.slice(1,1) == "" [String.as:320]
+PASSED: a.slice(1,2) == "b" [String.as:321]
+PASSED: a.slice.call(a, -5, -3) == undefined [String.as:328]
+PASSED: String.prototype.slice.call(a, -5, -3) == undefined [String.as:329]
+PASSED: a.slice(-4) == "wxyz" [String.as:331]
+PASSED: a.substring(5,2) == "cde" [String.as:339]
+PASSED: a.substring(5,7) == "fg" [String.as:340]
+PASSED: a.substring(3,3) == "" [String.as:341]
+PASSED: a.length == 26 [String.as:343]
+PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
+PASSED: b.substring(3, 6) == "4" [String.as:347]
+PASSED: chr(0) == "" [String.as:354]
+PASSED: chr(65) == "A" [String.as:355]
+PASSED: ord("A") == 65 [String.as:356]
+PASSED: ord("") == 0 [String.as:357]
+PASSED: typeof(chr(486)) == 'string' [String.as:367]
+PASSED: chr(865) == "a" [String.as:368]
+PASSED: ord("ö") == 195 [String.as:369]
+PASSED: ord("ÃÂ") == 195 [String.as:370]
+PASSED: ord("õ") == 199 [String.as:371]
+PASSED: ord("æ") == 207 [String.as:372]
+XPASSED: c == 199 [String.as:395]
+XPASSED: c == 207 [String.as:411]
+PASSED: typeof(c) == "string" [String.as:429]
+PASSED: typeof(c) == "string" [String.as:448]
+PASSED: a.length == 16 [String.as:469]
+PASSED: a.slice(3,5) == "ng" [String.as:470]
+PASSED: a.charCodeAt(10) == 195 [String.as:471]
+PASSED: b == "iao" [String.as:494]
+PASSED: b == "oowa" [String.as:504]
+PASSED: b == "c" [String.as:513]
+PASSED: b == "ciao" [String.as:522]
+PASSED: b == "c" [String.as:531]
+PASSED: b == "" [String.as:540]
+PASSED: b == "l" [String.as:549]
+PASSED: b == "f" [String.as:559]
+PASSED: b == "" [String.as:569]
+PASSED: count1 == 225 [String.as:605]
+PASSED: count2 == 225 [String.as:606]
+PASSED: b == "iao" [String.as:626]
+PASSED: b == "oowa" [String.as:636]
+PASSED: b == "c" [String.as:645]
+PASSED: b == "ciao" [String.as:654]
+PASSED: b == "c" [String.as:663]
+PASSED: b == "" [String.as:672]
+PASSED: b == "l" [String.as:681]
+PASSED: b == "f" [String.as:691]
+PASSED: stringInstance.__proto__ != undefined [String.as:700]
+PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
+PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
+PASSED: String.prototype.constructor == String [String.as:703]
+PASSED: stringInstance.__proto__.constructor == String [String.as:704]
+PASSED: stringInstance instanceof String [String.as:707]
+PASSED: ! "literal string" instanceof String [String.as:708]
+PASSED: typeof(a_string) == "string" [String.as:714]
+PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
+PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
+PASSED: a_string.substring(0, -1) == "" [String.as:717]
+PASSED: a_string.substring(0, 1) == "a" [String.as:718]
+PASSED: a_string.substring(4) == "ring" [String.as:719]
+PASSED: a_string.substring(16) == "" [String.as:720]
+PASSED: a_string.substring(-16) == "a_string" [String.as:721]
+PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
+PASSED: a_string.indexOf("hing") == -1 [String.as:723]
+PASSED: a_string.indexOf("string") == 2 [String.as:724]
+PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
+PASSED: a_string.substring(0, 1) == "" [String.as:727]
+PASSED: a_string.length == 10 [String.as:731]
+PASSED: a_string.length == 10 [String.as:733]
+PASSED: a_string == "1234567890" [String.as:734]
+PASSED: a+b == "onetwo" [String.as:742]
+PASSED: b+c == "two[object Object]" [String.as:745]
+PASSED: b+c == "twoone" [String.as:750]
+PASSED: b+c == "two[type Object]" [String.as:757]
+PASSED: typeof(c.toString) == 'function' [String.as:761]
+PASSED: b+c == "two[type Object]" [String.as:762]
+PASSED: typeof(c.toString) == 'undefined' [String.as:766]
+PASSED: b+c == "two[type Object]" [String.as:767]
+PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
+PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
+PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
+PASSED: stringObject == "1234" [String.as:779]
+PASSED: stringObject == 1234 [String.as:780]
+PASSED: 1234 == stringObject [String.as:781]
+PASSED: stringObject == numberObject [String.as:786]
+PASSED: numberObject.toString() == stringObject [String.as:788]
+PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
+PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
+PASSED: typeof(s.toString) == 'function' [String.as:797]
+PASSED: ! delete String.prototype.toString [String.as:798]
+PASSED: delete String.prototype.toString [String.as:801]
+PASSED: typeof(s.toString) == 'function' [String.as:802]
+PASSED: !delete Object.prototype.toString [String.as:803]
+PASSED: delete Object.prototype.toString [String.as:806]
+PASSED: typeof(s.toString) == 'undefined' [String.as:807]
+PASSED: r == "s:hello" [String.as:817]
+PASSED: r == "s:" [String.as:821]
+PASSED: a.length == 3 [String.as:828]
+PASSED: a.length == 3 [String.as:830]
+PASSED: a.length == 3 [String.as:832]
+PASSED: a.length == 2 [String.as:834]
+PASSED: a == "123" [String.as:835]
+PASSED: a.length == "another string" [String.as:837]
+PASSED: a.length == "another string" [String.as:839]
+PASSED: a.length == 0 [String.as:852]
+PASSED: a.toString() == "toString" [String.as:858]
+PASSED: typeof(String.__proto__) == 'object' [String.as:860]
+PASSED: typeof(Object.prototype) == 'object' [String.as:861]
+PASSED: String.gotcha == 1 [String.as:863]
+PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
+PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
+PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
+PASSED: a.toString() == "gotcha,toString" [String.as:870]
+PASSED: !String.hasOwnProperty('toString') [String.as:879]
+PASSED: !String.hasOwnProperty('valueOf') [String.as:880]
+PASSED: String.hasOwnProperty('__proto__') [String.as:881]
+PASSED: String.hasOwnProperty('fromCharCode') [String.as:882]
+PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:884]
+PASSED: String.prototype.hasOwnProperty('toString') [String.as:885]
+PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:886]
+PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:887]
+PASSED: String.prototype.hasOwnProperty('charAt') [String.as:888]
+PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:889]
+PASSED: String.prototype.hasOwnProperty('concat') [String.as:890]
+PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:891]
+PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:892]
+PASSED: String.prototype.hasOwnProperty('slice') [String.as:893]
+PASSED: String.prototype.hasOwnProperty('substring') [String.as:894]
+PASSED: String.prototype.hasOwnProperty('split') [String.as:895]
+PASSED: String.prototype.hasOwnProperty('substr') [String.as:896]
+PASSED: !String.prototype.hasOwnProperty('length') [String.as:897]
+check_totals: 258
diff --git a/test/gnash/actionscript.all/String-6.swf b/test/gnash/actionscript.all/String-6.swf
new file mode 100644
index 0000000..487b92f
Binary files /dev/null and b/test/gnash/actionscript.all/String-6.swf differ
diff --git a/test/gnash/actionscript.all/String-6.swf.trace b/test/gnash/actionscript.all/String-6.swf.trace
new file mode 100644
index 0000000..2e45190
--- /dev/null
+++ b/test/gnash/actionscript.all/String-6.swf.trace
@@ -0,0 +1,275 @@
+PASSED: typeof(String) == 'function' [String.as:23]
+PASSED: typeof(String.prototype) == 'object' [String.as:24]
+PASSED: String.__proto__ == Function.prototype [String.as:25]
+PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
+PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
+PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
+PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
+PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
+PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
+PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
+PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
+PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
+PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
+PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
+PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
+PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
+PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
+PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
+PASSED: typeof(String.valueOf) == 'function' [String.as:42]
+PASSED: typeof(String.toString) == 'function' [String.as:43]
+PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
+PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
+PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
+PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
+PASSED: typeof(String.concat) == 'undefined' [String.as:52]
+PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
+PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
+PASSED: typeof(String.slice) == 'undefined' [String.as:55]
+PASSED: typeof(String.substring) == 'undefined' [String.as:56]
+PASSED: typeof(String.split) == 'undefined' [String.as:57]
+PASSED: typeof(String.substr) == 'undefined' [String.as:58]
+PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
+PASSED: String.hasOwnProperty('fromCharCode') [String.as:65]
+PASSED: !String.hasOwnProperty('toString') [String.as:66]
+PASSED: !String.hasOwnProperty('valueOf') [String.as:67]
+PASSED: String.hasOwnProperty('__proto__') [String.as:68]
+PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:69]
+PASSED: String.prototype.hasOwnProperty('toString') [String.as:70]
+PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:71]
+PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:72]
+PASSED: String.prototype.hasOwnProperty('charAt') [String.as:73]
+PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:74]
+PASSED: String.prototype.hasOwnProperty('concat') [String.as:75]
+PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:76]
+PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:77]
+PASSED: String.prototype.hasOwnProperty('slice') [String.as:78]
+PASSED: String.prototype.hasOwnProperty('substring') [String.as:79]
+PASSED: String.prototype.hasOwnProperty('split') [String.as:80]
+PASSED: String.prototype.hasOwnProperty('substr') [String.as:81]
+PASSED: !String.prototype.hasOwnProperty('length') [String.as:82]
+PASSED: typeof(String()) == 'string' [String.as:86]
+PASSED: a.length == 20 [String.as:90]
+PASSED: a.hasOwnProperty('length') [String.as:92]
+PASSED: typeof(a) == 'object' [String.as:94]
+PASSED: a instanceof String [String.as:95]
+PASSED: a instanceof Object [String.as:96]
+PASSED: a.charCodeAt(0) == 119 [String.as:97]
+PASSED: a.charCodeAt(1) == 97 [String.as:98]
+PASSED: a.charCodeAt(2) == 108 [String.as:99]
+PASSED: a.charCodeAt(3) == 108 [String.as:100]
+PASSED: a.charCodeAt(4) == 97 [String.as:101]
+PASSED: a.charAt(0) == "w" [String.as:102]
+PASSED: a.charAt(1) == "a" [String.as:103]
+PASSED: a.charAt(2) == "l" [String.as:104]
+PASSED: a.charAt(3) == "l" [String.as:105]
+PASSED: a.charAt(4) == "a" [String.as:106]
+PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
+PASSED: a.indexOf("lawa") == 3 [String.as:118]
+PASSED: a.indexOf("lawas") == 8 [String.as:119]
+PASSED: a.indexOf("hinG") == 13 [String.as:120]
+PASSED: a.indexOf("hing") == -1 [String.as:121]
+PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
+PASSED: a.indexOf("a", 2) == 4 [String.as:123]
+PASSED: a.indexOf("a", -1) == 1 [String.as:124]
+PASSED: a.indexOf("a", -2) == 1 [String.as:125]
+PASSED: a.indexOf("l") == 2 [String.as:126]
+PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
+PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
+PASSED: a.indexOf("l", 3) == 3 [String.as:129]
+PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
+PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
+PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
+PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
+PASSED: a.indexOf("l", -4) == 2 [String.as:134]
+PASSED: a.indexOf("a", o) == 4 [String.as:136]
+PASSED: a.indexOf(o2, o) == 4 [String.as:138]
+PASSED: typeof(a.split) == 'function' [String.as:145]
+PASSED: ! a.hasOwnProperty('split') [String.as:146]
+PASSED: a.__proto__.hasOwnProperty('split') [String.as:148]
+PASSED: a.__proto__ == String.prototype [String.as:149]
+PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
+PASSED: a.split().length == 1 [String.as:153]
+PASSED: a.split() instanceof Array [String.as:154]
+PASSED: a.split("w").length == 4 [String.as:155]
+PASSED: a.split(" w").length == 1 [String.as:156]
+PASSED: typeof(ret) == 'object' [String.as:161]
+PASSED: ret instanceof Array [String.as:162]
+PASSED: ret.length == 20 [String.as:163]
+PASSED: ret[0] == "w" [String.as:164]
+PASSED: ret[1] == "a" [String.as:165]
+PASSED: ret[2] == "l" [String.as:166]
+PASSED: ret[3] == "l" [String.as:167]
+PASSED: ret[18] == "O" [String.as:168]
+PASSED: ret[19] == "N" [String.as:169]
+PASSED: a.split("la")[0] == "wal" [String.as:170]
+PASSED: a.split("la")[1] == "wal" [String.as:171]
+PASSED: a.split("la")[2] == "washinGTON" [String.as:172]
+PASSED: a.split("la").length == 3 [String.as:173]
+PASSED: typeof(ret) == 'object' [String.as:189]
+PASSED: ret.length == 1 [String.as:190]
+PASSED: typeof(ret[0]) == 'string' [String.as:191]
+PASSED: ret[0] == '' [String.as:192]
+PASSED: ret.length == 1 [String.as:198]
+PASSED: ret.length == 1 [String.as:204]
+PASSED: ret.length == 1 [String.as:207]
+PASSED: ret.length == 1 [String.as:209]
+PASSED: typeof(ret) == 'object' [String.as:213]
+PASSED: ret.length == 1 [String.as:214]
+PASSED: typeof(ret[0]) == 'string' [String.as:215]
+PASSED: ret[0] == 'abcde' [String.as:216]
+XPASSED: g.length == 0 [String.as:221]
+XPASSED: typeof(g[0]) == "undefined" [String.as:222]
+XPASSED: g[0] == undefined [String.as:223]
+PASSED: g.length == 1 [String.as:233]
+PASSED: typeof(g[0]) == "string" [String.as:234]
+PASSED: g[0] == "" [String.as:235]
+PASSED: g.length == 1 [String.as:244]
+PASSED: typeof(g[0]) == "string" [String.as:245]
+PASSED: g[0] == "" [String.as:246]
+PASSED: g.length == 0 [String.as:251]
+PASSED: typeof(g[0]) == "undefined" [String.as:252]
+PASSED: g[0] == undefined [String.as:253]
+PASSED: g.length == 0 [String.as:263]
+PASSED: typeof(g[0]) == "undefined" [String.as:264]
+PASSED: g[0] == undefined [String.as:265]
+PASSED: g.length == 1 [String.as:269]
+PASSED: typeof(g[0]) == "string" [String.as:270]
+PASSED: g[0] == "f" [String.as:271]
+PASSED: b == "abcd" [String.as:282]
+PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
+PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
+PASSED: a.substr(5,2) == "fg" [String.as:298]
+PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
+PASSED: a.substr(-1,1) == "z" [String.as:300]
+PASSED: a.substr(-2,3) == "yz" [String.as:301]
+PASSED: a.substr(-3,2) == "xy" [String.as:302]
+PASSED: b.substr(3, 6) == "4" [String.as:304]
+PASSED: a.slice(-5,-3) == "vw" [String.as:312]
+PASSED: typeof(a.slice()) == "undefined" [String.as:313]
+PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
+PASSED: a.slice(-5,3) == "" [String.as:315]
+PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
+PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
+PASSED: a.slice(0,0) == "" [String.as:318]
+PASSED: a.slice(0,1) == "a" [String.as:319]
+PASSED: a.slice(1,1) == "" [String.as:320]
+PASSED: a.slice(1,2) == "b" [String.as:321]
+PASSED: a.slice.call(a, -5, -3) == "vw" [String.as:323]
+PASSED: String.prototype.slice.call(a, -5, -3) == "vw" [String.as:324]
+PASSED: a.slice(-4) == "wxyz" [String.as:331]
+PASSED: a.substring(5,2) == "cde" [String.as:339]
+PASSED: a.substring(5,7) == "fg" [String.as:340]
+PASSED: a.substring(3,3) == "" [String.as:341]
+PASSED: a.length == 26 [String.as:343]
+PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
+PASSED: b.substring(3, 6) == "4" [String.as:347]
+PASSED: chr(0) == "" [String.as:354]
+PASSED: chr(65) == "A" [String.as:355]
+PASSED: ord("A") == 65 [String.as:356]
+PASSED: ord("") == 0 [String.as:357]
+PASSED: chr(246) == "ö" [String.as:361]
+PASSED: chr(486) == "Ǧ" [String.as:362]
+PASSED: chr(998) == "Ϧ" [String.as:363]
+PASSED: ord("ö") == 246 [String.as:364]
+PASSED: ord("Ϧ") == 998 [String.as:365]
+PASSED: c == 486 [String.as:393]
+PASSED: c == 998 [String.as:409]
+PASSED: c == "Ϧ" [String.as:427]
+PASSED: c == "å¾" [String.as:446]
+PASSED: a.length == 14 [String.as:462]
+PASSED: a.substring(2,4) == "ng" [String.as:463]
+PASSED: a.charAt(1) == "ä" [String.as:464]
+PASSED: a.charAt(2) == "n" [String.as:465]
+PASSED: a.slice(3,5) == "ge" [String.as:466]
+PASSED: a.charCodeAt(9) == 246 [String.as:467]
+PASSED: b == "iao" [String.as:494]
+PASSED: b == "oowa" [String.as:504]
+PASSED: b == "c" [String.as:513]
+PASSED: b == "ciao" [String.as:522]
+PASSED: b == "c" [String.as:531]
+PASSED: b == "" [String.as:540]
+PASSED: b == "l" [String.as:549]
+PASSED: b == "f" [String.as:559]
+PASSED: b == "" [String.as:569]
+PASSED: count1 == 225 [String.as:605]
+PASSED: count2 == 225 [String.as:606]
+PASSED: b == "iao" [String.as:626]
+PASSED: b == "oowa" [String.as:636]
+PASSED: b == "c" [String.as:645]
+PASSED: b == "ciao" [String.as:654]
+PASSED: b == "c" [String.as:663]
+PASSED: b == "" [String.as:672]
+PASSED: b == "l" [String.as:681]
+PASSED: b == "f" [String.as:691]
+PASSED: stringInstance.__proto__ != undefined [String.as:700]
+PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
+PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
+PASSED: String.prototype.constructor == String [String.as:703]
+PASSED: stringInstance.__proto__.constructor == String [String.as:704]
+PASSED: stringInstance instanceof String [String.as:707]
+PASSED: ! "literal string" instanceof String [String.as:708]
+PASSED: typeof(a_string) == "string" [String.as:714]
+PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
+PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
+PASSED: a_string.substring(0, -1) == "" [String.as:717]
+PASSED: a_string.substring(0, 1) == "a" [String.as:718]
+PASSED: a_string.substring(4) == "ring" [String.as:719]
+PASSED: a_string.substring(16) == "" [String.as:720]
+PASSED: a_string.substring(-16) == "a_string" [String.as:721]
+PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
+PASSED: a_string.indexOf("hing") == -1 [String.as:723]
+PASSED: a_string.indexOf("string") == 2 [String.as:724]
+PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
+PASSED: a_string.substring(0, 1) == "" [String.as:727]
+PASSED: a_string.length == 10 [String.as:731]
+PASSED: a_string.length == 10 [String.as:733]
+PASSED: a_string == "1234567890" [String.as:734]
+PASSED: a+b == "onetwo" [String.as:742]
+PASSED: b+c == "two[object Object]" [String.as:745]
+PASSED: b+c == "twoone" [String.as:750]
+PASSED: c.toString != prevToStringFunc [String.as:755]
+PASSED: b+c == "two[type Object]" [String.as:757]
+PASSED: typeof(c.toString) == 'function' [String.as:761]
+PASSED: b+c == "two[type Object]" [String.as:762]
+PASSED: typeof(c.toString) == 'undefined' [String.as:766]
+PASSED: b+c == "two[type Object]" [String.as:767]
+PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
+PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
+PASSED: stringObject.valueOf != Object.prototype.valueOf [String.as:774]
+PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:775]
+PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
+PASSED: stringObject == "1234" [String.as:779]
+PASSED: stringObject == 1234 [String.as:780]
+PASSED: 1234 == stringObject [String.as:781]
+PASSED: stringObject != numberObject [String.as:784]
+PASSED: numberObject.toString() == stringObject [String.as:788]
+PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
+PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
+PASSED: typeof(s.toString) == 'function' [String.as:797]
+PASSED: ! delete String.prototype.toString [String.as:798]
+PASSED: delete String.prototype.toString [String.as:801]
+PASSED: typeof(s.toString) == 'function' [String.as:802]
+PASSED: !delete Object.prototype.toString [String.as:803]
+PASSED: delete Object.prototype.toString [String.as:806]
+PASSED: typeof(s.toString) == 'undefined' [String.as:807]
+PASSED: r == "s:hello" [String.as:817]
+PASSED: r == "s:" [String.as:821]
+PASSED: a.length == 3 [String.as:828]
+PASSED: a.length == 3 [String.as:830]
+PASSED: a.length == 3 [String.as:832]
+PASSED: a.length == 2 [String.as:834]
+PASSED: a == "123" [String.as:835]
+PASSED: a.length == "another string" [String.as:837]
+PASSED: a.length == "another string" [String.as:839]
+PASSED: a.hasOwnProperty('length') [String.as:841]
+PASSED: a.toString() == "toString" [String.as:850]
+PASSED: a.toString() == "toString" [String.as:858]
+PASSED: typeof(String.__proto__) == 'object' [String.as:860]
+PASSED: typeof(Object.prototype) == 'object' [String.as:861]
+PASSED: String.gotcha == 1 [String.as:863]
+PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
+PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
+PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
+PASSED: a.toString() == "gotcha,toString" [String.as:870]
+check_totals: 274
diff --git a/test/gnash/actionscript.all/String-7.swf b/test/gnash/actionscript.all/String-7.swf
new file mode 100644
index 0000000..f7ab72e
Binary files /dev/null and b/test/gnash/actionscript.all/String-7.swf differ
diff --git a/test/gnash/actionscript.all/String-7.swf.trace b/test/gnash/actionscript.all/String-7.swf.trace
new file mode 100644
index 0000000..2e45190
--- /dev/null
+++ b/test/gnash/actionscript.all/String-7.swf.trace
@@ -0,0 +1,275 @@
+PASSED: typeof(String) == 'function' [String.as:23]
+PASSED: typeof(String.prototype) == 'object' [String.as:24]
+PASSED: String.__proto__ == Function.prototype [String.as:25]
+PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
+PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
+PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
+PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
+PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
+PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
+PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
+PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
+PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
+PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
+PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
+PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
+PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
+PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
+PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
+PASSED: typeof(String.valueOf) == 'function' [String.as:42]
+PASSED: typeof(String.toString) == 'function' [String.as:43]
+PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
+PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
+PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
+PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
+PASSED: typeof(String.concat) == 'undefined' [String.as:52]
+PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
+PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
+PASSED: typeof(String.slice) == 'undefined' [String.as:55]
+PASSED: typeof(String.substring) == 'undefined' [String.as:56]
+PASSED: typeof(String.split) == 'undefined' [String.as:57]
+PASSED: typeof(String.substr) == 'undefined' [String.as:58]
+PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
+PASSED: String.hasOwnProperty('fromCharCode') [String.as:65]
+PASSED: !String.hasOwnProperty('toString') [String.as:66]
+PASSED: !String.hasOwnProperty('valueOf') [String.as:67]
+PASSED: String.hasOwnProperty('__proto__') [String.as:68]
+PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:69]
+PASSED: String.prototype.hasOwnProperty('toString') [String.as:70]
+PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:71]
+PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:72]
+PASSED: String.prototype.hasOwnProperty('charAt') [String.as:73]
+PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:74]
+PASSED: String.prototype.hasOwnProperty('concat') [String.as:75]
+PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:76]
+PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:77]
+PASSED: String.prototype.hasOwnProperty('slice') [String.as:78]
+PASSED: String.prototype.hasOwnProperty('substring') [String.as:79]
+PASSED: String.prototype.hasOwnProperty('split') [String.as:80]
+PASSED: String.prototype.hasOwnProperty('substr') [String.as:81]
+PASSED: !String.prototype.hasOwnProperty('length') [String.as:82]
+PASSED: typeof(String()) == 'string' [String.as:86]
+PASSED: a.length == 20 [String.as:90]
+PASSED: a.hasOwnProperty('length') [String.as:92]
+PASSED: typeof(a) == 'object' [String.as:94]
+PASSED: a instanceof String [String.as:95]
+PASSED: a instanceof Object [String.as:96]
+PASSED: a.charCodeAt(0) == 119 [String.as:97]
+PASSED: a.charCodeAt(1) == 97 [String.as:98]
+PASSED: a.charCodeAt(2) == 108 [String.as:99]
+PASSED: a.charCodeAt(3) == 108 [String.as:100]
+PASSED: a.charCodeAt(4) == 97 [String.as:101]
+PASSED: a.charAt(0) == "w" [String.as:102]
+PASSED: a.charAt(1) == "a" [String.as:103]
+PASSED: a.charAt(2) == "l" [String.as:104]
+PASSED: a.charAt(3) == "l" [String.as:105]
+PASSED: a.charAt(4) == "a" [String.as:106]
+PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
+PASSED: a.indexOf("lawa") == 3 [String.as:118]
+PASSED: a.indexOf("lawas") == 8 [String.as:119]
+PASSED: a.indexOf("hinG") == 13 [String.as:120]
+PASSED: a.indexOf("hing") == -1 [String.as:121]
+PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
+PASSED: a.indexOf("a", 2) == 4 [String.as:123]
+PASSED: a.indexOf("a", -1) == 1 [String.as:124]
+PASSED: a.indexOf("a", -2) == 1 [String.as:125]
+PASSED: a.indexOf("l") == 2 [String.as:126]
+PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
+PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
+PASSED: a.indexOf("l", 3) == 3 [String.as:129]
+PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
+PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
+PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
+PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
+PASSED: a.indexOf("l", -4) == 2 [String.as:134]
+PASSED: a.indexOf("a", o) == 4 [String.as:136]
+PASSED: a.indexOf(o2, o) == 4 [String.as:138]
+PASSED: typeof(a.split) == 'function' [String.as:145]
+PASSED: ! a.hasOwnProperty('split') [String.as:146]
+PASSED: a.__proto__.hasOwnProperty('split') [String.as:148]
+PASSED: a.__proto__ == String.prototype [String.as:149]
+PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
+PASSED: a.split().length == 1 [String.as:153]
+PASSED: a.split() instanceof Array [String.as:154]
+PASSED: a.split("w").length == 4 [String.as:155]
+PASSED: a.split(" w").length == 1 [String.as:156]
+PASSED: typeof(ret) == 'object' [String.as:161]
+PASSED: ret instanceof Array [String.as:162]
+PASSED: ret.length == 20 [String.as:163]
+PASSED: ret[0] == "w" [String.as:164]
+PASSED: ret[1] == "a" [String.as:165]
+PASSED: ret[2] == "l" [String.as:166]
+PASSED: ret[3] == "l" [String.as:167]
+PASSED: ret[18] == "O" [String.as:168]
+PASSED: ret[19] == "N" [String.as:169]
+PASSED: a.split("la")[0] == "wal" [String.as:170]
+PASSED: a.split("la")[1] == "wal" [String.as:171]
+PASSED: a.split("la")[2] == "washinGTON" [String.as:172]
+PASSED: a.split("la").length == 3 [String.as:173]
+PASSED: typeof(ret) == 'object' [String.as:189]
+PASSED: ret.length == 1 [String.as:190]
+PASSED: typeof(ret[0]) == 'string' [String.as:191]
+PASSED: ret[0] == '' [String.as:192]
+PASSED: ret.length == 1 [String.as:198]
+PASSED: ret.length == 1 [String.as:204]
+PASSED: ret.length == 1 [String.as:207]
+PASSED: ret.length == 1 [String.as:209]
+PASSED: typeof(ret) == 'object' [String.as:213]
+PASSED: ret.length == 1 [String.as:214]
+PASSED: typeof(ret[0]) == 'string' [String.as:215]
+PASSED: ret[0] == 'abcde' [String.as:216]
+XPASSED: g.length == 0 [String.as:221]
+XPASSED: typeof(g[0]) == "undefined" [String.as:222]
+XPASSED: g[0] == undefined [String.as:223]
+PASSED: g.length == 1 [String.as:233]
+PASSED: typeof(g[0]) == "string" [String.as:234]
+PASSED: g[0] == "" [String.as:235]
+PASSED: g.length == 1 [String.as:244]
+PASSED: typeof(g[0]) == "string" [String.as:245]
+PASSED: g[0] == "" [String.as:246]
+PASSED: g.length == 0 [String.as:251]
+PASSED: typeof(g[0]) == "undefined" [String.as:252]
+PASSED: g[0] == undefined [String.as:253]
+PASSED: g.length == 0 [String.as:263]
+PASSED: typeof(g[0]) == "undefined" [String.as:264]
+PASSED: g[0] == undefined [String.as:265]
+PASSED: g.length == 1 [String.as:269]
+PASSED: typeof(g[0]) == "string" [String.as:270]
+PASSED: g[0] == "f" [String.as:271]
+PASSED: b == "abcd" [String.as:282]
+PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
+PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
+PASSED: a.substr(5,2) == "fg" [String.as:298]
+PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
+PASSED: a.substr(-1,1) == "z" [String.as:300]
+PASSED: a.substr(-2,3) == "yz" [String.as:301]
+PASSED: a.substr(-3,2) == "xy" [String.as:302]
+PASSED: b.substr(3, 6) == "4" [String.as:304]
+PASSED: a.slice(-5,-3) == "vw" [String.as:312]
+PASSED: typeof(a.slice()) == "undefined" [String.as:313]
+PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
+PASSED: a.slice(-5,3) == "" [String.as:315]
+PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
+PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
+PASSED: a.slice(0,0) == "" [String.as:318]
+PASSED: a.slice(0,1) == "a" [String.as:319]
+PASSED: a.slice(1,1) == "" [String.as:320]
+PASSED: a.slice(1,2) == "b" [String.as:321]
+PASSED: a.slice.call(a, -5, -3) == "vw" [String.as:323]
+PASSED: String.prototype.slice.call(a, -5, -3) == "vw" [String.as:324]
+PASSED: a.slice(-4) == "wxyz" [String.as:331]
+PASSED: a.substring(5,2) == "cde" [String.as:339]
+PASSED: a.substring(5,7) == "fg" [String.as:340]
+PASSED: a.substring(3,3) == "" [String.as:341]
+PASSED: a.length == 26 [String.as:343]
+PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
+PASSED: b.substring(3, 6) == "4" [String.as:347]
+PASSED: chr(0) == "" [String.as:354]
+PASSED: chr(65) == "A" [String.as:355]
+PASSED: ord("A") == 65 [String.as:356]
+PASSED: ord("") == 0 [String.as:357]
+PASSED: chr(246) == "ö" [String.as:361]
+PASSED: chr(486) == "Ǧ" [String.as:362]
+PASSED: chr(998) == "Ϧ" [String.as:363]
+PASSED: ord("ö") == 246 [String.as:364]
+PASSED: ord("Ϧ") == 998 [String.as:365]
+PASSED: c == 486 [String.as:393]
+PASSED: c == 998 [String.as:409]
+PASSED: c == "Ϧ" [String.as:427]
+PASSED: c == "å¾" [String.as:446]
+PASSED: a.length == 14 [String.as:462]
+PASSED: a.substring(2,4) == "ng" [String.as:463]
+PASSED: a.charAt(1) == "ä" [String.as:464]
+PASSED: a.charAt(2) == "n" [String.as:465]
+PASSED: a.slice(3,5) == "ge" [String.as:466]
+PASSED: a.charCodeAt(9) == 246 [String.as:467]
+PASSED: b == "iao" [String.as:494]
+PASSED: b == "oowa" [String.as:504]
+PASSED: b == "c" [String.as:513]
+PASSED: b == "ciao" [String.as:522]
+PASSED: b == "c" [String.as:531]
+PASSED: b == "" [String.as:540]
+PASSED: b == "l" [String.as:549]
+PASSED: b == "f" [String.as:559]
+PASSED: b == "" [String.as:569]
+PASSED: count1 == 225 [String.as:605]
+PASSED: count2 == 225 [String.as:606]
+PASSED: b == "iao" [String.as:626]
+PASSED: b == "oowa" [String.as:636]
+PASSED: b == "c" [String.as:645]
+PASSED: b == "ciao" [String.as:654]
+PASSED: b == "c" [String.as:663]
+PASSED: b == "" [String.as:672]
+PASSED: b == "l" [String.as:681]
+PASSED: b == "f" [String.as:691]
+PASSED: stringInstance.__proto__ != undefined [String.as:700]
+PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
+PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
+PASSED: String.prototype.constructor == String [String.as:703]
+PASSED: stringInstance.__proto__.constructor == String [String.as:704]
+PASSED: stringInstance instanceof String [String.as:707]
+PASSED: ! "literal string" instanceof String [String.as:708]
+PASSED: typeof(a_string) == "string" [String.as:714]
+PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
+PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
+PASSED: a_string.substring(0, -1) == "" [String.as:717]
+PASSED: a_string.substring(0, 1) == "a" [String.as:718]
+PASSED: a_string.substring(4) == "ring" [String.as:719]
+PASSED: a_string.substring(16) == "" [String.as:720]
+PASSED: a_string.substring(-16) == "a_string" [String.as:721]
+PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
+PASSED: a_string.indexOf("hing") == -1 [String.as:723]
+PASSED: a_string.indexOf("string") == 2 [String.as:724]
+PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
+PASSED: a_string.substring(0, 1) == "" [String.as:727]
+PASSED: a_string.length == 10 [String.as:731]
+PASSED: a_string.length == 10 [String.as:733]
+PASSED: a_string == "1234567890" [String.as:734]
+PASSED: a+b == "onetwo" [String.as:742]
+PASSED: b+c == "two[object Object]" [String.as:745]
+PASSED: b+c == "twoone" [String.as:750]
+PASSED: c.toString != prevToStringFunc [String.as:755]
+PASSED: b+c == "two[type Object]" [String.as:757]
+PASSED: typeof(c.toString) == 'function' [String.as:761]
+PASSED: b+c == "two[type Object]" [String.as:762]
+PASSED: typeof(c.toString) == 'undefined' [String.as:766]
+PASSED: b+c == "two[type Object]" [String.as:767]
+PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
+PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
+PASSED: stringObject.valueOf != Object.prototype.valueOf [String.as:774]
+PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:775]
+PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
+PASSED: stringObject == "1234" [String.as:779]
+PASSED: stringObject == 1234 [String.as:780]
+PASSED: 1234 == stringObject [String.as:781]
+PASSED: stringObject != numberObject [String.as:784]
+PASSED: numberObject.toString() == stringObject [String.as:788]
+PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
+PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
+PASSED: typeof(s.toString) == 'function' [String.as:797]
+PASSED: ! delete String.prototype.toString [String.as:798]
+PASSED: delete String.prototype.toString [String.as:801]
+PASSED: typeof(s.toString) == 'function' [String.as:802]
+PASSED: !delete Object.prototype.toString [String.as:803]
+PASSED: delete Object.prototype.toString [String.as:806]
+PASSED: typeof(s.toString) == 'undefined' [String.as:807]
+PASSED: r == "s:hello" [String.as:817]
+PASSED: r == "s:" [String.as:821]
+PASSED: a.length == 3 [String.as:828]
+PASSED: a.length == 3 [String.as:830]
+PASSED: a.length == 3 [String.as:832]
+PASSED: a.length == 2 [String.as:834]
+PASSED: a == "123" [String.as:835]
+PASSED: a.length == "another string" [String.as:837]
+PASSED: a.length == "another string" [String.as:839]
+PASSED: a.hasOwnProperty('length') [String.as:841]
+PASSED: a.toString() == "toString" [String.as:850]
+PASSED: a.toString() == "toString" [String.as:858]
+PASSED: typeof(String.__proto__) == 'object' [String.as:860]
+PASSED: typeof(Object.prototype) == 'object' [String.as:861]
+PASSED: String.gotcha == 1 [String.as:863]
+PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
+PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
+PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
+PASSED: a.toString() == "gotcha,toString" [String.as:870]
+check_totals: 274
diff --git a/test/gnash/actionscript.all/String-8.swf b/test/gnash/actionscript.all/String-8.swf
new file mode 100644
index 0000000..204ede4
Binary files /dev/null and b/test/gnash/actionscript.all/String-8.swf differ
diff --git a/test/gnash/actionscript.all/String-8.swf.trace b/test/gnash/actionscript.all/String-8.swf.trace
new file mode 100644
index 0000000..2e45190
--- /dev/null
+++ b/test/gnash/actionscript.all/String-8.swf.trace
@@ -0,0 +1,275 @@
+PASSED: typeof(String) == 'function' [String.as:23]
+PASSED: typeof(String.prototype) == 'object' [String.as:24]
+PASSED: String.__proto__ == Function.prototype [String.as:25]
+PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
+PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
+PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
+PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
+PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
+PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
+PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
+PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
+PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
+PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
+PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
+PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
+PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
+PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
+PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
+PASSED: typeof(String.valueOf) == 'function' [String.as:42]
+PASSED: typeof(String.toString) == 'function' [String.as:43]
+PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
+PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
+PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
+PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
+PASSED: typeof(String.concat) == 'undefined' [String.as:52]
+PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
+PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
+PASSED: typeof(String.slice) == 'undefined' [String.as:55]
+PASSED: typeof(String.substring) == 'undefined' [String.as:56]
+PASSED: typeof(String.split) == 'undefined' [String.as:57]
+PASSED: typeof(String.substr) == 'undefined' [String.as:58]
+PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
+PASSED: String.hasOwnProperty('fromCharCode') [String.as:65]
+PASSED: !String.hasOwnProperty('toString') [String.as:66]
+PASSED: !String.hasOwnProperty('valueOf') [String.as:67]
+PASSED: String.hasOwnProperty('__proto__') [String.as:68]
+PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:69]
+PASSED: String.prototype.hasOwnProperty('toString') [String.as:70]
+PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:71]
+PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:72]
+PASSED: String.prototype.hasOwnProperty('charAt') [String.as:73]
+PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:74]
+PASSED: String.prototype.hasOwnProperty('concat') [String.as:75]
+PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:76]
+PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:77]
+PASSED: String.prototype.hasOwnProperty('slice') [String.as:78]
+PASSED: String.prototype.hasOwnProperty('substring') [String.as:79]
+PASSED: String.prototype.hasOwnProperty('split') [String.as:80]
+PASSED: String.prototype.hasOwnProperty('substr') [String.as:81]
+PASSED: !String.prototype.hasOwnProperty('length') [String.as:82]
+PASSED: typeof(String()) == 'string' [String.as:86]
+PASSED: a.length == 20 [String.as:90]
+PASSED: a.hasOwnProperty('length') [String.as:92]
+PASSED: typeof(a) == 'object' [String.as:94]
+PASSED: a instanceof String [String.as:95]
+PASSED: a instanceof Object [String.as:96]
+PASSED: a.charCodeAt(0) == 119 [String.as:97]
+PASSED: a.charCodeAt(1) == 97 [String.as:98]
+PASSED: a.charCodeAt(2) == 108 [String.as:99]
+PASSED: a.charCodeAt(3) == 108 [String.as:100]
+PASSED: a.charCodeAt(4) == 97 [String.as:101]
+PASSED: a.charAt(0) == "w" [String.as:102]
+PASSED: a.charAt(1) == "a" [String.as:103]
+PASSED: a.charAt(2) == "l" [String.as:104]
+PASSED: a.charAt(3) == "l" [String.as:105]
+PASSED: a.charAt(4) == "a" [String.as:106]
+PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
+PASSED: a.indexOf("lawa") == 3 [String.as:118]
+PASSED: a.indexOf("lawas") == 8 [String.as:119]
+PASSED: a.indexOf("hinG") == 13 [String.as:120]
+PASSED: a.indexOf("hing") == -1 [String.as:121]
+PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
+PASSED: a.indexOf("a", 2) == 4 [String.as:123]
+PASSED: a.indexOf("a", -1) == 1 [String.as:124]
+PASSED: a.indexOf("a", -2) == 1 [String.as:125]
+PASSED: a.indexOf("l") == 2 [String.as:126]
+PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
+PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
+PASSED: a.indexOf("l", 3) == 3 [String.as:129]
+PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
+PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
+PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
+PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
+PASSED: a.indexOf("l", -4) == 2 [String.as:134]
+PASSED: a.indexOf("a", o) == 4 [String.as:136]
+PASSED: a.indexOf(o2, o) == 4 [String.as:138]
+PASSED: typeof(a.split) == 'function' [String.as:145]
+PASSED: ! a.hasOwnProperty('split') [String.as:146]
+PASSED: a.__proto__.hasOwnProperty('split') [String.as:148]
+PASSED: a.__proto__ == String.prototype [String.as:149]
+PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
+PASSED: a.split().length == 1 [String.as:153]
+PASSED: a.split() instanceof Array [String.as:154]
+PASSED: a.split("w").length == 4 [String.as:155]
+PASSED: a.split(" w").length == 1 [String.as:156]
+PASSED: typeof(ret) == 'object' [String.as:161]
+PASSED: ret instanceof Array [String.as:162]
+PASSED: ret.length == 20 [String.as:163]
+PASSED: ret[0] == "w" [String.as:164]
+PASSED: ret[1] == "a" [String.as:165]
+PASSED: ret[2] == "l" [String.as:166]
+PASSED: ret[3] == "l" [String.as:167]
+PASSED: ret[18] == "O" [String.as:168]
+PASSED: ret[19] == "N" [String.as:169]
+PASSED: a.split("la")[0] == "wal" [String.as:170]
+PASSED: a.split("la")[1] == "wal" [String.as:171]
+PASSED: a.split("la")[2] == "washinGTON" [String.as:172]
+PASSED: a.split("la").length == 3 [String.as:173]
+PASSED: typeof(ret) == 'object' [String.as:189]
+PASSED: ret.length == 1 [String.as:190]
+PASSED: typeof(ret[0]) == 'string' [String.as:191]
+PASSED: ret[0] == '' [String.as:192]
+PASSED: ret.length == 1 [String.as:198]
+PASSED: ret.length == 1 [String.as:204]
+PASSED: ret.length == 1 [String.as:207]
+PASSED: ret.length == 1 [String.as:209]
+PASSED: typeof(ret) == 'object' [String.as:213]
+PASSED: ret.length == 1 [String.as:214]
+PASSED: typeof(ret[0]) == 'string' [String.as:215]
+PASSED: ret[0] == 'abcde' [String.as:216]
+XPASSED: g.length == 0 [String.as:221]
+XPASSED: typeof(g[0]) == "undefined" [String.as:222]
+XPASSED: g[0] == undefined [String.as:223]
+PASSED: g.length == 1 [String.as:233]
+PASSED: typeof(g[0]) == "string" [String.as:234]
+PASSED: g[0] == "" [String.as:235]
+PASSED: g.length == 1 [String.as:244]
+PASSED: typeof(g[0]) == "string" [String.as:245]
+PASSED: g[0] == "" [String.as:246]
+PASSED: g.length == 0 [String.as:251]
+PASSED: typeof(g[0]) == "undefined" [String.as:252]
+PASSED: g[0] == undefined [String.as:253]
+PASSED: g.length == 0 [String.as:263]
+PASSED: typeof(g[0]) == "undefined" [String.as:264]
+PASSED: g[0] == undefined [String.as:265]
+PASSED: g.length == 1 [String.as:269]
+PASSED: typeof(g[0]) == "string" [String.as:270]
+PASSED: g[0] == "f" [String.as:271]
+PASSED: b == "abcd" [String.as:282]
+PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
+PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
+PASSED: a.substr(5,2) == "fg" [String.as:298]
+PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
+PASSED: a.substr(-1,1) == "z" [String.as:300]
+PASSED: a.substr(-2,3) == "yz" [String.as:301]
+PASSED: a.substr(-3,2) == "xy" [String.as:302]
+PASSED: b.substr(3, 6) == "4" [String.as:304]
+PASSED: a.slice(-5,-3) == "vw" [String.as:312]
+PASSED: typeof(a.slice()) == "undefined" [String.as:313]
+PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
+PASSED: a.slice(-5,3) == "" [String.as:315]
+PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
+PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
+PASSED: a.slice(0,0) == "" [String.as:318]
+PASSED: a.slice(0,1) == "a" [String.as:319]
+PASSED: a.slice(1,1) == "" [String.as:320]
+PASSED: a.slice(1,2) == "b" [String.as:321]
+PASSED: a.slice.call(a, -5, -3) == "vw" [String.as:323]
+PASSED: String.prototype.slice.call(a, -5, -3) == "vw" [String.as:324]
+PASSED: a.slice(-4) == "wxyz" [String.as:331]
+PASSED: a.substring(5,2) == "cde" [String.as:339]
+PASSED: a.substring(5,7) == "fg" [String.as:340]
+PASSED: a.substring(3,3) == "" [String.as:341]
+PASSED: a.length == 26 [String.as:343]
+PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
+PASSED: b.substring(3, 6) == "4" [String.as:347]
+PASSED: chr(0) == "" [String.as:354]
+PASSED: chr(65) == "A" [String.as:355]
+PASSED: ord("A") == 65 [String.as:356]
+PASSED: ord("") == 0 [String.as:357]
+PASSED: chr(246) == "ö" [String.as:361]
+PASSED: chr(486) == "Ǧ" [String.as:362]
+PASSED: chr(998) == "Ϧ" [String.as:363]
+PASSED: ord("ö") == 246 [String.as:364]
+PASSED: ord("Ϧ") == 998 [String.as:365]
+PASSED: c == 486 [String.as:393]
+PASSED: c == 998 [String.as:409]
+PASSED: c == "Ϧ" [String.as:427]
+PASSED: c == "å¾" [String.as:446]
+PASSED: a.length == 14 [String.as:462]
+PASSED: a.substring(2,4) == "ng" [String.as:463]
+PASSED: a.charAt(1) == "ä" [String.as:464]
+PASSED: a.charAt(2) == "n" [String.as:465]
+PASSED: a.slice(3,5) == "ge" [String.as:466]
+PASSED: a.charCodeAt(9) == 246 [String.as:467]
+PASSED: b == "iao" [String.as:494]
+PASSED: b == "oowa" [String.as:504]
+PASSED: b == "c" [String.as:513]
+PASSED: b == "ciao" [String.as:522]
+PASSED: b == "c" [String.as:531]
+PASSED: b == "" [String.as:540]
+PASSED: b == "l" [String.as:549]
+PASSED: b == "f" [String.as:559]
+PASSED: b == "" [String.as:569]
+PASSED: count1 == 225 [String.as:605]
+PASSED: count2 == 225 [String.as:606]
+PASSED: b == "iao" [String.as:626]
+PASSED: b == "oowa" [String.as:636]
+PASSED: b == "c" [String.as:645]
+PASSED: b == "ciao" [String.as:654]
+PASSED: b == "c" [String.as:663]
+PASSED: b == "" [String.as:672]
+PASSED: b == "l" [String.as:681]
+PASSED: b == "f" [String.as:691]
+PASSED: stringInstance.__proto__ != undefined [String.as:700]
+PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
+PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
+PASSED: String.prototype.constructor == String [String.as:703]
+PASSED: stringInstance.__proto__.constructor == String [String.as:704]
+PASSED: stringInstance instanceof String [String.as:707]
+PASSED: ! "literal string" instanceof String [String.as:708]
+PASSED: typeof(a_string) == "string" [String.as:714]
+PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
+PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
+PASSED: a_string.substring(0, -1) == "" [String.as:717]
+PASSED: a_string.substring(0, 1) == "a" [String.as:718]
+PASSED: a_string.substring(4) == "ring" [String.as:719]
+PASSED: a_string.substring(16) == "" [String.as:720]
+PASSED: a_string.substring(-16) == "a_string" [String.as:721]
+PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
+PASSED: a_string.indexOf("hing") == -1 [String.as:723]
+PASSED: a_string.indexOf("string") == 2 [String.as:724]
+PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
+PASSED: a_string.substring(0, 1) == "" [String.as:727]
+PASSED: a_string.length == 10 [String.as:731]
+PASSED: a_string.length == 10 [String.as:733]
+PASSED: a_string == "1234567890" [String.as:734]
+PASSED: a+b == "onetwo" [String.as:742]
+PASSED: b+c == "two[object Object]" [String.as:745]
+PASSED: b+c == "twoone" [String.as:750]
+PASSED: c.toString != prevToStringFunc [String.as:755]
+PASSED: b+c == "two[type Object]" [String.as:757]
+PASSED: typeof(c.toString) == 'function' [String.as:761]
+PASSED: b+c == "two[type Object]" [String.as:762]
+PASSED: typeof(c.toString) == 'undefined' [String.as:766]
+PASSED: b+c == "two[type Object]" [String.as:767]
+PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
+PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
+PASSED: stringObject.valueOf != Object.prototype.valueOf [String.as:774]
+PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:775]
+PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
+PASSED: stringObject == "1234" [String.as:779]
+PASSED: stringObject == 1234 [String.as:780]
+PASSED: 1234 == stringObject [String.as:781]
+PASSED: stringObject != numberObject [String.as:784]
+PASSED: numberObject.toString() == stringObject [String.as:788]
+PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
+PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
+PASSED: typeof(s.toString) == 'function' [String.as:797]
+PASSED: ! delete String.prototype.toString [String.as:798]
+PASSED: delete String.prototype.toString [String.as:801]
+PASSED: typeof(s.toString) == 'function' [String.as:802]
+PASSED: !delete Object.prototype.toString [String.as:803]
+PASSED: delete Object.prototype.toString [String.as:806]
+PASSED: typeof(s.toString) == 'undefined' [String.as:807]
+PASSED: r == "s:hello" [String.as:817]
+PASSED: r == "s:" [String.as:821]
+PASSED: a.length == 3 [String.as:828]
+PASSED: a.length == 3 [String.as:830]
+PASSED: a.length == 3 [String.as:832]
+PASSED: a.length == 2 [String.as:834]
+PASSED: a == "123" [String.as:835]
+PASSED: a.length == "another string" [String.as:837]
+PASSED: a.length == "another string" [String.as:839]
+PASSED: a.hasOwnProperty('length') [String.as:841]
+PASSED: a.toString() == "toString" [String.as:850]
+PASSED: a.toString() == "toString" [String.as:858]
+PASSED: typeof(String.__proto__) == 'object' [String.as:860]
+PASSED: typeof(Object.prototype) == 'object' [String.as:861]
+PASSED: String.gotcha == 1 [String.as:863]
+PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
+PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
+PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
+PASSED: a.toString() == "gotcha,toString" [String.as:870]
+check_totals: 274
diff --git a/test/gnash/actionscript.all/String.as b/test/gnash/actionscript.all/String.as
new file mode 100644
index 0000000..d1fd0af
--- /dev/null
+++ b/test/gnash/actionscript.all/String.as
@@ -0,0 +1,905 @@
+//
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program 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 General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+// Original author: Mike Carlson - June 19th, 2006
+
+
+rcsid="$Id: String.as,v 1.56 2008/04/25 11:11:08 bwy Exp $";
+#include "check.as"
+
+check_equals(typeof(String), 'function');
+check_equals(typeof(String.prototype), 'object');
+check_equals(String.__proto__, Function.prototype); // both undefined in swf5
+check_equals(typeof(String.prototype.valueOf), 'function');
+check_equals(typeof(String.prototype.toString), 'function');
+check_equals(typeof(String.prototype.toUpperCase), 'function');
+check_equals(typeof(String.prototype.toLowerCase), 'function');
+check_equals(typeof(String.prototype.charAt), 'function');
+check_equals(typeof(String.prototype.charCodeAt), 'function');
+check_equals(typeof(String.prototype.concat), 'function');
+check_equals(typeof(String.prototype.indexOf), 'function');
+check_equals(typeof(String.prototype.lastIndexOf), 'function');
+check_equals(typeof(String.prototype.slice), 'function');
+check_equals(typeof(String.prototype.substring), 'function');
+check_equals(typeof(String.prototype.split), 'function');
+check_equals(typeof(String.prototype.substr), 'function');
+check_equals(typeof(String.prototype.length), 'undefined');
+check_equals(typeof(String.prototype.fromCharCode), 'undefined');
+#if OUTPUT_VERSION > 5
+ check_equals(typeof(String.valueOf), 'function');
+ check_equals(typeof(String.toString), 'function');
+#else
+ check_equals(typeof(String.valueOf), 'undefined');
+ check_equals(typeof(String.toString), 'undefined');
+#endif
+check_equals(typeof(String.toUpperCase), 'undefined');
+check_equals(typeof(String.toLowerCase), 'undefined');
+check_equals(typeof(String.charAt), 'undefined');
+check_equals(typeof(String.charCodeAt), 'undefined');
+check_equals(typeof(String.concat), 'undefined');
+check_equals(typeof(String.indexOf), 'undefined');
+check_equals(typeof(String.lastIndexOf), 'undefined');
+check_equals(typeof(String.slice), 'undefined');
+check_equals(typeof(String.substring), 'undefined');
+check_equals(typeof(String.split), 'undefined');
+check_equals(typeof(String.substr), 'undefined');
+check_equals(typeof(String.fromCharCode), 'function');
+
+#if OUTPUT_VERSION > 5
+
+// Tests for SWF5 at the end of the file.
+
+check(String.hasOwnProperty('fromCharCode'));
+check(!String.hasOwnProperty('toString'));
+check(!String.hasOwnProperty('valueOf'));
+check(String.hasOwnProperty('__proto__'));
+check(String.prototype.hasOwnProperty('valueOf'));
+check(String.prototype.hasOwnProperty('toString'));
+check(String.prototype.hasOwnProperty('toUpperCase'));
+check(String.prototype.hasOwnProperty('toLowerCase'));
+check(String.prototype.hasOwnProperty('charAt'));
+check(String.prototype.hasOwnProperty('charCodeAt'));
+check(String.prototype.hasOwnProperty('concat'));
+check(String.prototype.hasOwnProperty('indexOf'));
+check(String.prototype.hasOwnProperty('lastIndexOf'));
+check(String.prototype.hasOwnProperty('slice'));
+check(String.prototype.hasOwnProperty('substring'));
+check(String.prototype.hasOwnProperty('split'));
+check(String.prototype.hasOwnProperty('substr'));
+check(!String.prototype.hasOwnProperty('length'));
+
+#endif
+
+check_equals(typeof(String()), 'string');
+
+var a;
+a = new String("wallawallawashinGTON");
+check_equals(a.length, 20);
+#if OUTPUT_VERSION > 5
+check(a.hasOwnProperty('length'));
+#endif
+check_equals(typeof(a), 'object');
+check(a instanceof String);
+check(a instanceof Object);
+check_equals ( a.charCodeAt(0), 119 );
+check_equals ( a.charCodeAt(1), 97 );
+check_equals ( a.charCodeAt(2), 108 );
+check_equals ( a.charCodeAt(3), 108 );
+check_equals ( a.charCodeAt(4), 97 );
+check_equals ( a.charAt(0), "w" );
+check_equals ( a.charAt(1), "a" );
+check_equals ( a.charAt(2), "l" );
+check_equals ( a.charAt(3), "l" );
+check_equals ( a.charAt(4), "a" );
+isNaN ( a.charAt(-1) );
+isNaN (a.charAt(21) );
+check_equals ( a.lastIndexOf("lawa"), 8);
+
+//----------------------------------------
+// Check String.indexOf
+// TODO: test with ASnative(251,8)
+//-----------------------------------------
+
+
+// wallawallawashinGTON
+check_equals ( a.indexOf("lawa"), 3 );
+check_equals ( a.indexOf("lawas"), 8 );
+check_equals ( a.indexOf("hinG"), 13 );
+check_equals ( a.indexOf("hing"), -1 );
+check_equals ( a.indexOf("lawas", -1), 8 );
+check_equals ( a.indexOf("a", 2), 4 );
+check_equals ( a.indexOf("a", -1), 1 );
+check_equals ( a.indexOf("a", -2), 1 );
+check_equals ( a.indexOf("l"), 2 );
+check_equals ( a.indexOf("l", 2.1), 2 );
+check_equals ( a.indexOf("l", 2.8), 2 );
+check_equals ( a.indexOf("l", 3), 3 );
+check_equals ( a.indexOf("l", 3.5), 3 );
+check_equals ( a.indexOf("l", 3.8), 3 );
+check_equals ( a.indexOf("l", -3.8), 2 );
+check_equals ( a.indexOf("l", -4.8), 2 );
+check_equals ( a.indexOf("l", -4), 2 );
+o = {}; o.valueOf = function() { return 2; };
+check_equals ( a.indexOf("a", o), 4 );
+o2 = {}; o2.toString = function() { return "a"; };
+check_equals ( a.indexOf(o2, o), 4 );
+
+//----------------------------------------
+// Check String.split
+// TODO: test with ASnative(251,12)
+//-----------------------------------------
+
+check_equals ( typeof(a.split), 'function' );
+check ( ! a.hasOwnProperty('split') );
+#if OUTPUT_VERSION > 5
+check ( a.__proto__.hasOwnProperty('split') );
+check ( a.__proto__ == String.prototype );
+#endif
+
+check_equals ( a.split()[0], "wallawallawashinGTON" );
+check_equals ( a.split().length, 1 );
+check ( a.split() instanceof Array );
+check_equals ( a.split("w").length, 4);
+check_equals ( a.split(" w").length, 1);
+
+#if OUTPUT_VERSION > 5
+// TODO: check more of split(''), it seems to be bogus !
+ret = a.split('');
+check_equals(typeof(ret), 'object');
+check(ret instanceof Array);
+check_equals( ret.length, 20 );
+check_equals ( ret[0], "w" );
+check_equals ( ret[1], "a" );
+check_equals ( ret[2], "l" );
+check_equals ( ret[3], "l" );
+check_equals ( ret[18], "O" );
+check_equals ( ret[19], "N" );
+check_equals ( a.split("la")[0], "wal" );
+check_equals ( a.split("la")[1], "wal" );
+check_equals ( a.split("la")[2], "washinGTON" );
+check_equals ( a.split("la").length, 3 );
+#else
+// empty delimiter doesn't have a special meaning in SWF5
+check_equals ( a.split("")[0], "wallawallawashinGTON" );
+check_equals ( a.split("")[19], undefined );
+// mulit-char delimiter doesn't work in SWF5
+check_equals ( a.split("la")[0], "wallawallawashinGTON" );
+check_equals ( a.split("la")[1], undefined );
+check_equals ( a.split("la")[2], undefined );
+check_equals ( a.split("la").length, 1 );
+#endif
+
+// TODO: test String.split(delim, limit) [ second arg ]
+
+primitiveString = '';
+ret = primitiveString.split('x');
+check_equals(typeof(ret), 'object');
+check_equals(ret.length, 1);
+check_equals(typeof(ret[0]), 'string');
+check_equals(ret[0], '');
+
+ret = primitiveString.split('x', -1);
+#if OUTPUT_VERSION < 6
+ check_equals(ret.length, 0);
+#else // OUTPUT_VERSION >= 6
+ check_equals(ret.length, 1);
+#endif // OUTPUT_VERSION >= 6
+ret = primitiveString.split('x', 0);
+#if OUTPUT_VERSION < 6
+ check_equals(ret.length, 0);
+#else // OUTPUT_VERSION >= 6
+ check_equals(ret.length, 1);
+#endif // OUTPUT_VERSION >= 6
+ret = primitiveString.split('x', 1);
+check_equals(ret.length, 1);
+ret = primitiveString.split('x', 2);
+check_equals(ret.length, 1);
+
+primitiveString = 'abcde';
+ret = primitiveString.split('x');
+check_equals(typeof(ret), 'object');
+check_equals(ret.length, 1);
+check_equals(typeof(ret[0]), 'string');
+check_equals(ret[0], 'abcde');
+
+st = "";
+g = st.split("", 0);
+#if OUTPUT_VERSION > 5
+xcheck_equals(g.length, 0);
+xcheck_equals(typeof(g[0]), "undefined");
+xcheck_equals(g[0], undefined);
+#else
+check_equals(g.length, 1);
+check_equals(typeof(g[0]), "string");
+check_equals(g[0], "");
+#endif
+
+st = "";
+g = st.split("x", 0);
+#if OUTPUT_VERSION > 5
+check_equals(g.length, 1);
+check_equals(typeof(g[0]), "string");
+check_equals(g[0], "");
+#else
+check_equals(g.length, 0);
+check_equals(typeof(g[0]), "undefined");
+check_equals(g[0], undefined);
+#endif
+
+st = "";
+g = st.split("x", 1);
+check_equals(g.length, 1);
+check_equals(typeof(g[0]), "string");
+check_equals(g[0], "");
+
+st = "f";
+g = st.split("", 0);
+#if OUTPUT_VERSION > 5
+check_equals(g.length, 0);
+check_equals(typeof(g[0]), "undefined");
+check_equals(g[0], undefined);
+#else
+check_equals(g.length, 1);
+check_equals(typeof(g[0]), "string");
+check_equals(g[0], "f");
+#endif
+
+
+st = "f";
+g = st.split("x", 0);
+check_equals(g.length, 0);
+check_equals(typeof(g[0]), "undefined");
+check_equals(g[0], undefined);
+
+st = "f";
+g = st.split("x", 1);
+check_equals(g.length, 1);
+check_equals(typeof(g[0]), "string");
+check_equals(g[0], "f");
+
+
+//----------------------------------------
+// Check String.fromCharCode
+// TODO: test with ASnative(251,14)
+//-----------------------------------------
+
+
+// This is the correct usage pattern
+var b = String.fromCharCode(97,98,99,100);
+check_equals ( b, "abcd" );
+
+//-------------------------------------------
+// Check String.toUpperCase and toLowerCase
+// TODO: test with ASnative(251,3)
+//-------------------------------------------
+
+check_equals ( a.toUpperCase(), "WALLAWALLAWASHINGTON" );
+check_equals ( a.toLowerCase(), "wallawallawashington" );
+
+//-------------------------------------------
+// Check substr
+// TODO: test with ASnative(251,13)
+//-------------------------------------------
+
+a = new String("abcdefghijklmnopqrstuvwxyz");
+check_equals ( a.substr(5,2), "fg" );
+check_equals ( a.substr(5,7), "fghijkl" );
+check_equals ( a.substr(-1,1), "z" );
+check_equals ( a.substr(-2,3), "yz" );
+check_equals ( a.substr(-3,2), "xy" );
+var b = new String("1234");
+check_equals ( b.substr(3, 6), "4");
+
+//-------------------------------------------
+// Check slice
+// TODO: test with ASnative(251,10)
+//-------------------------------------------
+
+a = new String("abcdefghijklmnopqrstuvwxyz");
+check_equals ( a.slice(-5,-3), "vw" );
+check_equals ( typeof(a.slice()), "undefined" );
+check_equals ( typeof(a.slice(-5,3)), "string" );
+check_equals ( a.slice(-5,3), "" );
+check_equals ( typeof(a.slice(-10,22)), "string" );
+check_equals ( a.slice(-10,22), "qrstuv" );
+check_equals ( a.slice(0,0), "" );
+check_equals ( a.slice(0,1), "a" );
+check_equals ( a.slice(1,1), "" );
+check_equals ( a.slice(1,2), "b" );
+#if OUTPUT_VERSION > 5
+check_equals ( a.slice.call(a, -5, -3), "vw" );
+check_equals ( String.prototype.slice.call(a, -5, -3), "vw" );
+#else
+// There was no 'call' or 'apply' thing up to SWF5
+// Actually, there was no Function interface at all!
+check_equals ( a.slice.call(a, -5, -3), undefined );
+check_equals ( String.prototype.slice.call(a, -5, -3), undefined );
+#endif
+check_equals ( a.slice(-4), "wxyz" );
+
+//-------------------------------------------
+// Check substring
+// TODO: test with ASnative(251,11)
+//-------------------------------------------
+
+a = new String("abcdefghijklmnopqrstuvwxyz");
+check_equals ( a.substring(5,2), "cde" );
+check_equals ( a.substring(5,7), "fg" );
+check_equals ( a.substring(3,3), "" );
+
+check_equals ( a.length, 26 );
+check_equals ( a.concat("sir ","william",15), "abcdefghijklmnopqrstuvwxyzsir william15");
+
+var b = new String("1234");
+check_equals ( b.substring(3, 6), "4");
+
+
+//-------------------------------------------
+// Chr and ord
+//-------------------------------------------
+
+check_equals (chr(0), "");
+check_equals (chr(65), "A");
+check_equals (ord("A"), 65);
+check_equals (ord(""), 0);
+
+// Chars greater than 128
+#if OUTPUT_VERSION > 5
+check_equals (chr(246), "ö");
+check_equals (chr(486), "Ǧ");
+check_equals (chr(998), "Ϧ");
+check_equals (ord("ö"), 246);
+check_equals (ord("Ϧ"), 998);
+#else // version <= 5
+check_equals (typeof(chr(486)), 'string');
+check_equals (chr(865), "a");
+check_equals (ord("ö"), 195);
+check_equals (ord("Ã"), 195);
+check_equals (ord("ǵ"), 199);
+check_equals (ord("Ϧ"), 207);
+#endif
+
+//-------------------------------------------
+// Mbchr and mbord
+//-------------------------------------------
+
+// All versions, especially 5:
+var c;
+
+i = "Ǧ";
+
+asm {
+ push "c"
+ push "i"
+ getvariable
+ mbord
+ setvariable
+};
+
+#if OUTPUT_VERSION > 5
+check_equals (c, 486);
+#else
+xcheck_equals (c, 199);
+#endif
+
+i = "Ϧ";
+
+asm {
+ push "c"
+ push "i"
+ getvariable
+ mbord
+ setvariable
+};
+
+#if OUTPUT_VERSION > 5
+check_equals (c, 998);
+#else
+xcheck_equals (c, 207);
+#endif
+
+// And the reverse procedure:
+
+i = 998;
+
+asm {
+ push "c"
+ push "i"
+ getvariable
+ mbchr
+ setvariable
+};
+
+#if OUTPUT_VERSION > 5
+check_equals (c, "Ϧ");
+#else
+check_equals (typeof(c), "string");
+// c == "" fails, but when displayed it evaluates to the empty string
+#endif
+
+// Should return the same as mbchr(90000 - 65536)
+
+i = 90000;
+
+asm {
+ push "c"
+ push "i"
+ getvariable
+ mbchr
+ setvariable
+};
+
+#if OUTPUT_VERSION > 5
+check_equals (c, "å¾");
+#else
+check_equals (typeof(c), "string");
+// c == "" fails, but when displayed it evaluates to the empty string
+#endif
+
+//-------------------------------------------
+// Check multi-byte chars with all string
+// functions
+//-------------------------------------------
+
+// These tests are only correct with SWF6 and above.
+
+var a = new String("Längere Wörter");
+
+#if OUTPUT_VERSION > 5
+check_equals (a.length, 14);
+check_equals (a.substring(2,4), "ng");
+check_equals (a.charAt(1), "ä");
+check_equals (a.charAt(2), "n");
+check_equals (a.slice(3,5), "ge");
+check_equals (a.charCodeAt(9), 246);
+#else
+check_equals (a.length, 16);
+check_equals (a.slice(3,5), "ng");
+check_equals (a.charCodeAt(10), 195);
+#endif
+
+//-----------------------------------------------------------
+// Test SWFACTION_SUBSTRING
+//-----------------------------------------------------------
+
+// see check.as
+#ifdef MING_SUPPORTS_ASM
+
+// We need ming-0.4.0beta2 or later for this to work...
+// This is the only way to generate an SWFACTION_SUBSTRING
+// tag (the calls above generate a CALLMETHOD tag)
+//
+asm {
+ push "b"
+ push "ciao"
+ push "2"
+ push "10" // size is bigger then string length,
+ // we expect the interpreter to adjust it
+ substring
+ setvariable
+};
+check_equals( b, "iao");
+asm {
+ push "b"
+ push "boowa"
+ push "2"
+ push "-1" // size is bigger then string length,
+ // we expect the interpreter to adjust it
+ substring
+ setvariable
+};
+check_equals( b, "oowa");
+asm {
+ push "b"
+ push "ciao"
+ push "-2" // negative base should be interpreted as 1
+ push "1"
+ substring
+ setvariable
+};
+check_equals( b, "c");
+asm {
+ push "b"
+ push "ciao"
+ push "-2" // negative base should be interpreted as 1
+ push "10" // long size reduced
+ substring
+ setvariable
+};
+check_equals( b, "ciao");
+asm {
+ push "b"
+ push "ciao"
+ push "0" // zero base is invalid, but taken as 1
+ push "1"
+ substring
+ setvariable
+};
+check_equals( b, "c");
+asm {
+ push "b"
+ push "ciao"
+ push "10" // too large base ...
+ push "1"
+ substring
+ setvariable
+};
+check_equals( b, "");
+asm {
+ push "b"
+ push "all"
+ push "3" // base is 1-based!
+ push "1"
+ substring
+ setvariable
+};
+check_equals( b, "l");
+
+asm {
+ push "b"
+ push "f"
+ push "1"
+ push "1"
+ substring
+ setvariable
+};
+check_equals( b, "f");
+
+asm {
+ push "b"
+ push ""
+ push "0"
+ push "1"
+ substring
+ setvariable
+};
+check_equals( b, "");
+
+teststr = "Heöllo";
+count1 = 0;
+count2 = 0;
+
+for (i = -5; i < 10; i++)
+{
+ for (j = -5; j < 10; j++)
+ {
+ asm {
+ push "a"
+ push "teststr"
+ getvariable
+ push "i"
+ getvariable
+ push "j"
+ getvariable
+ substring
+ setvariable
+ };
+
+ b = teststr.substr( i >= 1 ? i - 1 : 0, j >= 0 ? j : teststr.length);
+
+ // Test for undefined.
+ c = teststr.substr( i >= 1 ? i - 1 : 0, j >= 0 ? j : teststr.undef());
+
+ // There are 225 tests
+ if (a == b) count1++;
+ else note(i + " : " + j + " -- " + a + ":" + b);
+
+ if (b == c) count2++;
+
+ }
+}
+
+check_equals (count1, 225); // String.substr / substring consistency
+check_equals (count2, 225); // undefined value same as no value passed (or length of string)
+
+#endif
+
+//-----------------------------------------------------------
+// Test SWFACTION_MBSUBSTRING
+//-----------------------------------------------------------
+
+// see check.as
+#ifdef MING_SUPPORTS_ASM
+
+asm {
+ push "b"
+ push "ciao"
+ push "2"
+ push "10" // size is bigger then string length,
+ // we expect the interpreter to adjust it
+ mbsubstring
+ setvariable
+};
+check_equals( b, "iao");
+asm {
+ push "b"
+ push "boowa"
+ push "2"
+ push "-1" // size is bigger then string length,
+ // we expect the interpreter to adjust it
+ mbsubstring
+ setvariable
+};
+check_equals( b, "oowa");
+asm {
+ push "b"
+ push "ciao"
+ push "-2" // negative base should be interpreted as 1
+ push "1"
+ mbsubstring
+ setvariable
+};
+check_equals( b, "c");
+asm {
+ push "b"
+ push "ciao"
+ push "-2" // negative base should be interpreted as 1
+ push "10" // long size reduced
+ mbsubstring
+ setvariable
+};
+check_equals( b, "ciao");
+asm {
+ push "b"
+ push "ciao"
+ push "0" // zero base is invalid, but taken as 1
+ push "1"
+ mbsubstring
+ setvariable
+};
+check_equals( b, "c");
+asm {
+ push "b"
+ push "ciao"
+ push "10" // too large base ...
+ push "1"
+ mbsubstring
+ setvariable
+};
+check_equals( b, "");
+asm {
+ push "b"
+ push "all"
+ push "3" // base is 1-based!
+ push "1"
+ mbsubstring
+ setvariable
+};
+check_equals( b, "l");
+
+asm {
+ push "b"
+ push "f"
+ push "1"
+ push "1"
+ mbsubstring
+ setvariable
+};
+check_equals( b, "f");
+
+#endif
+
+//-----------------------------------------------------------
+// Test inheritance with built-in functions
+//-----------------------------------------------------------
+
+var stringInstance = new String();
+check (stringInstance.__proto__ != undefined);
+check (stringInstance.__proto__ == String.prototype);
+check_equals (typeOf(String.prototype.constructor), 'function');
+check (String.prototype.constructor == String);
+check (stringInstance.__proto__.constructor == String);
+
+// Test the instanceof operator
+check ( stringInstance instanceof String );
+check ( ! "literal string" instanceof String );
+
+// Test automatic cast of string values to String objects
+// this should happen automatically when invoking methods
+// on a primitive string type
+var a_string = "a_string";
+check_equals(typeof(a_string), "string");
+check_equals (a_string.substring(0, 4), "a_st");
+check_equals (a_string.substring(-3, 4), "a_st");
+check_equals (a_string.substring(0, -1), "");
+check_equals (a_string.substring(0, 1), "a");
+check_equals (a_string.substring(4), "ring");
+check_equals (a_string.substring(16), "");
+check_equals (a_string.substring(-16), "a_string");
+check_equals (a_string.toUpperCase(), "A_STRING");
+check_equals (a_string.indexOf("hing"), -1 );
+check_equals (a_string.indexOf("string"), 2 );
+check_equals (a_string.charCodeAt(0), 97 );
+a_string = ""; // empty
+check_equals (a_string.substring(0, 1), "");
+
+// Test String.length not being overridable
+a_string = "1234567890";
+check_equals(a_string.length, 10);
+a_string.length = 4;
+check_equals(a_string.length, 10);
+check_equals(a_string, "1234567890");
+
+
+//----------------------------------------------------
+// Test automatic string conversion when adding stuff
+//-----------------------------------------------------
+a = "one";
+b = "two";
+check_equals(a+b, "onetwo");
+c = new Object();
+
+check_equals(b+c, "two[object Object]");
+
+// check that calls to toString() use the current environment
+c.toString = function() { return a; };
+prevToStringFunc = c.toString;
+check_equals(b+c, "twoone");
+
+// this won't be used as a valid toString method !
+c.toString = function() { return 4; };
+#if OUTPUT_VERSION >= 6
+check(c.toString != prevToStringFunc);
+#endif
+check_equals(b+c, "two[type Object]");
+
+ObjectProtoToStringBackup = Object.prototype.toString;
+Object.prototype.toString = undefined;
+check_equals(typeof(c.toString), 'function');
+check_equals(b+c, "two[type Object]");
+Object.prototype.toString = ObjectProtoToStringBackup;
+
+c.toString = undefined;
+check_equals(typeof(c.toString), 'undefined');
+check_equals(b+c, "two[type Object]");
+
+stringObject = new String("1234");
+check_equals(typeof(stringObject.valueOf), 'function');
+check_equals(stringObject.valueOf, String.prototype.valueOf);
+
+#if OUTPUT_VERSION > 5
+check(stringObject.valueOf != Object.prototype.valueOf);
+check(String.prototype.hasOwnProperty('valueOf'));
+#endif
+
+check_equals(typeof(stringObject.valueOf()), 'string');
+check_equals(stringObject, "1234");
+check_equals(stringObject, 1234);
+check_equals(1234, stringObject);
+numberObject = new Number(1234);
+#if OUTPUT_VERSION >= 6
+check(stringObject != numberObject);
+#else
+check_equals(stringObject, numberObject); // SWF5 always converts to primitive before comparison !!
+#endif
+check_equals(numberObject.toString(), stringObject);
+check_equals(numberObject.toString(), stringObject.toString());
+
+//----------------------------------------------------------------------
+// Drop the toString method of a string (also a test for ASSetPropFlags)
+//----------------------------------------------------------------------
+
+s = new String("a");
+check_equals(typeof(Object.prototype.toString), 'function');
+check_equals(typeof(s.toString), 'function');
+check(! delete String.prototype.toString);
+ASSetPropFlags(String.prototype, "toString", 0, 2); // unprotect from deletion
+StringProtoToStringBackup = String.prototype.toString;
+check(delete String.prototype.toString);
+check_equals(typeof(s.toString), 'function');
+check(!delete Object.prototype.toString);
+ASSetPropFlags(Object.prototype, "toString", 0, 2); // unprotect from deletion
+ObjectProtoToStringBackup = Object.prototype.toString;
+check(delete Object.prototype.toString);
+check_equals(typeof(s.toString), 'undefined');
+Object.prototype.toString = ObjectProtoToStringBackup;
+String.prototype.toString = StringProtoToStringBackup;
+
+//----------------------------------------------------------------------
+// Test concatenation of string objects
+//----------------------------------------------------------------------
+
+s = new String("hello");
+r = "s:"+s;
+check_equals(r, "s:hello");
+
+s = new String("");
+r = "s:"+s;
+check_equals(r, "s:");
+
+//----------------------------------------------------------------------
+// Test the 'length' property
+//----------------------------------------------------------------------
+
+a = "123";
+check_equals(a.length, 3);
+a.length = 2;
+check_equals(a.length, 3); // well, it's a string after all, not an object
+a = new String("123");
+check_equals(a.length, 3);
+a.length = 2;
+check_equals(a.length, 2); // can override
+check_equals(a, "123"); // not changing the actual string
+a.length = "another string";
+check_equals(a.length, "another string"); // can also be of a different type
+delete a["length"];
+check_equals(a.length, "another string"); // can't be deleted
+#if OUTPUT_VERSION > 5
+ check(a.hasOwnProperty('length'));
+#endif
+
+//----------------------------------------------------------------------
+// Test that __proto__ is only hidden, but still existing , in SWF5
+//----------------------------------------------------------------------
+
+a=new Array(); for (v in String) a.push(v); a.sort();
+#if OUTPUT_VERSION > 5
+ check_equals(a.toString(), "toString");
+#else
+ check_equals(a.length, 0);
+#endif
+
+ASSetPropFlags(String, "__proto__", 0, 128); // unhide String.__proto__
+
+a=new Array(); for (v in String) a.push(v); a.sort();
+check_equals(a.toString(), "toString");
+
+check_equals(typeof(String.__proto__), 'object');
+check_equals(typeof(Object.prototype), 'object');
+Object.prototype.gotcha = 1;
+check_equals(String.gotcha, 1);
+ASSetPropFlags(Object.prototype, "hasOwnProperty", 0, 128); // unhide Object.prototype.hasOwnProperty
+check(!String.__proto__.hasOwnProperty("gotcha"));
+check(String.__proto__.__proto__.hasOwnProperty("gotcha")); // function
+check_equals(String.__proto__.__proto__, Object.prototype); // hasOwnProperty doesn't exist in gnash !
+
+a=new Array(); for (v in String) a.push(v); a.sort();
+check_equals(a.toString(), "gotcha,toString");
+
+#if OUTPUT_VERSION == 5
+// This here to avoid changing SWF5 String properties
+// before testing them.
+
+String.prototype.hasOwnProperty = ASnative(101, 5);
+String.hasOwnProperty = ASnative(101, 5);
+
+check(!String.hasOwnProperty('toString'));
+check(!String.hasOwnProperty('valueOf'));
+check(String.hasOwnProperty('__proto__'));
+check(String.hasOwnProperty('fromCharCode'));
+
+check(String.prototype.hasOwnProperty('valueOf'));
+check(String.prototype.hasOwnProperty('toString'));
+check(String.prototype.hasOwnProperty('toUpperCase'));
+check(String.prototype.hasOwnProperty('toLowerCase'));
+check(String.prototype.hasOwnProperty('charAt'));
+check(String.prototype.hasOwnProperty('charCodeAt'));
+check(String.prototype.hasOwnProperty('concat'));
+check(String.prototype.hasOwnProperty('indexOf'));
+check(String.prototype.hasOwnProperty('lastIndexOf'));
+check(String.prototype.hasOwnProperty('slice'));
+check(String.prototype.hasOwnProperty('substring'));
+check(String.prototype.hasOwnProperty('split'));
+check(String.prototype.hasOwnProperty('substr'));
+check(!String.prototype.hasOwnProperty('length'));
+
+#endif
+
+#if OUTPUT_VERSION < 6
+ check_totals(258);
+#else
+ check_totals(274);
+#endif
diff --git a/test/gnash/actionscript.all/pending/String-5.swf b/test/gnash/actionscript.all/pending/String-5.swf
deleted file mode 100644
index 2d3c57b..0000000
Binary files a/test/gnash/actionscript.all/pending/String-5.swf and /dev/null differ
diff --git a/test/gnash/actionscript.all/pending/String-5.swf.trace b/test/gnash/actionscript.all/pending/String-5.swf.trace
deleted file mode 100644
index c3d4e6d..0000000
--- a/test/gnash/actionscript.all/pending/String-5.swf.trace
+++ /dev/null
@@ -1,259 +0,0 @@
-PASSED: typeof(String) == 'function' [String.as:23]
-PASSED: typeof(String.prototype) == 'object' [String.as:24]
-PASSED: String.__proto__ == Function.prototype [String.as:25]
-PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
-PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
-PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
-PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
-PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
-PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
-PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
-PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
-PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
-PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
-PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
-PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
-PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
-PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
-PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
-PASSED: typeof(String.valueOf) == 'undefined' [String.as:45]
-PASSED: typeof(String.toString) == 'undefined' [String.as:46]
-PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
-PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
-PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
-PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
-PASSED: typeof(String.concat) == 'undefined' [String.as:52]
-PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
-PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
-PASSED: typeof(String.slice) == 'undefined' [String.as:55]
-PASSED: typeof(String.substring) == 'undefined' [String.as:56]
-PASSED: typeof(String.split) == 'undefined' [String.as:57]
-PASSED: typeof(String.substr) == 'undefined' [String.as:58]
-PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
-PASSED: typeof(String()) == 'string' [String.as:86]
-PASSED: a.length == 20 [String.as:90]
-PASSED: typeof(a) == 'object' [String.as:94]
-PASSED: a instanceof String [String.as:95]
-PASSED: a instanceof Object [String.as:96]
-PASSED: a.charCodeAt(0) == 119 [String.as:97]
-PASSED: a.charCodeAt(1) == 97 [String.as:98]
-PASSED: a.charCodeAt(2) == 108 [String.as:99]
-PASSED: a.charCodeAt(3) == 108 [String.as:100]
-PASSED: a.charCodeAt(4) == 97 [String.as:101]
-PASSED: a.charAt(0) == "w" [String.as:102]
-PASSED: a.charAt(1) == "a" [String.as:103]
-PASSED: a.charAt(2) == "l" [String.as:104]
-PASSED: a.charAt(3) == "l" [String.as:105]
-PASSED: a.charAt(4) == "a" [String.as:106]
-PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
-PASSED: a.indexOf("lawa") == 3 [String.as:118]
-PASSED: a.indexOf("lawas") == 8 [String.as:119]
-PASSED: a.indexOf("hinG") == 13 [String.as:120]
-PASSED: a.indexOf("hing") == -1 [String.as:121]
-PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
-PASSED: a.indexOf("a", 2) == 4 [String.as:123]
-PASSED: a.indexOf("a", -1) == 1 [String.as:124]
-PASSED: a.indexOf("a", -2) == 1 [String.as:125]
-PASSED: a.indexOf("l") == 2 [String.as:126]
-PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
-PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
-PASSED: a.indexOf("l", 3) == 3 [String.as:129]
-PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
-PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
-PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
-PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
-PASSED: a.indexOf("l", -4) == 2 [String.as:134]
-PASSED: a.indexOf("a", o) == 4 [String.as:136]
-PASSED: a.indexOf(o2, o) == 4 [String.as:138]
-PASSED: typeof(a.split) == 'function' [String.as:145]
-PASSED: ! a.hasOwnProperty('split') [String.as:146]
-PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
-PASSED: a.split().length == 1 [String.as:153]
-PASSED: a.split() instanceof Array [String.as:154]
-PASSED: a.split("w").length == 4 [String.as:155]
-PASSED: a.split(" w").length == 1 [String.as:156]
-PASSED: a.split("")[0] == "wallawallawashinGTON" [String.as:176]
-PASSED: a.split("")[19] == undefined [String.as:177]
-PASSED: a.split("la")[0] == "wallawallawashinGTON" [String.as:179]
-PASSED: a.split("la")[1] == undefined [String.as:180]
-PASSED: a.split("la")[2] == undefined [String.as:181]
-PASSED: a.split("la").length == 1 [String.as:182]
-PASSED: typeof(ret) == 'object' [String.as:189]
-PASSED: ret.length == 1 [String.as:190]
-PASSED: typeof(ret[0]) == 'string' [String.as:191]
-PASSED: ret[0] == '' [String.as:192]
-PASSED: ret.length == 0 [String.as:196]
-PASSED: ret.length == 0 [String.as:202]
-PASSED: ret.length == 1 [String.as:207]
-PASSED: ret.length == 1 [String.as:209]
-PASSED: typeof(ret) == 'object' [String.as:213]
-PASSED: ret.length == 1 [String.as:214]
-PASSED: typeof(ret[0]) == 'string' [String.as:215]
-PASSED: ret[0] == 'abcde' [String.as:216]
-PASSED: g.length == 1 [String.as:225]
-PASSED: typeof(g[0]) == "string" [String.as:226]
-PASSED: g[0] == "" [String.as:227]
-PASSED: g.length == 0 [String.as:237]
-PASSED: typeof(g[0]) == "undefined" [String.as:238]
-PASSED: g[0] == undefined [String.as:239]
-PASSED: g.length == 1 [String.as:244]
-PASSED: typeof(g[0]) == "string" [String.as:245]
-PASSED: g[0] == "" [String.as:246]
-PASSED: g.length == 1 [String.as:255]
-PASSED: typeof(g[0]) == "string" [String.as:256]
-PASSED: g[0] == "f" [String.as:257]
-PASSED: g.length == 0 [String.as:263]
-PASSED: typeof(g[0]) == "undefined" [String.as:264]
-PASSED: g[0] == undefined [String.as:265]
-PASSED: g.length == 1 [String.as:269]
-PASSED: typeof(g[0]) == "string" [String.as:270]
-PASSED: g[0] == "f" [String.as:271]
-PASSED: b == "abcd" [String.as:282]
-PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
-PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
-PASSED: a.substr(5,2) == "fg" [String.as:298]
-PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
-PASSED: a.substr(-1,1) == "z" [String.as:300]
-PASSED: a.substr(-2,3) == "yz" [String.as:301]
-PASSED: a.substr(-3,2) == "xy" [String.as:302]
-PASSED: b.substr(3, 6) == "4" [String.as:304]
-PASSED: a.slice(-5,-3) == "vw" [String.as:312]
-PASSED: typeof(a.slice()) == "undefined" [String.as:313]
-PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
-PASSED: a.slice(-5,3) == "" [String.as:315]
-PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
-PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
-PASSED: a.slice(0,0) == "" [String.as:318]
-PASSED: a.slice(0,1) == "a" [String.as:319]
-PASSED: a.slice(1,1) == "" [String.as:320]
-PASSED: a.slice(1,2) == "b" [String.as:321]
-PASSED: a.slice.call(a, -5, -3) == undefined [String.as:328]
-PASSED: String.prototype.slice.call(a, -5, -3) == undefined [String.as:329]
-PASSED: a.slice(-4) == "wxyz" [String.as:331]
-PASSED: a.substring(5,2) == "cde" [String.as:339]
-PASSED: a.substring(5,7) == "fg" [String.as:340]
-PASSED: a.substring(3,3) == "" [String.as:341]
-PASSED: a.length == 26 [String.as:343]
-PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
-PASSED: b.substring(3, 6) == "4" [String.as:347]
-PASSED: chr(0) == "" [String.as:354]
-PASSED: chr(65) == "A" [String.as:355]
-PASSED: ord("A") == 65 [String.as:356]
-PASSED: ord("") == 0 [String.as:357]
-PASSED: typeof(chr(486)) == 'string' [String.as:367]
-PASSED: chr(865) == "a" [String.as:368]
-PASSED: ord("ö") == 195 [String.as:369]
-PASSED: ord("ÃÂ") == 195 [String.as:370]
-PASSED: ord("õ") == 199 [String.as:371]
-PASSED: ord("æ") == 207 [String.as:372]
-XPASSED: c == 199 [String.as:395]
-XPASSED: c == 207 [String.as:411]
-PASSED: typeof(c) == "string" [String.as:429]
-PASSED: typeof(c) == "string" [String.as:448]
-PASSED: a.length == 16 [String.as:469]
-PASSED: a.slice(3,5) == "ng" [String.as:470]
-PASSED: a.charCodeAt(10) == 195 [String.as:471]
-PASSED: b == "iao" [String.as:494]
-PASSED: b == "oowa" [String.as:504]
-PASSED: b == "c" [String.as:513]
-PASSED: b == "ciao" [String.as:522]
-PASSED: b == "c" [String.as:531]
-PASSED: b == "" [String.as:540]
-PASSED: b == "l" [String.as:549]
-PASSED: b == "f" [String.as:559]
-PASSED: b == "" [String.as:569]
-PASSED: count1 == 225 [String.as:605]
-PASSED: count2 == 225 [String.as:606]
-PASSED: b == "iao" [String.as:626]
-PASSED: b == "oowa" [String.as:636]
-PASSED: b == "c" [String.as:645]
-PASSED: b == "ciao" [String.as:654]
-PASSED: b == "c" [String.as:663]
-PASSED: b == "" [String.as:672]
-PASSED: b == "l" [String.as:681]
-PASSED: b == "f" [String.as:691]
-PASSED: stringInstance.__proto__ != undefined [String.as:700]
-PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
-PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
-PASSED: String.prototype.constructor == String [String.as:703]
-PASSED: stringInstance.__proto__.constructor == String [String.as:704]
-PASSED: stringInstance instanceof String [String.as:707]
-PASSED: ! "literal string" instanceof String [String.as:708]
-PASSED: typeof(a_string) == "string" [String.as:714]
-PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
-PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
-PASSED: a_string.substring(0, -1) == "" [String.as:717]
-PASSED: a_string.substring(0, 1) == "a" [String.as:718]
-PASSED: a_string.substring(4) == "ring" [String.as:719]
-PASSED: a_string.substring(16) == "" [String.as:720]
-PASSED: a_string.substring(-16) == "a_string" [String.as:721]
-PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
-PASSED: a_string.indexOf("hing") == -1 [String.as:723]
-PASSED: a_string.indexOf("string") == 2 [String.as:724]
-PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
-PASSED: a_string.substring(0, 1) == "" [String.as:727]
-PASSED: a_string.length == 10 [String.as:731]
-PASSED: a_string.length == 10 [String.as:733]
-PASSED: a_string == "1234567890" [String.as:734]
-PASSED: a+b == "onetwo" [String.as:742]
-PASSED: b+c == "two[object Object]" [String.as:745]
-PASSED: b+c == "twoone" [String.as:750]
-PASSED: b+c == "two[type Object]" [String.as:757]
-PASSED: typeof(c.toString) == 'function' [String.as:761]
-PASSED: b+c == "two[type Object]" [String.as:762]
-PASSED: typeof(c.toString) == 'undefined' [String.as:766]
-PASSED: b+c == "two[type Object]" [String.as:767]
-PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
-PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
-PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
-PASSED: stringObject == "1234" [String.as:779]
-PASSED: stringObject == 1234 [String.as:780]
-PASSED: 1234 == stringObject [String.as:781]
-PASSED: stringObject == numberObject [String.as:786]
-PASSED: numberObject.toString() == stringObject [String.as:788]
-PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
-PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
-PASSED: typeof(s.toString) == 'function' [String.as:797]
-PASSED: ! delete String.prototype.toString [String.as:798]
-PASSED: delete String.prototype.toString [String.as:801]
-PASSED: typeof(s.toString) == 'function' [String.as:802]
-PASSED: !delete Object.prototype.toString [String.as:803]
-PASSED: delete Object.prototype.toString [String.as:806]
-PASSED: typeof(s.toString) == 'undefined' [String.as:807]
-PASSED: r == "s:hello" [String.as:817]
-PASSED: r == "s:" [String.as:821]
-PASSED: a.length == 3 [String.as:828]
-PASSED: a.length == 3 [String.as:830]
-PASSED: a.length == 3 [String.as:832]
-PASSED: a.length == 2 [String.as:834]
-PASSED: a == "123" [String.as:835]
-PASSED: a.length == "another string" [String.as:837]
-PASSED: a.length == "another string" [String.as:839]
-PASSED: a.length == 0 [String.as:852]
-PASSED: a.toString() == "toString" [String.as:858]
-PASSED: typeof(String.__proto__) == 'object' [String.as:860]
-PASSED: typeof(Object.prototype) == 'object' [String.as:861]
-PASSED: String.gotcha == 1 [String.as:863]
-PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
-PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
-PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
-PASSED: a.toString() == "gotcha,toString" [String.as:870]
-PASSED: !String.hasOwnProperty('toString') [String.as:879]
-PASSED: !String.hasOwnProperty('valueOf') [String.as:880]
-PASSED: String.hasOwnProperty('__proto__') [String.as:881]
-PASSED: String.hasOwnProperty('fromCharCode') [String.as:882]
-PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:884]
-PASSED: String.prototype.hasOwnProperty('toString') [String.as:885]
-PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:886]
-PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:887]
-PASSED: String.prototype.hasOwnProperty('charAt') [String.as:888]
-PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:889]
-PASSED: String.prototype.hasOwnProperty('concat') [String.as:890]
-PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:891]
-PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:892]
-PASSED: String.prototype.hasOwnProperty('slice') [String.as:893]
-PASSED: String.prototype.hasOwnProperty('substring') [String.as:894]
-PASSED: String.prototype.hasOwnProperty('split') [String.as:895]
-PASSED: String.prototype.hasOwnProperty('substr') [String.as:896]
-PASSED: !String.prototype.hasOwnProperty('length') [String.as:897]
-check_totals: 258
diff --git a/test/gnash/actionscript.all/pending/String-6.swf b/test/gnash/actionscript.all/pending/String-6.swf
deleted file mode 100644
index 487b92f..0000000
Binary files a/test/gnash/actionscript.all/pending/String-6.swf and /dev/null differ
diff --git a/test/gnash/actionscript.all/pending/String-6.swf.trace b/test/gnash/actionscript.all/pending/String-6.swf.trace
deleted file mode 100644
index 2e45190..0000000
--- a/test/gnash/actionscript.all/pending/String-6.swf.trace
+++ /dev/null
@@ -1,275 +0,0 @@
-PASSED: typeof(String) == 'function' [String.as:23]
-PASSED: typeof(String.prototype) == 'object' [String.as:24]
-PASSED: String.__proto__ == Function.prototype [String.as:25]
-PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
-PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
-PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
-PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
-PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
-PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
-PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
-PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
-PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
-PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
-PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
-PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
-PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
-PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
-PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
-PASSED: typeof(String.valueOf) == 'function' [String.as:42]
-PASSED: typeof(String.toString) == 'function' [String.as:43]
-PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
-PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
-PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
-PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
-PASSED: typeof(String.concat) == 'undefined' [String.as:52]
-PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
-PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
-PASSED: typeof(String.slice) == 'undefined' [String.as:55]
-PASSED: typeof(String.substring) == 'undefined' [String.as:56]
-PASSED: typeof(String.split) == 'undefined' [String.as:57]
-PASSED: typeof(String.substr) == 'undefined' [String.as:58]
-PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
-PASSED: String.hasOwnProperty('fromCharCode') [String.as:65]
-PASSED: !String.hasOwnProperty('toString') [String.as:66]
-PASSED: !String.hasOwnProperty('valueOf') [String.as:67]
-PASSED: String.hasOwnProperty('__proto__') [String.as:68]
-PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:69]
-PASSED: String.prototype.hasOwnProperty('toString') [String.as:70]
-PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:71]
-PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:72]
-PASSED: String.prototype.hasOwnProperty('charAt') [String.as:73]
-PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:74]
-PASSED: String.prototype.hasOwnProperty('concat') [String.as:75]
-PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:76]
-PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:77]
-PASSED: String.prototype.hasOwnProperty('slice') [String.as:78]
-PASSED: String.prototype.hasOwnProperty('substring') [String.as:79]
-PASSED: String.prototype.hasOwnProperty('split') [String.as:80]
-PASSED: String.prototype.hasOwnProperty('substr') [String.as:81]
-PASSED: !String.prototype.hasOwnProperty('length') [String.as:82]
-PASSED: typeof(String()) == 'string' [String.as:86]
-PASSED: a.length == 20 [String.as:90]
-PASSED: a.hasOwnProperty('length') [String.as:92]
-PASSED: typeof(a) == 'object' [String.as:94]
-PASSED: a instanceof String [String.as:95]
-PASSED: a instanceof Object [String.as:96]
-PASSED: a.charCodeAt(0) == 119 [String.as:97]
-PASSED: a.charCodeAt(1) == 97 [String.as:98]
-PASSED: a.charCodeAt(2) == 108 [String.as:99]
-PASSED: a.charCodeAt(3) == 108 [String.as:100]
-PASSED: a.charCodeAt(4) == 97 [String.as:101]
-PASSED: a.charAt(0) == "w" [String.as:102]
-PASSED: a.charAt(1) == "a" [String.as:103]
-PASSED: a.charAt(2) == "l" [String.as:104]
-PASSED: a.charAt(3) == "l" [String.as:105]
-PASSED: a.charAt(4) == "a" [String.as:106]
-PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
-PASSED: a.indexOf("lawa") == 3 [String.as:118]
-PASSED: a.indexOf("lawas") == 8 [String.as:119]
-PASSED: a.indexOf("hinG") == 13 [String.as:120]
-PASSED: a.indexOf("hing") == -1 [String.as:121]
-PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
-PASSED: a.indexOf("a", 2) == 4 [String.as:123]
-PASSED: a.indexOf("a", -1) == 1 [String.as:124]
-PASSED: a.indexOf("a", -2) == 1 [String.as:125]
-PASSED: a.indexOf("l") == 2 [String.as:126]
-PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
-PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
-PASSED: a.indexOf("l", 3) == 3 [String.as:129]
-PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
-PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
-PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
-PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
-PASSED: a.indexOf("l", -4) == 2 [String.as:134]
-PASSED: a.indexOf("a", o) == 4 [String.as:136]
-PASSED: a.indexOf(o2, o) == 4 [String.as:138]
-PASSED: typeof(a.split) == 'function' [String.as:145]
-PASSED: ! a.hasOwnProperty('split') [String.as:146]
-PASSED: a.__proto__.hasOwnProperty('split') [String.as:148]
-PASSED: a.__proto__ == String.prototype [String.as:149]
-PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
-PASSED: a.split().length == 1 [String.as:153]
-PASSED: a.split() instanceof Array [String.as:154]
-PASSED: a.split("w").length == 4 [String.as:155]
-PASSED: a.split(" w").length == 1 [String.as:156]
-PASSED: typeof(ret) == 'object' [String.as:161]
-PASSED: ret instanceof Array [String.as:162]
-PASSED: ret.length == 20 [String.as:163]
-PASSED: ret[0] == "w" [String.as:164]
-PASSED: ret[1] == "a" [String.as:165]
-PASSED: ret[2] == "l" [String.as:166]
-PASSED: ret[3] == "l" [String.as:167]
-PASSED: ret[18] == "O" [String.as:168]
-PASSED: ret[19] == "N" [String.as:169]
-PASSED: a.split("la")[0] == "wal" [String.as:170]
-PASSED: a.split("la")[1] == "wal" [String.as:171]
-PASSED: a.split("la")[2] == "washinGTON" [String.as:172]
-PASSED: a.split("la").length == 3 [String.as:173]
-PASSED: typeof(ret) == 'object' [String.as:189]
-PASSED: ret.length == 1 [String.as:190]
-PASSED: typeof(ret[0]) == 'string' [String.as:191]
-PASSED: ret[0] == '' [String.as:192]
-PASSED: ret.length == 1 [String.as:198]
-PASSED: ret.length == 1 [String.as:204]
-PASSED: ret.length == 1 [String.as:207]
-PASSED: ret.length == 1 [String.as:209]
-PASSED: typeof(ret) == 'object' [String.as:213]
-PASSED: ret.length == 1 [String.as:214]
-PASSED: typeof(ret[0]) == 'string' [String.as:215]
-PASSED: ret[0] == 'abcde' [String.as:216]
-XPASSED: g.length == 0 [String.as:221]
-XPASSED: typeof(g[0]) == "undefined" [String.as:222]
-XPASSED: g[0] == undefined [String.as:223]
-PASSED: g.length == 1 [String.as:233]
-PASSED: typeof(g[0]) == "string" [String.as:234]
-PASSED: g[0] == "" [String.as:235]
-PASSED: g.length == 1 [String.as:244]
-PASSED: typeof(g[0]) == "string" [String.as:245]
-PASSED: g[0] == "" [String.as:246]
-PASSED: g.length == 0 [String.as:251]
-PASSED: typeof(g[0]) == "undefined" [String.as:252]
-PASSED: g[0] == undefined [String.as:253]
-PASSED: g.length == 0 [String.as:263]
-PASSED: typeof(g[0]) == "undefined" [String.as:264]
-PASSED: g[0] == undefined [String.as:265]
-PASSED: g.length == 1 [String.as:269]
-PASSED: typeof(g[0]) == "string" [String.as:270]
-PASSED: g[0] == "f" [String.as:271]
-PASSED: b == "abcd" [String.as:282]
-PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
-PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
-PASSED: a.substr(5,2) == "fg" [String.as:298]
-PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
-PASSED: a.substr(-1,1) == "z" [String.as:300]
-PASSED: a.substr(-2,3) == "yz" [String.as:301]
-PASSED: a.substr(-3,2) == "xy" [String.as:302]
-PASSED: b.substr(3, 6) == "4" [String.as:304]
-PASSED: a.slice(-5,-3) == "vw" [String.as:312]
-PASSED: typeof(a.slice()) == "undefined" [String.as:313]
-PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
-PASSED: a.slice(-5,3) == "" [String.as:315]
-PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
-PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
-PASSED: a.slice(0,0) == "" [String.as:318]
-PASSED: a.slice(0,1) == "a" [String.as:319]
-PASSED: a.slice(1,1) == "" [String.as:320]
-PASSED: a.slice(1,2) == "b" [String.as:321]
-PASSED: a.slice.call(a, -5, -3) == "vw" [String.as:323]
-PASSED: String.prototype.slice.call(a, -5, -3) == "vw" [String.as:324]
-PASSED: a.slice(-4) == "wxyz" [String.as:331]
-PASSED: a.substring(5,2) == "cde" [String.as:339]
-PASSED: a.substring(5,7) == "fg" [String.as:340]
-PASSED: a.substring(3,3) == "" [String.as:341]
-PASSED: a.length == 26 [String.as:343]
-PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
-PASSED: b.substring(3, 6) == "4" [String.as:347]
-PASSED: chr(0) == "" [String.as:354]
-PASSED: chr(65) == "A" [String.as:355]
-PASSED: ord("A") == 65 [String.as:356]
-PASSED: ord("") == 0 [String.as:357]
-PASSED: chr(246) == "ö" [String.as:361]
-PASSED: chr(486) == "Ǧ" [String.as:362]
-PASSED: chr(998) == "Ϧ" [String.as:363]
-PASSED: ord("ö") == 246 [String.as:364]
-PASSED: ord("Ϧ") == 998 [String.as:365]
-PASSED: c == 486 [String.as:393]
-PASSED: c == 998 [String.as:409]
-PASSED: c == "Ϧ" [String.as:427]
-PASSED: c == "å¾" [String.as:446]
-PASSED: a.length == 14 [String.as:462]
-PASSED: a.substring(2,4) == "ng" [String.as:463]
-PASSED: a.charAt(1) == "ä" [String.as:464]
-PASSED: a.charAt(2) == "n" [String.as:465]
-PASSED: a.slice(3,5) == "ge" [String.as:466]
-PASSED: a.charCodeAt(9) == 246 [String.as:467]
-PASSED: b == "iao" [String.as:494]
-PASSED: b == "oowa" [String.as:504]
-PASSED: b == "c" [String.as:513]
-PASSED: b == "ciao" [String.as:522]
-PASSED: b == "c" [String.as:531]
-PASSED: b == "" [String.as:540]
-PASSED: b == "l" [String.as:549]
-PASSED: b == "f" [String.as:559]
-PASSED: b == "" [String.as:569]
-PASSED: count1 == 225 [String.as:605]
-PASSED: count2 == 225 [String.as:606]
-PASSED: b == "iao" [String.as:626]
-PASSED: b == "oowa" [String.as:636]
-PASSED: b == "c" [String.as:645]
-PASSED: b == "ciao" [String.as:654]
-PASSED: b == "c" [String.as:663]
-PASSED: b == "" [String.as:672]
-PASSED: b == "l" [String.as:681]
-PASSED: b == "f" [String.as:691]
-PASSED: stringInstance.__proto__ != undefined [String.as:700]
-PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
-PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
-PASSED: String.prototype.constructor == String [String.as:703]
-PASSED: stringInstance.__proto__.constructor == String [String.as:704]
-PASSED: stringInstance instanceof String [String.as:707]
-PASSED: ! "literal string" instanceof String [String.as:708]
-PASSED: typeof(a_string) == "string" [String.as:714]
-PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
-PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
-PASSED: a_string.substring(0, -1) == "" [String.as:717]
-PASSED: a_string.substring(0, 1) == "a" [String.as:718]
-PASSED: a_string.substring(4) == "ring" [String.as:719]
-PASSED: a_string.substring(16) == "" [String.as:720]
-PASSED: a_string.substring(-16) == "a_string" [String.as:721]
-PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
-PASSED: a_string.indexOf("hing") == -1 [String.as:723]
-PASSED: a_string.indexOf("string") == 2 [String.as:724]
-PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
-PASSED: a_string.substring(0, 1) == "" [String.as:727]
-PASSED: a_string.length == 10 [String.as:731]
-PASSED: a_string.length == 10 [String.as:733]
-PASSED: a_string == "1234567890" [String.as:734]
-PASSED: a+b == "onetwo" [String.as:742]
-PASSED: b+c == "two[object Object]" [String.as:745]
-PASSED: b+c == "twoone" [String.as:750]
-PASSED: c.toString != prevToStringFunc [String.as:755]
-PASSED: b+c == "two[type Object]" [String.as:757]
-PASSED: typeof(c.toString) == 'function' [String.as:761]
-PASSED: b+c == "two[type Object]" [String.as:762]
-PASSED: typeof(c.toString) == 'undefined' [String.as:766]
-PASSED: b+c == "two[type Object]" [String.as:767]
-PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
-PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
-PASSED: stringObject.valueOf != Object.prototype.valueOf [String.as:774]
-PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:775]
-PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
-PASSED: stringObject == "1234" [String.as:779]
-PASSED: stringObject == 1234 [String.as:780]
-PASSED: 1234 == stringObject [String.as:781]
-PASSED: stringObject != numberObject [String.as:784]
-PASSED: numberObject.toString() == stringObject [String.as:788]
-PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
-PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
-PASSED: typeof(s.toString) == 'function' [String.as:797]
-PASSED: ! delete String.prototype.toString [String.as:798]
-PASSED: delete String.prototype.toString [String.as:801]
-PASSED: typeof(s.toString) == 'function' [String.as:802]
-PASSED: !delete Object.prototype.toString [String.as:803]
-PASSED: delete Object.prototype.toString [String.as:806]
-PASSED: typeof(s.toString) == 'undefined' [String.as:807]
-PASSED: r == "s:hello" [String.as:817]
-PASSED: r == "s:" [String.as:821]
-PASSED: a.length == 3 [String.as:828]
-PASSED: a.length == 3 [String.as:830]
-PASSED: a.length == 3 [String.as:832]
-PASSED: a.length == 2 [String.as:834]
-PASSED: a == "123" [String.as:835]
-PASSED: a.length == "another string" [String.as:837]
-PASSED: a.length == "another string" [String.as:839]
-PASSED: a.hasOwnProperty('length') [String.as:841]
-PASSED: a.toString() == "toString" [String.as:850]
-PASSED: a.toString() == "toString" [String.as:858]
-PASSED: typeof(String.__proto__) == 'object' [String.as:860]
-PASSED: typeof(Object.prototype) == 'object' [String.as:861]
-PASSED: String.gotcha == 1 [String.as:863]
-PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
-PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
-PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
-PASSED: a.toString() == "gotcha,toString" [String.as:870]
-check_totals: 274
diff --git a/test/gnash/actionscript.all/pending/String-7.swf b/test/gnash/actionscript.all/pending/String-7.swf
deleted file mode 100644
index f7ab72e..0000000
Binary files a/test/gnash/actionscript.all/pending/String-7.swf and /dev/null differ
diff --git a/test/gnash/actionscript.all/pending/String-7.swf.trace b/test/gnash/actionscript.all/pending/String-7.swf.trace
deleted file mode 100644
index 2e45190..0000000
--- a/test/gnash/actionscript.all/pending/String-7.swf.trace
+++ /dev/null
@@ -1,275 +0,0 @@
-PASSED: typeof(String) == 'function' [String.as:23]
-PASSED: typeof(String.prototype) == 'object' [String.as:24]
-PASSED: String.__proto__ == Function.prototype [String.as:25]
-PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
-PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
-PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
-PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
-PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
-PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
-PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
-PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
-PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
-PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
-PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
-PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
-PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
-PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
-PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
-PASSED: typeof(String.valueOf) == 'function' [String.as:42]
-PASSED: typeof(String.toString) == 'function' [String.as:43]
-PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
-PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
-PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
-PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
-PASSED: typeof(String.concat) == 'undefined' [String.as:52]
-PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
-PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
-PASSED: typeof(String.slice) == 'undefined' [String.as:55]
-PASSED: typeof(String.substring) == 'undefined' [String.as:56]
-PASSED: typeof(String.split) == 'undefined' [String.as:57]
-PASSED: typeof(String.substr) == 'undefined' [String.as:58]
-PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
-PASSED: String.hasOwnProperty('fromCharCode') [String.as:65]
-PASSED: !String.hasOwnProperty('toString') [String.as:66]
-PASSED: !String.hasOwnProperty('valueOf') [String.as:67]
-PASSED: String.hasOwnProperty('__proto__') [String.as:68]
-PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:69]
-PASSED: String.prototype.hasOwnProperty('toString') [String.as:70]
-PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:71]
-PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:72]
-PASSED: String.prototype.hasOwnProperty('charAt') [String.as:73]
-PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:74]
-PASSED: String.prototype.hasOwnProperty('concat') [String.as:75]
-PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:76]
-PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:77]
-PASSED: String.prototype.hasOwnProperty('slice') [String.as:78]
-PASSED: String.prototype.hasOwnProperty('substring') [String.as:79]
-PASSED: String.prototype.hasOwnProperty('split') [String.as:80]
-PASSED: String.prototype.hasOwnProperty('substr') [String.as:81]
-PASSED: !String.prototype.hasOwnProperty('length') [String.as:82]
-PASSED: typeof(String()) == 'string' [String.as:86]
-PASSED: a.length == 20 [String.as:90]
-PASSED: a.hasOwnProperty('length') [String.as:92]
-PASSED: typeof(a) == 'object' [String.as:94]
-PASSED: a instanceof String [String.as:95]
-PASSED: a instanceof Object [String.as:96]
-PASSED: a.charCodeAt(0) == 119 [String.as:97]
-PASSED: a.charCodeAt(1) == 97 [String.as:98]
-PASSED: a.charCodeAt(2) == 108 [String.as:99]
-PASSED: a.charCodeAt(3) == 108 [String.as:100]
-PASSED: a.charCodeAt(4) == 97 [String.as:101]
-PASSED: a.charAt(0) == "w" [String.as:102]
-PASSED: a.charAt(1) == "a" [String.as:103]
-PASSED: a.charAt(2) == "l" [String.as:104]
-PASSED: a.charAt(3) == "l" [String.as:105]
-PASSED: a.charAt(4) == "a" [String.as:106]
-PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
-PASSED: a.indexOf("lawa") == 3 [String.as:118]
-PASSED: a.indexOf("lawas") == 8 [String.as:119]
-PASSED: a.indexOf("hinG") == 13 [String.as:120]
-PASSED: a.indexOf("hing") == -1 [String.as:121]
-PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
-PASSED: a.indexOf("a", 2) == 4 [String.as:123]
-PASSED: a.indexOf("a", -1) == 1 [String.as:124]
-PASSED: a.indexOf("a", -2) == 1 [String.as:125]
-PASSED: a.indexOf("l") == 2 [String.as:126]
-PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
-PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
-PASSED: a.indexOf("l", 3) == 3 [String.as:129]
-PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
-PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
-PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
-PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
-PASSED: a.indexOf("l", -4) == 2 [String.as:134]
-PASSED: a.indexOf("a", o) == 4 [String.as:136]
-PASSED: a.indexOf(o2, o) == 4 [String.as:138]
-PASSED: typeof(a.split) == 'function' [String.as:145]
-PASSED: ! a.hasOwnProperty('split') [String.as:146]
-PASSED: a.__proto__.hasOwnProperty('split') [String.as:148]
-PASSED: a.__proto__ == String.prototype [String.as:149]
-PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
-PASSED: a.split().length == 1 [String.as:153]
-PASSED: a.split() instanceof Array [String.as:154]
-PASSED: a.split("w").length == 4 [String.as:155]
-PASSED: a.split(" w").length == 1 [String.as:156]
-PASSED: typeof(ret) == 'object' [String.as:161]
-PASSED: ret instanceof Array [String.as:162]
-PASSED: ret.length == 20 [String.as:163]
-PASSED: ret[0] == "w" [String.as:164]
-PASSED: ret[1] == "a" [String.as:165]
-PASSED: ret[2] == "l" [String.as:166]
-PASSED: ret[3] == "l" [String.as:167]
-PASSED: ret[18] == "O" [String.as:168]
-PASSED: ret[19] == "N" [String.as:169]
-PASSED: a.split("la")[0] == "wal" [String.as:170]
-PASSED: a.split("la")[1] == "wal" [String.as:171]
-PASSED: a.split("la")[2] == "washinGTON" [String.as:172]
-PASSED: a.split("la").length == 3 [String.as:173]
-PASSED: typeof(ret) == 'object' [String.as:189]
-PASSED: ret.length == 1 [String.as:190]
-PASSED: typeof(ret[0]) == 'string' [String.as:191]
-PASSED: ret[0] == '' [String.as:192]
-PASSED: ret.length == 1 [String.as:198]
-PASSED: ret.length == 1 [String.as:204]
-PASSED: ret.length == 1 [String.as:207]
-PASSED: ret.length == 1 [String.as:209]
-PASSED: typeof(ret) == 'object' [String.as:213]
-PASSED: ret.length == 1 [String.as:214]
-PASSED: typeof(ret[0]) == 'string' [String.as:215]
-PASSED: ret[0] == 'abcde' [String.as:216]
-XPASSED: g.length == 0 [String.as:221]
-XPASSED: typeof(g[0]) == "undefined" [String.as:222]
-XPASSED: g[0] == undefined [String.as:223]
-PASSED: g.length == 1 [String.as:233]
-PASSED: typeof(g[0]) == "string" [String.as:234]
-PASSED: g[0] == "" [String.as:235]
-PASSED: g.length == 1 [String.as:244]
-PASSED: typeof(g[0]) == "string" [String.as:245]
-PASSED: g[0] == "" [String.as:246]
-PASSED: g.length == 0 [String.as:251]
-PASSED: typeof(g[0]) == "undefined" [String.as:252]
-PASSED: g[0] == undefined [String.as:253]
-PASSED: g.length == 0 [String.as:263]
-PASSED: typeof(g[0]) == "undefined" [String.as:264]
-PASSED: g[0] == undefined [String.as:265]
-PASSED: g.length == 1 [String.as:269]
-PASSED: typeof(g[0]) == "string" [String.as:270]
-PASSED: g[0] == "f" [String.as:271]
-PASSED: b == "abcd" [String.as:282]
-PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
-PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
-PASSED: a.substr(5,2) == "fg" [String.as:298]
-PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
-PASSED: a.substr(-1,1) == "z" [String.as:300]
-PASSED: a.substr(-2,3) == "yz" [String.as:301]
-PASSED: a.substr(-3,2) == "xy" [String.as:302]
-PASSED: b.substr(3, 6) == "4" [String.as:304]
-PASSED: a.slice(-5,-3) == "vw" [String.as:312]
-PASSED: typeof(a.slice()) == "undefined" [String.as:313]
-PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
-PASSED: a.slice(-5,3) == "" [String.as:315]
-PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
-PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
-PASSED: a.slice(0,0) == "" [String.as:318]
-PASSED: a.slice(0,1) == "a" [String.as:319]
-PASSED: a.slice(1,1) == "" [String.as:320]
-PASSED: a.slice(1,2) == "b" [String.as:321]
-PASSED: a.slice.call(a, -5, -3) == "vw" [String.as:323]
-PASSED: String.prototype.slice.call(a, -5, -3) == "vw" [String.as:324]
-PASSED: a.slice(-4) == "wxyz" [String.as:331]
-PASSED: a.substring(5,2) == "cde" [String.as:339]
-PASSED: a.substring(5,7) == "fg" [String.as:340]
-PASSED: a.substring(3,3) == "" [String.as:341]
-PASSED: a.length == 26 [String.as:343]
-PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
-PASSED: b.substring(3, 6) == "4" [String.as:347]
-PASSED: chr(0) == "" [String.as:354]
-PASSED: chr(65) == "A" [String.as:355]
-PASSED: ord("A") == 65 [String.as:356]
-PASSED: ord("") == 0 [String.as:357]
-PASSED: chr(246) == "ö" [String.as:361]
-PASSED: chr(486) == "Ǧ" [String.as:362]
-PASSED: chr(998) == "Ϧ" [String.as:363]
-PASSED: ord("ö") == 246 [String.as:364]
-PASSED: ord("Ϧ") == 998 [String.as:365]
-PASSED: c == 486 [String.as:393]
-PASSED: c == 998 [String.as:409]
-PASSED: c == "Ϧ" [String.as:427]
-PASSED: c == "å¾" [String.as:446]
-PASSED: a.length == 14 [String.as:462]
-PASSED: a.substring(2,4) == "ng" [String.as:463]
-PASSED: a.charAt(1) == "ä" [String.as:464]
-PASSED: a.charAt(2) == "n" [String.as:465]
-PASSED: a.slice(3,5) == "ge" [String.as:466]
-PASSED: a.charCodeAt(9) == 246 [String.as:467]
-PASSED: b == "iao" [String.as:494]
-PASSED: b == "oowa" [String.as:504]
-PASSED: b == "c" [String.as:513]
-PASSED: b == "ciao" [String.as:522]
-PASSED: b == "c" [String.as:531]
-PASSED: b == "" [String.as:540]
-PASSED: b == "l" [String.as:549]
-PASSED: b == "f" [String.as:559]
-PASSED: b == "" [String.as:569]
-PASSED: count1 == 225 [String.as:605]
-PASSED: count2 == 225 [String.as:606]
-PASSED: b == "iao" [String.as:626]
-PASSED: b == "oowa" [String.as:636]
-PASSED: b == "c" [String.as:645]
-PASSED: b == "ciao" [String.as:654]
-PASSED: b == "c" [String.as:663]
-PASSED: b == "" [String.as:672]
-PASSED: b == "l" [String.as:681]
-PASSED: b == "f" [String.as:691]
-PASSED: stringInstance.__proto__ != undefined [String.as:700]
-PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
-PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
-PASSED: String.prototype.constructor == String [String.as:703]
-PASSED: stringInstance.__proto__.constructor == String [String.as:704]
-PASSED: stringInstance instanceof String [String.as:707]
-PASSED: ! "literal string" instanceof String [String.as:708]
-PASSED: typeof(a_string) == "string" [String.as:714]
-PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
-PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
-PASSED: a_string.substring(0, -1) == "" [String.as:717]
-PASSED: a_string.substring(0, 1) == "a" [String.as:718]
-PASSED: a_string.substring(4) == "ring" [String.as:719]
-PASSED: a_string.substring(16) == "" [String.as:720]
-PASSED: a_string.substring(-16) == "a_string" [String.as:721]
-PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
-PASSED: a_string.indexOf("hing") == -1 [String.as:723]
-PASSED: a_string.indexOf("string") == 2 [String.as:724]
-PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
-PASSED: a_string.substring(0, 1) == "" [String.as:727]
-PASSED: a_string.length == 10 [String.as:731]
-PASSED: a_string.length == 10 [String.as:733]
-PASSED: a_string == "1234567890" [String.as:734]
-PASSED: a+b == "onetwo" [String.as:742]
-PASSED: b+c == "two[object Object]" [String.as:745]
-PASSED: b+c == "twoone" [String.as:750]
-PASSED: c.toString != prevToStringFunc [String.as:755]
-PASSED: b+c == "two[type Object]" [String.as:757]
-PASSED: typeof(c.toString) == 'function' [String.as:761]
-PASSED: b+c == "two[type Object]" [String.as:762]
-PASSED: typeof(c.toString) == 'undefined' [String.as:766]
-PASSED: b+c == "two[type Object]" [String.as:767]
-PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
-PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
-PASSED: stringObject.valueOf != Object.prototype.valueOf [String.as:774]
-PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:775]
-PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
-PASSED: stringObject == "1234" [String.as:779]
-PASSED: stringObject == 1234 [String.as:780]
-PASSED: 1234 == stringObject [String.as:781]
-PASSED: stringObject != numberObject [String.as:784]
-PASSED: numberObject.toString() == stringObject [String.as:788]
-PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
-PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
-PASSED: typeof(s.toString) == 'function' [String.as:797]
-PASSED: ! delete String.prototype.toString [String.as:798]
-PASSED: delete String.prototype.toString [String.as:801]
-PASSED: typeof(s.toString) == 'function' [String.as:802]
-PASSED: !delete Object.prototype.toString [String.as:803]
-PASSED: delete Object.prototype.toString [String.as:806]
-PASSED: typeof(s.toString) == 'undefined' [String.as:807]
-PASSED: r == "s:hello" [String.as:817]
-PASSED: r == "s:" [String.as:821]
-PASSED: a.length == 3 [String.as:828]
-PASSED: a.length == 3 [String.as:830]
-PASSED: a.length == 3 [String.as:832]
-PASSED: a.length == 2 [String.as:834]
-PASSED: a == "123" [String.as:835]
-PASSED: a.length == "another string" [String.as:837]
-PASSED: a.length == "another string" [String.as:839]
-PASSED: a.hasOwnProperty('length') [String.as:841]
-PASSED: a.toString() == "toString" [String.as:850]
-PASSED: a.toString() == "toString" [String.as:858]
-PASSED: typeof(String.__proto__) == 'object' [String.as:860]
-PASSED: typeof(Object.prototype) == 'object' [String.as:861]
-PASSED: String.gotcha == 1 [String.as:863]
-PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
-PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
-PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
-PASSED: a.toString() == "gotcha,toString" [String.as:870]
-check_totals: 274
diff --git a/test/gnash/actionscript.all/pending/String-8.swf b/test/gnash/actionscript.all/pending/String-8.swf
deleted file mode 100644
index 204ede4..0000000
Binary files a/test/gnash/actionscript.all/pending/String-8.swf and /dev/null differ
diff --git a/test/gnash/actionscript.all/pending/String-8.swf.trace b/test/gnash/actionscript.all/pending/String-8.swf.trace
deleted file mode 100644
index 2e45190..0000000
--- a/test/gnash/actionscript.all/pending/String-8.swf.trace
+++ /dev/null
@@ -1,275 +0,0 @@
-PASSED: typeof(String) == 'function' [String.as:23]
-PASSED: typeof(String.prototype) == 'object' [String.as:24]
-PASSED: String.__proto__ == Function.prototype [String.as:25]
-PASSED: typeof(String.prototype.valueOf) == 'function' [String.as:26]
-PASSED: typeof(String.prototype.toString) == 'function' [String.as:27]
-PASSED: typeof(String.prototype.toUpperCase) == 'function' [String.as:28]
-PASSED: typeof(String.prototype.toLowerCase) == 'function' [String.as:29]
-PASSED: typeof(String.prototype.charAt) == 'function' [String.as:30]
-PASSED: typeof(String.prototype.charCodeAt) == 'function' [String.as:31]
-PASSED: typeof(String.prototype.concat) == 'function' [String.as:32]
-PASSED: typeof(String.prototype.indexOf) == 'function' [String.as:33]
-PASSED: typeof(String.prototype.lastIndexOf) == 'function' [String.as:34]
-PASSED: typeof(String.prototype.slice) == 'function' [String.as:35]
-PASSED: typeof(String.prototype.substring) == 'function' [String.as:36]
-PASSED: typeof(String.prototype.split) == 'function' [String.as:37]
-PASSED: typeof(String.prototype.substr) == 'function' [String.as:38]
-PASSED: typeof(String.prototype.length) == 'undefined' [String.as:39]
-PASSED: typeof(String.prototype.fromCharCode) == 'undefined' [String.as:40]
-PASSED: typeof(String.valueOf) == 'function' [String.as:42]
-PASSED: typeof(String.toString) == 'function' [String.as:43]
-PASSED: typeof(String.toUpperCase) == 'undefined' [String.as:48]
-PASSED: typeof(String.toLowerCase) == 'undefined' [String.as:49]
-PASSED: typeof(String.charAt) == 'undefined' [String.as:50]
-PASSED: typeof(String.charCodeAt) == 'undefined' [String.as:51]
-PASSED: typeof(String.concat) == 'undefined' [String.as:52]
-PASSED: typeof(String.indexOf) == 'undefined' [String.as:53]
-PASSED: typeof(String.lastIndexOf) == 'undefined' [String.as:54]
-PASSED: typeof(String.slice) == 'undefined' [String.as:55]
-PASSED: typeof(String.substring) == 'undefined' [String.as:56]
-PASSED: typeof(String.split) == 'undefined' [String.as:57]
-PASSED: typeof(String.substr) == 'undefined' [String.as:58]
-PASSED: typeof(String.fromCharCode) == 'function' [String.as:59]
-PASSED: String.hasOwnProperty('fromCharCode') [String.as:65]
-PASSED: !String.hasOwnProperty('toString') [String.as:66]
-PASSED: !String.hasOwnProperty('valueOf') [String.as:67]
-PASSED: String.hasOwnProperty('__proto__') [String.as:68]
-PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:69]
-PASSED: String.prototype.hasOwnProperty('toString') [String.as:70]
-PASSED: String.prototype.hasOwnProperty('toUpperCase') [String.as:71]
-PASSED: String.prototype.hasOwnProperty('toLowerCase') [String.as:72]
-PASSED: String.prototype.hasOwnProperty('charAt') [String.as:73]
-PASSED: String.prototype.hasOwnProperty('charCodeAt') [String.as:74]
-PASSED: String.prototype.hasOwnProperty('concat') [String.as:75]
-PASSED: String.prototype.hasOwnProperty('indexOf') [String.as:76]
-PASSED: String.prototype.hasOwnProperty('lastIndexOf') [String.as:77]
-PASSED: String.prototype.hasOwnProperty('slice') [String.as:78]
-PASSED: String.prototype.hasOwnProperty('substring') [String.as:79]
-PASSED: String.prototype.hasOwnProperty('split') [String.as:80]
-PASSED: String.prototype.hasOwnProperty('substr') [String.as:81]
-PASSED: !String.prototype.hasOwnProperty('length') [String.as:82]
-PASSED: typeof(String()) == 'string' [String.as:86]
-PASSED: a.length == 20 [String.as:90]
-PASSED: a.hasOwnProperty('length') [String.as:92]
-PASSED: typeof(a) == 'object' [String.as:94]
-PASSED: a instanceof String [String.as:95]
-PASSED: a instanceof Object [String.as:96]
-PASSED: a.charCodeAt(0) == 119 [String.as:97]
-PASSED: a.charCodeAt(1) == 97 [String.as:98]
-PASSED: a.charCodeAt(2) == 108 [String.as:99]
-PASSED: a.charCodeAt(3) == 108 [String.as:100]
-PASSED: a.charCodeAt(4) == 97 [String.as:101]
-PASSED: a.charAt(0) == "w" [String.as:102]
-PASSED: a.charAt(1) == "a" [String.as:103]
-PASSED: a.charAt(2) == "l" [String.as:104]
-PASSED: a.charAt(3) == "l" [String.as:105]
-PASSED: a.charAt(4) == "a" [String.as:106]
-PASSED: a.lastIndexOf("lawa") == 8 [String.as:109]
-PASSED: a.indexOf("lawa") == 3 [String.as:118]
-PASSED: a.indexOf("lawas") == 8 [String.as:119]
-PASSED: a.indexOf("hinG") == 13 [String.as:120]
-PASSED: a.indexOf("hing") == -1 [String.as:121]
-PASSED: a.indexOf("lawas", -1) == 8 [String.as:122]
-PASSED: a.indexOf("a", 2) == 4 [String.as:123]
-PASSED: a.indexOf("a", -1) == 1 [String.as:124]
-PASSED: a.indexOf("a", -2) == 1 [String.as:125]
-PASSED: a.indexOf("l") == 2 [String.as:126]
-PASSED: a.indexOf("l", 2.1) == 2 [String.as:127]
-PASSED: a.indexOf("l", 2.8) == 2 [String.as:128]
-PASSED: a.indexOf("l", 3) == 3 [String.as:129]
-PASSED: a.indexOf("l", 3.5) == 3 [String.as:130]
-PASSED: a.indexOf("l", 3.8) == 3 [String.as:131]
-PASSED: a.indexOf("l", -3.8) == 2 [String.as:132]
-PASSED: a.indexOf("l", -4.8) == 2 [String.as:133]
-PASSED: a.indexOf("l", -4) == 2 [String.as:134]
-PASSED: a.indexOf("a", o) == 4 [String.as:136]
-PASSED: a.indexOf(o2, o) == 4 [String.as:138]
-PASSED: typeof(a.split) == 'function' [String.as:145]
-PASSED: ! a.hasOwnProperty('split') [String.as:146]
-PASSED: a.__proto__.hasOwnProperty('split') [String.as:148]
-PASSED: a.__proto__ == String.prototype [String.as:149]
-PASSED: a.split()[0] == "wallawallawashinGTON" [String.as:152]
-PASSED: a.split().length == 1 [String.as:153]
-PASSED: a.split() instanceof Array [String.as:154]
-PASSED: a.split("w").length == 4 [String.as:155]
-PASSED: a.split(" w").length == 1 [String.as:156]
-PASSED: typeof(ret) == 'object' [String.as:161]
-PASSED: ret instanceof Array [String.as:162]
-PASSED: ret.length == 20 [String.as:163]
-PASSED: ret[0] == "w" [String.as:164]
-PASSED: ret[1] == "a" [String.as:165]
-PASSED: ret[2] == "l" [String.as:166]
-PASSED: ret[3] == "l" [String.as:167]
-PASSED: ret[18] == "O" [String.as:168]
-PASSED: ret[19] == "N" [String.as:169]
-PASSED: a.split("la")[0] == "wal" [String.as:170]
-PASSED: a.split("la")[1] == "wal" [String.as:171]
-PASSED: a.split("la")[2] == "washinGTON" [String.as:172]
-PASSED: a.split("la").length == 3 [String.as:173]
-PASSED: typeof(ret) == 'object' [String.as:189]
-PASSED: ret.length == 1 [String.as:190]
-PASSED: typeof(ret[0]) == 'string' [String.as:191]
-PASSED: ret[0] == '' [String.as:192]
-PASSED: ret.length == 1 [String.as:198]
-PASSED: ret.length == 1 [String.as:204]
-PASSED: ret.length == 1 [String.as:207]
-PASSED: ret.length == 1 [String.as:209]
-PASSED: typeof(ret) == 'object' [String.as:213]
-PASSED: ret.length == 1 [String.as:214]
-PASSED: typeof(ret[0]) == 'string' [String.as:215]
-PASSED: ret[0] == 'abcde' [String.as:216]
-XPASSED: g.length == 0 [String.as:221]
-XPASSED: typeof(g[0]) == "undefined" [String.as:222]
-XPASSED: g[0] == undefined [String.as:223]
-PASSED: g.length == 1 [String.as:233]
-PASSED: typeof(g[0]) == "string" [String.as:234]
-PASSED: g[0] == "" [String.as:235]
-PASSED: g.length == 1 [String.as:244]
-PASSED: typeof(g[0]) == "string" [String.as:245]
-PASSED: g[0] == "" [String.as:246]
-PASSED: g.length == 0 [String.as:251]
-PASSED: typeof(g[0]) == "undefined" [String.as:252]
-PASSED: g[0] == undefined [String.as:253]
-PASSED: g.length == 0 [String.as:263]
-PASSED: typeof(g[0]) == "undefined" [String.as:264]
-PASSED: g[0] == undefined [String.as:265]
-PASSED: g.length == 1 [String.as:269]
-PASSED: typeof(g[0]) == "string" [String.as:270]
-PASSED: g[0] == "f" [String.as:271]
-PASSED: b == "abcd" [String.as:282]
-PASSED: a.toUpperCase() == "WALLAWALLAWASHINGTON" [String.as:289]
-PASSED: a.toLowerCase() == "wallawallawashington" [String.as:290]
-PASSED: a.substr(5,2) == "fg" [String.as:298]
-PASSED: a.substr(5,7) == "fghijkl" [String.as:299]
-PASSED: a.substr(-1,1) == "z" [String.as:300]
-PASSED: a.substr(-2,3) == "yz" [String.as:301]
-PASSED: a.substr(-3,2) == "xy" [String.as:302]
-PASSED: b.substr(3, 6) == "4" [String.as:304]
-PASSED: a.slice(-5,-3) == "vw" [String.as:312]
-PASSED: typeof(a.slice()) == "undefined" [String.as:313]
-PASSED: typeof(a.slice(-5,3)) == "string" [String.as:314]
-PASSED: a.slice(-5,3) == "" [String.as:315]
-PASSED: typeof(a.slice(-10,22)) == "string" [String.as:316]
-PASSED: a.slice(-10,22) == "qrstuv" [String.as:317]
-PASSED: a.slice(0,0) == "" [String.as:318]
-PASSED: a.slice(0,1) == "a" [String.as:319]
-PASSED: a.slice(1,1) == "" [String.as:320]
-PASSED: a.slice(1,2) == "b" [String.as:321]
-PASSED: a.slice.call(a, -5, -3) == "vw" [String.as:323]
-PASSED: String.prototype.slice.call(a, -5, -3) == "vw" [String.as:324]
-PASSED: a.slice(-4) == "wxyz" [String.as:331]
-PASSED: a.substring(5,2) == "cde" [String.as:339]
-PASSED: a.substring(5,7) == "fg" [String.as:340]
-PASSED: a.substring(3,3) == "" [String.as:341]
-PASSED: a.length == 26 [String.as:343]
-PASSED: a.concat("sir ","william",15) == "abcdefghijklmnopqrstuvwxyzsir william15" [String.as:344]
-PASSED: b.substring(3, 6) == "4" [String.as:347]
-PASSED: chr(0) == "" [String.as:354]
-PASSED: chr(65) == "A" [String.as:355]
-PASSED: ord("A") == 65 [String.as:356]
-PASSED: ord("") == 0 [String.as:357]
-PASSED: chr(246) == "ö" [String.as:361]
-PASSED: chr(486) == "Ǧ" [String.as:362]
-PASSED: chr(998) == "Ϧ" [String.as:363]
-PASSED: ord("ö") == 246 [String.as:364]
-PASSED: ord("Ϧ") == 998 [String.as:365]
-PASSED: c == 486 [String.as:393]
-PASSED: c == 998 [String.as:409]
-PASSED: c == "Ϧ" [String.as:427]
-PASSED: c == "å¾" [String.as:446]
-PASSED: a.length == 14 [String.as:462]
-PASSED: a.substring(2,4) == "ng" [String.as:463]
-PASSED: a.charAt(1) == "ä" [String.as:464]
-PASSED: a.charAt(2) == "n" [String.as:465]
-PASSED: a.slice(3,5) == "ge" [String.as:466]
-PASSED: a.charCodeAt(9) == 246 [String.as:467]
-PASSED: b == "iao" [String.as:494]
-PASSED: b == "oowa" [String.as:504]
-PASSED: b == "c" [String.as:513]
-PASSED: b == "ciao" [String.as:522]
-PASSED: b == "c" [String.as:531]
-PASSED: b == "" [String.as:540]
-PASSED: b == "l" [String.as:549]
-PASSED: b == "f" [String.as:559]
-PASSED: b == "" [String.as:569]
-PASSED: count1 == 225 [String.as:605]
-PASSED: count2 == 225 [String.as:606]
-PASSED: b == "iao" [String.as:626]
-PASSED: b == "oowa" [String.as:636]
-PASSED: b == "c" [String.as:645]
-PASSED: b == "ciao" [String.as:654]
-PASSED: b == "c" [String.as:663]
-PASSED: b == "" [String.as:672]
-PASSED: b == "l" [String.as:681]
-PASSED: b == "f" [String.as:691]
-PASSED: stringInstance.__proto__ != undefined [String.as:700]
-PASSED: stringInstance.__proto__ == String.prototype [String.as:701]
-PASSED: typeOf(String.prototype.constructor) == 'function' [String.as:702]
-PASSED: String.prototype.constructor == String [String.as:703]
-PASSED: stringInstance.__proto__.constructor == String [String.as:704]
-PASSED: stringInstance instanceof String [String.as:707]
-PASSED: ! "literal string" instanceof String [String.as:708]
-PASSED: typeof(a_string) == "string" [String.as:714]
-PASSED: a_string.substring(0, 4) == "a_st" [String.as:715]
-PASSED: a_string.substring(-3, 4) == "a_st" [String.as:716]
-PASSED: a_string.substring(0, -1) == "" [String.as:717]
-PASSED: a_string.substring(0, 1) == "a" [String.as:718]
-PASSED: a_string.substring(4) == "ring" [String.as:719]
-PASSED: a_string.substring(16) == "" [String.as:720]
-PASSED: a_string.substring(-16) == "a_string" [String.as:721]
-PASSED: a_string.toUpperCase() == "A_STRING" [String.as:722]
-PASSED: a_string.indexOf("hing") == -1 [String.as:723]
-PASSED: a_string.indexOf("string") == 2 [String.as:724]
-PASSED: a_string.charCodeAt(0) == 97 [String.as:725]
-PASSED: a_string.substring(0, 1) == "" [String.as:727]
-PASSED: a_string.length == 10 [String.as:731]
-PASSED: a_string.length == 10 [String.as:733]
-PASSED: a_string == "1234567890" [String.as:734]
-PASSED: a+b == "onetwo" [String.as:742]
-PASSED: b+c == "two[object Object]" [String.as:745]
-PASSED: b+c == "twoone" [String.as:750]
-PASSED: c.toString != prevToStringFunc [String.as:755]
-PASSED: b+c == "two[type Object]" [String.as:757]
-PASSED: typeof(c.toString) == 'function' [String.as:761]
-PASSED: b+c == "two[type Object]" [String.as:762]
-PASSED: typeof(c.toString) == 'undefined' [String.as:766]
-PASSED: b+c == "two[type Object]" [String.as:767]
-PASSED: typeof(stringObject.valueOf) == 'function' [String.as:770]
-PASSED: stringObject.valueOf == String.prototype.valueOf [String.as:771]
-PASSED: stringObject.valueOf != Object.prototype.valueOf [String.as:774]
-PASSED: String.prototype.hasOwnProperty('valueOf') [String.as:775]
-PASSED: typeof(stringObject.valueOf()) == 'string' [String.as:778]
-PASSED: stringObject == "1234" [String.as:779]
-PASSED: stringObject == 1234 [String.as:780]
-PASSED: 1234 == stringObject [String.as:781]
-PASSED: stringObject != numberObject [String.as:784]
-PASSED: numberObject.toString() == stringObject [String.as:788]
-PASSED: numberObject.toString() == stringObject.toString() [String.as:789]
-PASSED: typeof(Object.prototype.toString) == 'function' [String.as:796]
-PASSED: typeof(s.toString) == 'function' [String.as:797]
-PASSED: ! delete String.prototype.toString [String.as:798]
-PASSED: delete String.prototype.toString [String.as:801]
-PASSED: typeof(s.toString) == 'function' [String.as:802]
-PASSED: !delete Object.prototype.toString [String.as:803]
-PASSED: delete Object.prototype.toString [String.as:806]
-PASSED: typeof(s.toString) == 'undefined' [String.as:807]
-PASSED: r == "s:hello" [String.as:817]
-PASSED: r == "s:" [String.as:821]
-PASSED: a.length == 3 [String.as:828]
-PASSED: a.length == 3 [String.as:830]
-PASSED: a.length == 3 [String.as:832]
-PASSED: a.length == 2 [String.as:834]
-PASSED: a == "123" [String.as:835]
-PASSED: a.length == "another string" [String.as:837]
-PASSED: a.length == "another string" [String.as:839]
-PASSED: a.hasOwnProperty('length') [String.as:841]
-PASSED: a.toString() == "toString" [String.as:850]
-PASSED: a.toString() == "toString" [String.as:858]
-PASSED: typeof(String.__proto__) == 'object' [String.as:860]
-PASSED: typeof(Object.prototype) == 'object' [String.as:861]
-PASSED: String.gotcha == 1 [String.as:863]
-PASSED: !String.__proto__.hasOwnProperty("gotcha") [String.as:865]
-PASSED: String.__proto__.__proto__.hasOwnProperty("gotcha") [String.as:866]
-PASSED: String.__proto__.__proto__ == Object.prototype [String.as:867]
-PASSED: a.toString() == "gotcha,toString" [String.as:870]
-check_totals: 274
diff --git a/test/gnash/actionscript.all/pending/String.as b/test/gnash/actionscript.all/pending/String.as
deleted file mode 100644
index d1fd0af..0000000
--- a/test/gnash/actionscript.all/pending/String.as
+++ /dev/null
@@ -1,905 +0,0 @@
-//
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-// Original author: Mike Carlson - June 19th, 2006
-
-
-rcsid="$Id: String.as,v 1.56 2008/04/25 11:11:08 bwy Exp $";
-#include "check.as"
-
-check_equals(typeof(String), 'function');
-check_equals(typeof(String.prototype), 'object');
-check_equals(String.__proto__, Function.prototype); // both undefined in swf5
-check_equals(typeof(String.prototype.valueOf), 'function');
-check_equals(typeof(String.prototype.toString), 'function');
-check_equals(typeof(String.prototype.toUpperCase), 'function');
-check_equals(typeof(String.prototype.toLowerCase), 'function');
-check_equals(typeof(String.prototype.charAt), 'function');
-check_equals(typeof(String.prototype.charCodeAt), 'function');
-check_equals(typeof(String.prototype.concat), 'function');
-check_equals(typeof(String.prototype.indexOf), 'function');
-check_equals(typeof(String.prototype.lastIndexOf), 'function');
-check_equals(typeof(String.prototype.slice), 'function');
-check_equals(typeof(String.prototype.substring), 'function');
-check_equals(typeof(String.prototype.split), 'function');
-check_equals(typeof(String.prototype.substr), 'function');
-check_equals(typeof(String.prototype.length), 'undefined');
-check_equals(typeof(String.prototype.fromCharCode), 'undefined');
-#if OUTPUT_VERSION > 5
- check_equals(typeof(String.valueOf), 'function');
- check_equals(typeof(String.toString), 'function');
-#else
- check_equals(typeof(String.valueOf), 'undefined');
- check_equals(typeof(String.toString), 'undefined');
-#endif
-check_equals(typeof(String.toUpperCase), 'undefined');
-check_equals(typeof(String.toLowerCase), 'undefined');
-check_equals(typeof(String.charAt), 'undefined');
-check_equals(typeof(String.charCodeAt), 'undefined');
-check_equals(typeof(String.concat), 'undefined');
-check_equals(typeof(String.indexOf), 'undefined');
-check_equals(typeof(String.lastIndexOf), 'undefined');
-check_equals(typeof(String.slice), 'undefined');
-check_equals(typeof(String.substring), 'undefined');
-check_equals(typeof(String.split), 'undefined');
-check_equals(typeof(String.substr), 'undefined');
-check_equals(typeof(String.fromCharCode), 'function');
-
-#if OUTPUT_VERSION > 5
-
-// Tests for SWF5 at the end of the file.
-
-check(String.hasOwnProperty('fromCharCode'));
-check(!String.hasOwnProperty('toString'));
-check(!String.hasOwnProperty('valueOf'));
-check(String.hasOwnProperty('__proto__'));
-check(String.prototype.hasOwnProperty('valueOf'));
-check(String.prototype.hasOwnProperty('toString'));
-check(String.prototype.hasOwnProperty('toUpperCase'));
-check(String.prototype.hasOwnProperty('toLowerCase'));
-check(String.prototype.hasOwnProperty('charAt'));
-check(String.prototype.hasOwnProperty('charCodeAt'));
-check(String.prototype.hasOwnProperty('concat'));
-check(String.prototype.hasOwnProperty('indexOf'));
-check(String.prototype.hasOwnProperty('lastIndexOf'));
-check(String.prototype.hasOwnProperty('slice'));
-check(String.prototype.hasOwnProperty('substring'));
-check(String.prototype.hasOwnProperty('split'));
-check(String.prototype.hasOwnProperty('substr'));
-check(!String.prototype.hasOwnProperty('length'));
-
-#endif
-
-check_equals(typeof(String()), 'string');
-
-var a;
-a = new String("wallawallawashinGTON");
-check_equals(a.length, 20);
-#if OUTPUT_VERSION > 5
-check(a.hasOwnProperty('length'));
-#endif
-check_equals(typeof(a), 'object');
-check(a instanceof String);
-check(a instanceof Object);
-check_equals ( a.charCodeAt(0), 119 );
-check_equals ( a.charCodeAt(1), 97 );
-check_equals ( a.charCodeAt(2), 108 );
-check_equals ( a.charCodeAt(3), 108 );
-check_equals ( a.charCodeAt(4), 97 );
-check_equals ( a.charAt(0), "w" );
-check_equals ( a.charAt(1), "a" );
-check_equals ( a.charAt(2), "l" );
-check_equals ( a.charAt(3), "l" );
-check_equals ( a.charAt(4), "a" );
-isNaN ( a.charAt(-1) );
-isNaN (a.charAt(21) );
-check_equals ( a.lastIndexOf("lawa"), 8);
-
-//----------------------------------------
-// Check String.indexOf
-// TODO: test with ASnative(251,8)
-//-----------------------------------------
-
-
-// wallawallawashinGTON
-check_equals ( a.indexOf("lawa"), 3 );
-check_equals ( a.indexOf("lawas"), 8 );
-check_equals ( a.indexOf("hinG"), 13 );
-check_equals ( a.indexOf("hing"), -1 );
-check_equals ( a.indexOf("lawas", -1), 8 );
-check_equals ( a.indexOf("a", 2), 4 );
-check_equals ( a.indexOf("a", -1), 1 );
-check_equals ( a.indexOf("a", -2), 1 );
-check_equals ( a.indexOf("l"), 2 );
-check_equals ( a.indexOf("l", 2.1), 2 );
-check_equals ( a.indexOf("l", 2.8), 2 );
-check_equals ( a.indexOf("l", 3), 3 );
-check_equals ( a.indexOf("l", 3.5), 3 );
-check_equals ( a.indexOf("l", 3.8), 3 );
-check_equals ( a.indexOf("l", -3.8), 2 );
-check_equals ( a.indexOf("l", -4.8), 2 );
-check_equals ( a.indexOf("l", -4), 2 );
-o = {}; o.valueOf = function() { return 2; };
-check_equals ( a.indexOf("a", o), 4 );
-o2 = {}; o2.toString = function() { return "a"; };
-check_equals ( a.indexOf(o2, o), 4 );
-
-//----------------------------------------
-// Check String.split
-// TODO: test with ASnative(251,12)
-//-----------------------------------------
-
-check_equals ( typeof(a.split), 'function' );
-check ( ! a.hasOwnProperty('split') );
-#if OUTPUT_VERSION > 5
-check ( a.__proto__.hasOwnProperty('split') );
-check ( a.__proto__ == String.prototype );
-#endif
-
-check_equals ( a.split()[0], "wallawallawashinGTON" );
-check_equals ( a.split().length, 1 );
-check ( a.split() instanceof Array );
-check_equals ( a.split("w").length, 4);
-check_equals ( a.split(" w").length, 1);
-
-#if OUTPUT_VERSION > 5
-// TODO: check more of split(''), it seems to be bogus !
-ret = a.split('');
-check_equals(typeof(ret), 'object');
-check(ret instanceof Array);
-check_equals( ret.length, 20 );
-check_equals ( ret[0], "w" );
-check_equals ( ret[1], "a" );
-check_equals ( ret[2], "l" );
-check_equals ( ret[3], "l" );
-check_equals ( ret[18], "O" );
-check_equals ( ret[19], "N" );
-check_equals ( a.split("la")[0], "wal" );
-check_equals ( a.split("la")[1], "wal" );
-check_equals ( a.split("la")[2], "washinGTON" );
-check_equals ( a.split("la").length, 3 );
-#else
-// empty delimiter doesn't have a special meaning in SWF5
-check_equals ( a.split("")[0], "wallawallawashinGTON" );
-check_equals ( a.split("")[19], undefined );
-// mulit-char delimiter doesn't work in SWF5
-check_equals ( a.split("la")[0], "wallawallawashinGTON" );
-check_equals ( a.split("la")[1], undefined );
-check_equals ( a.split("la")[2], undefined );
-check_equals ( a.split("la").length, 1 );
-#endif
-
-// TODO: test String.split(delim, limit) [ second arg ]
-
-primitiveString = '';
-ret = primitiveString.split('x');
-check_equals(typeof(ret), 'object');
-check_equals(ret.length, 1);
-check_equals(typeof(ret[0]), 'string');
-check_equals(ret[0], '');
-
-ret = primitiveString.split('x', -1);
-#if OUTPUT_VERSION < 6
- check_equals(ret.length, 0);
-#else // OUTPUT_VERSION >= 6
- check_equals(ret.length, 1);
-#endif // OUTPUT_VERSION >= 6
-ret = primitiveString.split('x', 0);
-#if OUTPUT_VERSION < 6
- check_equals(ret.length, 0);
-#else // OUTPUT_VERSION >= 6
- check_equals(ret.length, 1);
-#endif // OUTPUT_VERSION >= 6
-ret = primitiveString.split('x', 1);
-check_equals(ret.length, 1);
-ret = primitiveString.split('x', 2);
-check_equals(ret.length, 1);
-
-primitiveString = 'abcde';
-ret = primitiveString.split('x');
-check_equals(typeof(ret), 'object');
-check_equals(ret.length, 1);
-check_equals(typeof(ret[0]), 'string');
-check_equals(ret[0], 'abcde');
-
-st = "";
-g = st.split("", 0);
-#if OUTPUT_VERSION > 5
-xcheck_equals(g.length, 0);
-xcheck_equals(typeof(g[0]), "undefined");
-xcheck_equals(g[0], undefined);
-#else
-check_equals(g.length, 1);
-check_equals(typeof(g[0]), "string");
-check_equals(g[0], "");
-#endif
-
-st = "";
-g = st.split("x", 0);
-#if OUTPUT_VERSION > 5
-check_equals(g.length, 1);
-check_equals(typeof(g[0]), "string");
-check_equals(g[0], "");
-#else
-check_equals(g.length, 0);
-check_equals(typeof(g[0]), "undefined");
-check_equals(g[0], undefined);
-#endif
-
-st = "";
-g = st.split("x", 1);
-check_equals(g.length, 1);
-check_equals(typeof(g[0]), "string");
-check_equals(g[0], "");
-
-st = "f";
-g = st.split("", 0);
-#if OUTPUT_VERSION > 5
-check_equals(g.length, 0);
-check_equals(typeof(g[0]), "undefined");
-check_equals(g[0], undefined);
-#else
-check_equals(g.length, 1);
-check_equals(typeof(g[0]), "string");
-check_equals(g[0], "f");
-#endif
-
-
-st = "f";
-g = st.split("x", 0);
-check_equals(g.length, 0);
-check_equals(typeof(g[0]), "undefined");
-check_equals(g[0], undefined);
-
-st = "f";
-g = st.split("x", 1);
-check_equals(g.length, 1);
-check_equals(typeof(g[0]), "string");
-check_equals(g[0], "f");
-
-
-//----------------------------------------
-// Check String.fromCharCode
-// TODO: test with ASnative(251,14)
-//-----------------------------------------
-
-
-// This is the correct usage pattern
-var b = String.fromCharCode(97,98,99,100);
-check_equals ( b, "abcd" );
-
-//-------------------------------------------
-// Check String.toUpperCase and toLowerCase
-// TODO: test with ASnative(251,3)
-//-------------------------------------------
-
-check_equals ( a.toUpperCase(), "WALLAWALLAWASHINGTON" );
-check_equals ( a.toLowerCase(), "wallawallawashington" );
-
-//-------------------------------------------
-// Check substr
-// TODO: test with ASnative(251,13)
-//-------------------------------------------
-
-a = new String("abcdefghijklmnopqrstuvwxyz");
-check_equals ( a.substr(5,2), "fg" );
-check_equals ( a.substr(5,7), "fghijkl" );
-check_equals ( a.substr(-1,1), "z" );
-check_equals ( a.substr(-2,3), "yz" );
-check_equals ( a.substr(-3,2), "xy" );
-var b = new String("1234");
-check_equals ( b.substr(3, 6), "4");
-
-//-------------------------------------------
-// Check slice
-// TODO: test with ASnative(251,10)
-//-------------------------------------------
-
-a = new String("abcdefghijklmnopqrstuvwxyz");
-check_equals ( a.slice(-5,-3), "vw" );
-check_equals ( typeof(a.slice()), "undefined" );
-check_equals ( typeof(a.slice(-5,3)), "string" );
-check_equals ( a.slice(-5,3), "" );
-check_equals ( typeof(a.slice(-10,22)), "string" );
-check_equals ( a.slice(-10,22), "qrstuv" );
-check_equals ( a.slice(0,0), "" );
-check_equals ( a.slice(0,1), "a" );
-check_equals ( a.slice(1,1), "" );
-check_equals ( a.slice(1,2), "b" );
-#if OUTPUT_VERSION > 5
-check_equals ( a.slice.call(a, -5, -3), "vw" );
-check_equals ( String.prototype.slice.call(a, -5, -3), "vw" );
-#else
-// There was no 'call' or 'apply' thing up to SWF5
-// Actually, there was no Function interface at all!
-check_equals ( a.slice.call(a, -5, -3), undefined );
-check_equals ( String.prototype.slice.call(a, -5, -3), undefined );
-#endif
-check_equals ( a.slice(-4), "wxyz" );
-
-//-------------------------------------------
-// Check substring
-// TODO: test with ASnative(251,11)
-//-------------------------------------------
-
-a = new String("abcdefghijklmnopqrstuvwxyz");
-check_equals ( a.substring(5,2), "cde" );
-check_equals ( a.substring(5,7), "fg" );
-check_equals ( a.substring(3,3), "" );
-
-check_equals ( a.length, 26 );
-check_equals ( a.concat("sir ","william",15), "abcdefghijklmnopqrstuvwxyzsir william15");
-
-var b = new String("1234");
-check_equals ( b.substring(3, 6), "4");
-
-
-//-------------------------------------------
-// Chr and ord
-//-------------------------------------------
-
-check_equals (chr(0), "");
-check_equals (chr(65), "A");
-check_equals (ord("A"), 65);
-check_equals (ord(""), 0);
-
-// Chars greater than 128
-#if OUTPUT_VERSION > 5
-check_equals (chr(246), "ö");
-check_equals (chr(486), "Ǧ");
-check_equals (chr(998), "Ϧ");
-check_equals (ord("ö"), 246);
-check_equals (ord("Ϧ"), 998);
-#else // version <= 5
-check_equals (typeof(chr(486)), 'string');
-check_equals (chr(865), "a");
-check_equals (ord("ö"), 195);
-check_equals (ord("Ã"), 195);
-check_equals (ord("ǵ"), 199);
-check_equals (ord("Ϧ"), 207);
-#endif
-
-//-------------------------------------------
-// Mbchr and mbord
-//-------------------------------------------
-
-// All versions, especially 5:
-var c;
-
-i = "Ǧ";
-
-asm {
- push "c"
- push "i"
- getvariable
- mbord
- setvariable
-};
-
-#if OUTPUT_VERSION > 5
-check_equals (c, 486);
-#else
-xcheck_equals (c, 199);
-#endif
-
-i = "Ϧ";
-
-asm {
- push "c"
- push "i"
- getvariable
- mbord
- setvariable
-};
-
-#if OUTPUT_VERSION > 5
-check_equals (c, 998);
-#else
-xcheck_equals (c, 207);
-#endif
-
-// And the reverse procedure:
-
-i = 998;
-
-asm {
- push "c"
- push "i"
- getvariable
- mbchr
- setvariable
-};
-
-#if OUTPUT_VERSION > 5
-check_equals (c, "Ϧ");
-#else
-check_equals (typeof(c), "string");
-// c == "" fails, but when displayed it evaluates to the empty string
-#endif
-
-// Should return the same as mbchr(90000 - 65536)
-
-i = 90000;
-
-asm {
- push "c"
- push "i"
- getvariable
- mbchr
- setvariable
-};
-
-#if OUTPUT_VERSION > 5
-check_equals (c, "å¾");
-#else
-check_equals (typeof(c), "string");
-// c == "" fails, but when displayed it evaluates to the empty string
-#endif
-
-//-------------------------------------------
-// Check multi-byte chars with all string
-// functions
-//-------------------------------------------
-
-// These tests are only correct with SWF6 and above.
-
-var a = new String("Längere Wörter");
-
-#if OUTPUT_VERSION > 5
-check_equals (a.length, 14);
-check_equals (a.substring(2,4), "ng");
-check_equals (a.charAt(1), "ä");
-check_equals (a.charAt(2), "n");
-check_equals (a.slice(3,5), "ge");
-check_equals (a.charCodeAt(9), 246);
-#else
-check_equals (a.length, 16);
-check_equals (a.slice(3,5), "ng");
-check_equals (a.charCodeAt(10), 195);
-#endif
-
-//-----------------------------------------------------------
-// Test SWFACTION_SUBSTRING
-//-----------------------------------------------------------
-
-// see check.as
-#ifdef MING_SUPPORTS_ASM
-
-// We need ming-0.4.0beta2 or later for this to work...
-// This is the only way to generate an SWFACTION_SUBSTRING
-// tag (the calls above generate a CALLMETHOD tag)
-//
-asm {
- push "b"
- push "ciao"
- push "2"
- push "10" // size is bigger then string length,
- // we expect the interpreter to adjust it
- substring
- setvariable
-};
-check_equals( b, "iao");
-asm {
- push "b"
- push "boowa"
- push "2"
- push "-1" // size is bigger then string length,
- // we expect the interpreter to adjust it
- substring
- setvariable
-};
-check_equals( b, "oowa");
-asm {
- push "b"
- push "ciao"
- push "-2" // negative base should be interpreted as 1
- push "1"
- substring
- setvariable
-};
-check_equals( b, "c");
-asm {
- push "b"
- push "ciao"
- push "-2" // negative base should be interpreted as 1
- push "10" // long size reduced
- substring
- setvariable
-};
-check_equals( b, "ciao");
-asm {
- push "b"
- push "ciao"
- push "0" // zero base is invalid, but taken as 1
- push "1"
- substring
- setvariable
-};
-check_equals( b, "c");
-asm {
- push "b"
- push "ciao"
- push "10" // too large base ...
- push "1"
- substring
- setvariable
-};
-check_equals( b, "");
-asm {
- push "b"
- push "all"
- push "3" // base is 1-based!
- push "1"
- substring
- setvariable
-};
-check_equals( b, "l");
-
-asm {
- push "b"
- push "f"
- push "1"
- push "1"
- substring
- setvariable
-};
-check_equals( b, "f");
-
-asm {
- push "b"
- push ""
- push "0"
- push "1"
- substring
- setvariable
-};
-check_equals( b, "");
-
-teststr = "Heöllo";
-count1 = 0;
-count2 = 0;
-
-for (i = -5; i < 10; i++)
-{
- for (j = -5; j < 10; j++)
- {
- asm {
- push "a"
- push "teststr"
- getvariable
- push "i"
- getvariable
- push "j"
- getvariable
- substring
- setvariable
- };
-
- b = teststr.substr( i >= 1 ? i - 1 : 0, j >= 0 ? j : teststr.length);
-
- // Test for undefined.
- c = teststr.substr( i >= 1 ? i - 1 : 0, j >= 0 ? j : teststr.undef());
-
- // There are 225 tests
- if (a == b) count1++;
- else note(i + " : " + j + " -- " + a + ":" + b);
-
- if (b == c) count2++;
-
- }
-}
-
-check_equals (count1, 225); // String.substr / substring consistency
-check_equals (count2, 225); // undefined value same as no value passed (or length of string)
-
-#endif
-
-//-----------------------------------------------------------
-// Test SWFACTION_MBSUBSTRING
-//-----------------------------------------------------------
-
-// see check.as
-#ifdef MING_SUPPORTS_ASM
-
-asm {
- push "b"
- push "ciao"
- push "2"
- push "10" // size is bigger then string length,
- // we expect the interpreter to adjust it
- mbsubstring
- setvariable
-};
-check_equals( b, "iao");
-asm {
- push "b"
- push "boowa"
- push "2"
- push "-1" // size is bigger then string length,
- // we expect the interpreter to adjust it
- mbsubstring
- setvariable
-};
-check_equals( b, "oowa");
-asm {
- push "b"
- push "ciao"
- push "-2" // negative base should be interpreted as 1
- push "1"
- mbsubstring
- setvariable
-};
-check_equals( b, "c");
-asm {
- push "b"
- push "ciao"
- push "-2" // negative base should be interpreted as 1
- push "10" // long size reduced
- mbsubstring
- setvariable
-};
-check_equals( b, "ciao");
-asm {
- push "b"
- push "ciao"
- push "0" // zero base is invalid, but taken as 1
- push "1"
- mbsubstring
- setvariable
-};
-check_equals( b, "c");
-asm {
- push "b"
- push "ciao"
- push "10" // too large base ...
- push "1"
- mbsubstring
- setvariable
-};
-check_equals( b, "");
-asm {
- push "b"
- push "all"
- push "3" // base is 1-based!
- push "1"
- mbsubstring
- setvariable
-};
-check_equals( b, "l");
-
-asm {
- push "b"
- push "f"
- push "1"
- push "1"
- mbsubstring
- setvariable
-};
-check_equals( b, "f");
-
-#endif
-
-//-----------------------------------------------------------
-// Test inheritance with built-in functions
-//-----------------------------------------------------------
-
-var stringInstance = new String();
-check (stringInstance.__proto__ != undefined);
-check (stringInstance.__proto__ == String.prototype);
-check_equals (typeOf(String.prototype.constructor), 'function');
-check (String.prototype.constructor == String);
-check (stringInstance.__proto__.constructor == String);
-
-// Test the instanceof operator
-check ( stringInstance instanceof String );
-check ( ! "literal string" instanceof String );
-
-// Test automatic cast of string values to String objects
-// this should happen automatically when invoking methods
-// on a primitive string type
-var a_string = "a_string";
-check_equals(typeof(a_string), "string");
-check_equals (a_string.substring(0, 4), "a_st");
-check_equals (a_string.substring(-3, 4), "a_st");
-check_equals (a_string.substring(0, -1), "");
-check_equals (a_string.substring(0, 1), "a");
-check_equals (a_string.substring(4), "ring");
-check_equals (a_string.substring(16), "");
-check_equals (a_string.substring(-16), "a_string");
-check_equals (a_string.toUpperCase(), "A_STRING");
-check_equals (a_string.indexOf("hing"), -1 );
-check_equals (a_string.indexOf("string"), 2 );
-check_equals (a_string.charCodeAt(0), 97 );
-a_string = ""; // empty
-check_equals (a_string.substring(0, 1), "");
-
-// Test String.length not being overridable
-a_string = "1234567890";
-check_equals(a_string.length, 10);
-a_string.length = 4;
-check_equals(a_string.length, 10);
-check_equals(a_string, "1234567890");
-
-
-//----------------------------------------------------
-// Test automatic string conversion when adding stuff
-//-----------------------------------------------------
-a = "one";
-b = "two";
-check_equals(a+b, "onetwo");
-c = new Object();
-
-check_equals(b+c, "two[object Object]");
-
-// check that calls to toString() use the current environment
-c.toString = function() { return a; };
-prevToStringFunc = c.toString;
-check_equals(b+c, "twoone");
-
-// this won't be used as a valid toString method !
-c.toString = function() { return 4; };
-#if OUTPUT_VERSION >= 6
-check(c.toString != prevToStringFunc);
-#endif
-check_equals(b+c, "two[type Object]");
-
-ObjectProtoToStringBackup = Object.prototype.toString;
-Object.prototype.toString = undefined;
-check_equals(typeof(c.toString), 'function');
-check_equals(b+c, "two[type Object]");
-Object.prototype.toString = ObjectProtoToStringBackup;
-
-c.toString = undefined;
-check_equals(typeof(c.toString), 'undefined');
-check_equals(b+c, "two[type Object]");
-
-stringObject = new String("1234");
-check_equals(typeof(stringObject.valueOf), 'function');
-check_equals(stringObject.valueOf, String.prototype.valueOf);
-
-#if OUTPUT_VERSION > 5
-check(stringObject.valueOf != Object.prototype.valueOf);
-check(String.prototype.hasOwnProperty('valueOf'));
-#endif
-
-check_equals(typeof(stringObject.valueOf()), 'string');
-check_equals(stringObject, "1234");
-check_equals(stringObject, 1234);
-check_equals(1234, stringObject);
-numberObject = new Number(1234);
-#if OUTPUT_VERSION >= 6
-check(stringObject != numberObject);
-#else
-check_equals(stringObject, numberObject); // SWF5 always converts to primitive before comparison !!
-#endif
-check_equals(numberObject.toString(), stringObject);
-check_equals(numberObject.toString(), stringObject.toString());
-
-//----------------------------------------------------------------------
-// Drop the toString method of a string (also a test for ASSetPropFlags)
-//----------------------------------------------------------------------
-
-s = new String("a");
-check_equals(typeof(Object.prototype.toString), 'function');
-check_equals(typeof(s.toString), 'function');
-check(! delete String.prototype.toString);
-ASSetPropFlags(String.prototype, "toString", 0, 2); // unprotect from deletion
-StringProtoToStringBackup = String.prototype.toString;
-check(delete String.prototype.toString);
-check_equals(typeof(s.toString), 'function');
-check(!delete Object.prototype.toString);
-ASSetPropFlags(Object.prototype, "toString", 0, 2); // unprotect from deletion
-ObjectProtoToStringBackup = Object.prototype.toString;
-check(delete Object.prototype.toString);
-check_equals(typeof(s.toString), 'undefined');
-Object.prototype.toString = ObjectProtoToStringBackup;
-String.prototype.toString = StringProtoToStringBackup;
-
-//----------------------------------------------------------------------
-// Test concatenation of string objects
-//----------------------------------------------------------------------
-
-s = new String("hello");
-r = "s:"+s;
-check_equals(r, "s:hello");
-
-s = new String("");
-r = "s:"+s;
-check_equals(r, "s:");
-
-//----------------------------------------------------------------------
-// Test the 'length' property
-//----------------------------------------------------------------------
-
-a = "123";
-check_equals(a.length, 3);
-a.length = 2;
-check_equals(a.length, 3); // well, it's a string after all, not an object
-a = new String("123");
-check_equals(a.length, 3);
-a.length = 2;
-check_equals(a.length, 2); // can override
-check_equals(a, "123"); // not changing the actual string
-a.length = "another string";
-check_equals(a.length, "another string"); // can also be of a different type
-delete a["length"];
-check_equals(a.length, "another string"); // can't be deleted
-#if OUTPUT_VERSION > 5
- check(a.hasOwnProperty('length'));
-#endif
-
-//----------------------------------------------------------------------
-// Test that __proto__ is only hidden, but still existing , in SWF5
-//----------------------------------------------------------------------
-
-a=new Array(); for (v in String) a.push(v); a.sort();
-#if OUTPUT_VERSION > 5
- check_equals(a.toString(), "toString");
-#else
- check_equals(a.length, 0);
-#endif
-
-ASSetPropFlags(String, "__proto__", 0, 128); // unhide String.__proto__
-
-a=new Array(); for (v in String) a.push(v); a.sort();
-check_equals(a.toString(), "toString");
-
-check_equals(typeof(String.__proto__), 'object');
-check_equals(typeof(Object.prototype), 'object');
-Object.prototype.gotcha = 1;
-check_equals(String.gotcha, 1);
-ASSetPropFlags(Object.prototype, "hasOwnProperty", 0, 128); // unhide Object.prototype.hasOwnProperty
-check(!String.__proto__.hasOwnProperty("gotcha"));
-check(String.__proto__.__proto__.hasOwnProperty("gotcha")); // function
-check_equals(String.__proto__.__proto__, Object.prototype); // hasOwnProperty doesn't exist in gnash !
-
-a=new Array(); for (v in String) a.push(v); a.sort();
-check_equals(a.toString(), "gotcha,toString");
-
-#if OUTPUT_VERSION == 5
-// This here to avoid changing SWF5 String properties
-// before testing them.
-
-String.prototype.hasOwnProperty = ASnative(101, 5);
-String.hasOwnProperty = ASnative(101, 5);
-
-check(!String.hasOwnProperty('toString'));
-check(!String.hasOwnProperty('valueOf'));
-check(String.hasOwnProperty('__proto__'));
-check(String.hasOwnProperty('fromCharCode'));
-
-check(String.prototype.hasOwnProperty('valueOf'));
-check(String.prototype.hasOwnProperty('toString'));
-check(String.prototype.hasOwnProperty('toUpperCase'));
-check(String.prototype.hasOwnProperty('toLowerCase'));
-check(String.prototype.hasOwnProperty('charAt'));
-check(String.prototype.hasOwnProperty('charCodeAt'));
-check(String.prototype.hasOwnProperty('concat'));
-check(String.prototype.hasOwnProperty('indexOf'));
-check(String.prototype.hasOwnProperty('lastIndexOf'));
-check(String.prototype.hasOwnProperty('slice'));
-check(String.prototype.hasOwnProperty('substring'));
-check(String.prototype.hasOwnProperty('split'));
-check(String.prototype.hasOwnProperty('substr'));
-check(!String.prototype.hasOwnProperty('length'));
-
-#endif
-
-#if OUTPUT_VERSION < 6
- check_totals(258);
-#else
- check_totals(274);
-#endif
commit d68c64313b0f67a2789f1643300e16e4241780ac
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 16:08:33 2008 +0300
When both delim and str are empty give empty array, not one element, in split
Only for version > 5
string-split-empty test updated to include this case too
diff --git a/swfdec/swfdec_as_string.c b/swfdec/swfdec_as_string.c
index 058b213..599cc1e 100644
--- a/swfdec/swfdec_as_string.c
+++ b/swfdec/swfdec_as_string.c
@@ -425,8 +425,10 @@ swfdec_as_string_split_6 (SwfdecAsContext *cx, SwfdecAsObject *object,
}
delim = swfdec_as_value_to_string (cx, &argv[0]);
if (str == SWFDEC_AS_STR_EMPTY) {
- SWFDEC_AS_VALUE_SET_STRING (&val, str);
- swfdec_as_array_push (arr, &val);
+ if (strlen (delim) > 0) {
+ SWFDEC_AS_VALUE_SET_STRING (&val, str);
+ swfdec_as_array_push (arr, &val);
+ }
return;
}
if (argc > 1 && !SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[1]))
diff --git a/test/trace/string-split-empty-5.swf b/test/trace/string-split-empty-5.swf
index 68bec93..be599b5 100644
Binary files a/test/trace/string-split-empty-5.swf and b/test/trace/string-split-empty-5.swf differ
diff --git a/test/trace/string-split-empty-5.swf.trace b/test/trace/string-split-empty-5.swf.trace
index fa02bf7..a7dbb6d 100644
--- a/test/trace/string-split-empty-5.swf.trace
+++ b/test/trace/string-split-empty-5.swf.trace
@@ -16,4 +16,10 @@ object
object
1
+
+object
+1
+hello
+object
+1
hello
diff --git a/test/trace/string-split-empty-6.swf b/test/trace/string-split-empty-6.swf
index c8431d1..3430f3d 100644
Binary files a/test/trace/string-split-empty-6.swf and b/test/trace/string-split-empty-6.swf differ
diff --git a/test/trace/string-split-empty-6.swf.trace b/test/trace/string-split-empty-6.swf.trace
index 316c1e7..826f6f5 100644
--- a/test/trace/string-split-empty-6.swf.trace
+++ b/test/trace/string-split-empty-6.swf.trace
@@ -12,8 +12,14 @@ object
1
object
+0
+
+object
1
object
+5
+h,e,l,l,o
+object
1
hello
diff --git a/test/trace/string-split-empty-7.swf b/test/trace/string-split-empty-7.swf
index d058e50..f46cc31 100644
Binary files a/test/trace/string-split-empty-7.swf and b/test/trace/string-split-empty-7.swf differ
diff --git a/test/trace/string-split-empty-7.swf.trace b/test/trace/string-split-empty-7.swf.trace
index 316c1e7..826f6f5 100644
--- a/test/trace/string-split-empty-7.swf.trace
+++ b/test/trace/string-split-empty-7.swf.trace
@@ -12,8 +12,14 @@ object
1
object
+0
+
+object
1
object
+5
+h,e,l,l,o
+object
1
hello
diff --git a/test/trace/string-split-empty-8.swf b/test/trace/string-split-empty-8.swf
index 501cf8a..762d2c0 100644
Binary files a/test/trace/string-split-empty-8.swf and b/test/trace/string-split-empty-8.swf differ
diff --git a/test/trace/string-split-empty-8.swf.trace b/test/trace/string-split-empty-8.swf.trace
index 316c1e7..826f6f5 100644
--- a/test/trace/string-split-empty-8.swf.trace
+++ b/test/trace/string-split-empty-8.swf.trace
@@ -12,8 +12,14 @@ object
1
object
+0
+
+object
1
object
+5
+h,e,l,l,o
+object
1
hello
diff --git a/test/trace/string-split-empty.as b/test/trace/string-split-empty.as
index 12ef59a..b01c29d 100644
--- a/test/trace/string-split-empty.as
+++ b/test/trace/string-split-empty.as
@@ -14,12 +14,23 @@ for (i = -1; i < 2; i++) {
trace (a);
}
+var a = s.split ("");
+trace (typeof (a));
+trace (a.length);
+trace (a);
+
var a = s.split ();
trace (typeof (a));
trace (a.length);
trace (a);
s = "hello";
+
+var a = s.split ("");
+trace (typeof (a));
+trace (a.length);
+trace (a);
+
var a = s.split ();
trace (typeof (a));
trace (a.length);
commit b7a157ce8afbda29221ac022efdd2be692191c09
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 16:02:02 2008 +0300
Add a test for String.valueOf
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 0f2a234..c999270 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -3525,6 +3525,15 @@ EXTRA_DIST = \
string-trace-6.swf.trace \
string-trace-7.swf \
string-trace-7.swf.trace \
+ string-valueof.as \
+ string-valueof-5.swf \
+ string-valueof-5.swf.trace \
+ string-valueof-6.swf \
+ string-valueof-6.swf.trace \
+ string-valueof-7.swf \
+ string-valueof-7.swf.trace \
+ string-valueof-8.swf \
+ string-valueof-8.swf.trace \
stringlength.as \
stringlength-5.swf \
stringlength-5.swf.trace \
diff --git a/test/trace/string-valueof-5.swf b/test/trace/string-valueof-5.swf
new file mode 100644
index 0000000..fd17c39
Binary files /dev/null and b/test/trace/string-valueof-5.swf differ
diff --git a/test/trace/string-valueof-5.swf.trace b/test/trace/string-valueof-5.swf.trace
new file mode 100644
index 0000000..9c5e9db
--- /dev/null
+++ b/test/trace/string-valueof-5.swf.trace
@@ -0,0 +1,316 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+hello
+string
+local.v = string : "hello"
+Testing: (0) (undefined)
+undefined
+undefined
+local.v = undefined
+Testing: (1) null (null)
+undefined
+undefined
+local.v = undefined
+Testing: (2) true (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (3) false (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (4) 0 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (5) 1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (6) 0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (7) -1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (8) -0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (9) Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (10) -Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (11) NaN (number)
+undefined
+undefined
+local.v = undefined
+Testing: (12) (string)
+undefined
+undefined
+local.v = undefined
+Testing: (13) 0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (14) -0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (15) 0.0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (16) 1 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (17) Hello World! (string)
+undefined
+undefined
+local.v = undefined
+Testing: (18) true (string)
+undefined
+undefined
+local.v = undefined
+Testing: (19) _level0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (20) äöü (string)
+undefined
+undefined
+local.v = undefined
+Testing: (21) _level0 (movieclip)
+_level0
+string
+local.v = string : "_level0"
+Testing: (22) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (23) 1239752134235.94 (object)
+Tue Apr 14 23:35:34 GMT+0000 2009
+string
+local.v = string : "Tue Apr 14 23:35:34 GMT+0000 2009"
+Testing: (24) (object)
+
+string
+local.v = string : ""
+Testing: (25) (undefined)
+undefined
+undefined
+local.v = undefined
+Testing: (26) [type Object] (object)
+toString called
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (27) [type Object] (object)
+toString called with
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (28) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (29) (object)
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (30) (object)
+0: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (31) null (object)
+1: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (32) true (object)
+2: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (33) false (object)
+3: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (34) 0 (object)
+4: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (35) 1 (object)
+5: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (36) 0.5 (object)
+6: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (37) -1 (object)
+7: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (38) -0.5 (object)
+8: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (39) Infinity (object)
+9: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (40) -Infinity (object)
+10: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (41) NaN (object)
+11: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (42) (object)
+12: toString!
+
+string
+local.v = string : ""
+Testing: (43) 0 (object)
+13: toString!
+0
+string
+local.v = string : "0"
+Testing: (44) -0 (object)
+14: toString!
+-0
+string
+local.v = string : "-0"
+Testing: (45) 0.0 (object)
+15: toString!
+0.0
+string
+local.v = string : "0.0"
+Testing: (46) 1 (object)
+16: toString!
+1
+string
+local.v = string : "1"
+Testing: (47) Hello World! (object)
+17: toString!
+Hello World!
+string
+local.v = string : "Hello World!"
+Testing: (48) true (object)
+18: toString!
+true
+string
+local.v = string : "true"
+Testing: (49) _level0 (object)
+19: toString!
+_level0
+string
+local.v = string : "_level0"
+Testing: (50) äöü (object)
+20: toString!
+äöü
+string
+local.v = string : "äöü"
+Testing: (51) _level0 (object)
+21: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (52) [type Object] (object)
+22: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (53) [type Object] (object)
+23: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (54) [type Object] (object)
+24: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (55) (object)
+25: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (56) [type Object] (object)
+26: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (57) [type Object] (object)
+27: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (58) [type Object] (object)
+28: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (59) [type Object] (object)
+29: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
diff --git a/test/trace/string-valueof-6.swf b/test/trace/string-valueof-6.swf
new file mode 100644
index 0000000..7c88674
Binary files /dev/null and b/test/trace/string-valueof-6.swf differ
diff --git a/test/trace/string-valueof-6.swf.trace b/test/trace/string-valueof-6.swf.trace
new file mode 100644
index 0000000..498bbb1
--- /dev/null
+++ b/test/trace/string-valueof-6.swf.trace
@@ -0,0 +1,317 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+25: toString!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+hello
+string
+local.v = string : "hello"
+Testing: (0) (undefined)
+undefined
+undefined
+local.v = undefined
+Testing: (1) null (null)
+undefined
+undefined
+local.v = undefined
+Testing: (2) true (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (3) false (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (4) 0 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (5) 1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (6) 0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (7) -1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (8) -0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (9) Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (10) -Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (11) NaN (number)
+undefined
+undefined
+local.v = undefined
+Testing: (12) (string)
+undefined
+undefined
+local.v = undefined
+Testing: (13) 0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (14) -0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (15) 0.0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (16) 1 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (17) Hello World! (string)
+undefined
+undefined
+local.v = undefined
+Testing: (18) true (string)
+undefined
+undefined
+local.v = undefined
+Testing: (19) _level0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (20) äöü (string)
+undefined
+undefined
+local.v = undefined
+Testing: (21) _level0 (movieclip)
+_level0
+string
+local.v = string : "_level0"
+Testing: (22) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (23) Tue Apr 14 23:35:34 GMT+0000 2009 (object)
+Tue Apr 14 23:35:34 GMT+0000 2009
+string
+local.v = string : "Tue Apr 14 23:35:34 GMT+0000 2009"
+Testing: (24) (object)
+
+string
+local.v = string : ""
+Testing: (25) [type Function] (function)
+[type Function]
+string
+local.v = string : "[type Function]"
+Testing: (26) [type Object] (object)
+toString called
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (27) [type Object] (object)
+toString called with
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (28) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (29) (object)
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (30) (object)
+0: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (31) null (object)
+1: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (32) true (object)
+2: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (33) false (object)
+3: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (34) 0 (object)
+4: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (35) 1 (object)
+5: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (36) 0.5 (object)
+6: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (37) -1 (object)
+7: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (38) -0.5 (object)
+8: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (39) Infinity (object)
+9: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (40) -Infinity (object)
+10: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (41) NaN (object)
+11: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (42) (object)
+12: toString!
+
+string
+local.v = string : ""
+Testing: (43) 0 (object)
+13: toString!
+0
+string
+local.v = string : "0"
+Testing: (44) -0 (object)
+14: toString!
+-0
+string
+local.v = string : "-0"
+Testing: (45) 0.0 (object)
+15: toString!
+0.0
+string
+local.v = string : "0.0"
+Testing: (46) 1 (object)
+16: toString!
+1
+string
+local.v = string : "1"
+Testing: (47) Hello World! (object)
+17: toString!
+Hello World!
+string
+local.v = string : "Hello World!"
+Testing: (48) true (object)
+18: toString!
+true
+string
+local.v = string : "true"
+Testing: (49) _level0 (object)
+19: toString!
+_level0
+string
+local.v = string : "_level0"
+Testing: (50) äöü (object)
+20: toString!
+äöü
+string
+local.v = string : "äöü"
+Testing: (51) _level0 (object)
+21: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (52) [type Object] (object)
+22: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (53) [type Object] (object)
+23: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (54) [type Object] (object)
+24: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (55) [type Object] (object)
+25: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (56) [type Object] (object)
+26: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (57) [type Object] (object)
+27: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (58) [type Object] (object)
+28: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (59) [type Object] (object)
+29: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
diff --git a/test/trace/string-valueof-7.swf b/test/trace/string-valueof-7.swf
new file mode 100644
index 0000000..c75a1ec
Binary files /dev/null and b/test/trace/string-valueof-7.swf differ
diff --git a/test/trace/string-valueof-7.swf.trace b/test/trace/string-valueof-7.swf.trace
new file mode 100644
index 0000000..e92ee58
--- /dev/null
+++ b/test/trace/string-valueof-7.swf.trace
@@ -0,0 +1,317 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+25: toString!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+hello
+string
+local.v = string : "hello"
+Testing: (0) undefined (undefined)
+undefined
+undefined
+local.v = undefined
+Testing: (1) null (null)
+undefined
+undefined
+local.v = undefined
+Testing: (2) true (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (3) false (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (4) 0 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (5) 1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (6) 0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (7) -1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (8) -0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (9) Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (10) -Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (11) NaN (number)
+undefined
+undefined
+local.v = undefined
+Testing: (12) (string)
+undefined
+undefined
+local.v = undefined
+Testing: (13) 0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (14) -0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (15) 0.0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (16) 1 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (17) Hello World! (string)
+undefined
+undefined
+local.v = undefined
+Testing: (18) true (string)
+undefined
+undefined
+local.v = undefined
+Testing: (19) _level0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (20) äöü (string)
+undefined
+undefined
+local.v = undefined
+Testing: (21) _level0 (movieclip)
+_level0
+string
+local.v = string : "_level0"
+Testing: (22) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (23) Tue Apr 14 23:35:34 GMT+0000 2009 (object)
+Tue Apr 14 23:35:34 GMT+0000 2009
+string
+local.v = string : "Tue Apr 14 23:35:34 GMT+0000 2009"
+Testing: (24) (object)
+
+string
+local.v = string : ""
+Testing: (25) [type Function] (function)
+[type Function]
+string
+local.v = string : "[type Function]"
+Testing: (26) [type Object] (object)
+toString called
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (27) [type Object] (object)
+toString called with
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (28) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (29) undefined (object)
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (30) undefined (object)
+0: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (31) null (object)
+1: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (32) true (object)
+2: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (33) false (object)
+3: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (34) 0 (object)
+4: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (35) 1 (object)
+5: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (36) 0.5 (object)
+6: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (37) -1 (object)
+7: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (38) -0.5 (object)
+8: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (39) Infinity (object)
+9: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (40) -Infinity (object)
+10: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (41) NaN (object)
+11: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (42) (object)
+12: toString!
+
+string
+local.v = string : ""
+Testing: (43) 0 (object)
+13: toString!
+0
+string
+local.v = string : "0"
+Testing: (44) -0 (object)
+14: toString!
+-0
+string
+local.v = string : "-0"
+Testing: (45) 0.0 (object)
+15: toString!
+0.0
+string
+local.v = string : "0.0"
+Testing: (46) 1 (object)
+16: toString!
+1
+string
+local.v = string : "1"
+Testing: (47) Hello World! (object)
+17: toString!
+Hello World!
+string
+local.v = string : "Hello World!"
+Testing: (48) true (object)
+18: toString!
+true
+string
+local.v = string : "true"
+Testing: (49) _level0 (object)
+19: toString!
+_level0
+string
+local.v = string : "_level0"
+Testing: (50) äöü (object)
+20: toString!
+äöü
+string
+local.v = string : "äöü"
+Testing: (51) _level0 (object)
+21: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (52) [type Object] (object)
+22: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (53) [type Object] (object)
+23: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (54) [type Object] (object)
+24: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (55) [type Object] (object)
+25: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (56) [type Object] (object)
+26: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (57) [type Object] (object)
+27: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (58) [type Object] (object)
+28: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (59) [type Object] (object)
+29: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
diff --git a/test/trace/string-valueof-8.swf b/test/trace/string-valueof-8.swf
new file mode 100644
index 0000000..d06963b
Binary files /dev/null and b/test/trace/string-valueof-8.swf differ
diff --git a/test/trace/string-valueof-8.swf.trace b/test/trace/string-valueof-8.swf.trace
new file mode 100644
index 0000000..e92ee58
--- /dev/null
+++ b/test/trace/string-valueof-8.swf.trace
@@ -0,0 +1,317 @@
+valueOf called
+toString called
+toString called with
+valueOf called with
+0: valueOf!
+1: valueOf!
+2: valueOf!
+3: valueOf!
+4: valueOf!
+5: valueOf!
+6: valueOf!
+7: valueOf!
+8: valueOf!
+9: valueOf!
+10: valueOf!
+11: valueOf!
+12: valueOf!
+13: valueOf!
+14: valueOf!
+15: valueOf!
+16: valueOf!
+17: valueOf!
+18: valueOf!
+19: valueOf!
+20: valueOf!
+21: valueOf!
+22: valueOf!
+22: toString!
+23: valueOf!
+23: toString!
+24: valueOf!
+24: toString!
+25: valueOf!
+25: toString!
+26: valueOf!
+26: toString!
+27: valueOf!
+27: toString!
+28: valueOf!
+28: toString!
+29: valueOf!
+29: toString!
+hello
+string
+local.v = string : "hello"
+Testing: (0) undefined (undefined)
+undefined
+undefined
+local.v = undefined
+Testing: (1) null (null)
+undefined
+undefined
+local.v = undefined
+Testing: (2) true (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (3) false (boolean)
+undefined
+undefined
+local.v = undefined
+Testing: (4) 0 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (5) 1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (6) 0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (7) -1 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (8) -0.5 (number)
+undefined
+undefined
+local.v = undefined
+Testing: (9) Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (10) -Infinity (number)
+undefined
+undefined
+local.v = undefined
+Testing: (11) NaN (number)
+undefined
+undefined
+local.v = undefined
+Testing: (12) (string)
+undefined
+undefined
+local.v = undefined
+Testing: (13) 0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (14) -0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (15) 0.0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (16) 1 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (17) Hello World! (string)
+undefined
+undefined
+local.v = undefined
+Testing: (18) true (string)
+undefined
+undefined
+local.v = undefined
+Testing: (19) _level0 (string)
+undefined
+undefined
+local.v = undefined
+Testing: (20) äöü (string)
+undefined
+undefined
+local.v = undefined
+Testing: (21) _level0 (movieclip)
+_level0
+string
+local.v = string : "_level0"
+Testing: (22) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (23) Tue Apr 14 23:35:34 GMT+0000 2009 (object)
+Tue Apr 14 23:35:34 GMT+0000 2009
+string
+local.v = string : "Tue Apr 14 23:35:34 GMT+0000 2009"
+Testing: (24) (object)
+
+string
+local.v = string : ""
+Testing: (25) [type Function] (function)
+[type Function]
+string
+local.v = string : "[type Function]"
+Testing: (26) [type Object] (object)
+toString called
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (27) [type Object] (object)
+toString called with
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (28) [object Object] (object)
+[object Object]
+string
+local.v = string : "[object Object]"
+Testing: (29) undefined (object)
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (30) undefined (object)
+0: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (31) null (object)
+1: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (32) true (object)
+2: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (33) false (object)
+3: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (34) 0 (object)
+4: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (35) 1 (object)
+5: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (36) 0.5 (object)
+6: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (37) -1 (object)
+7: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (38) -0.5 (object)
+8: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (39) Infinity (object)
+9: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (40) -Infinity (object)
+10: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (41) NaN (object)
+11: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (42) (object)
+12: toString!
+
+string
+local.v = string : ""
+Testing: (43) 0 (object)
+13: toString!
+0
+string
+local.v = string : "0"
+Testing: (44) -0 (object)
+14: toString!
+-0
+string
+local.v = string : "-0"
+Testing: (45) 0.0 (object)
+15: toString!
+0.0
+string
+local.v = string : "0.0"
+Testing: (46) 1 (object)
+16: toString!
+1
+string
+local.v = string : "1"
+Testing: (47) Hello World! (object)
+17: toString!
+Hello World!
+string
+local.v = string : "Hello World!"
+Testing: (48) true (object)
+18: toString!
+true
+string
+local.v = string : "true"
+Testing: (49) _level0 (object)
+19: toString!
+_level0
+string
+local.v = string : "_level0"
+Testing: (50) äöü (object)
+20: toString!
+äöü
+string
+local.v = string : "äöü"
+Testing: (51) _level0 (object)
+21: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (52) [type Object] (object)
+22: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (53) [type Object] (object)
+23: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (54) [type Object] (object)
+24: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (55) [type Object] (object)
+25: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (56) [type Object] (object)
+26: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (57) [type Object] (object)
+27: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (58) [type Object] (object)
+28: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
+Testing: (59) [type Object] (object)
+29: toString!
+[type Object]
+string
+local.v = string : "[type Object]"
diff --git a/test/trace/string-valueof.as b/test/trace/string-valueof.as
new file mode 100644
index 0000000..7c56a07
--- /dev/null
+++ b/test/trace/string-valueof.as
@@ -0,0 +1,31 @@
+// makeswf -v 7 -s 200x150 -r 15 -o string-valueof.swf string-valueof.as
+
+#include "trace_properties.as"
+#include "values.as"
+
+var s = new String ("hello");
+s.valueOf = function () {
+ trace ("s.valueOf");
+ return "s.valueOf";
+};
+s.toString = function () {
+ trace ("s.toString");
+ return "s.toString";
+};
+s.stringValueOf = String.prototype.valueOf;
+var v = s.stringValueOf ();
+trace (v);
+trace (typeof (v));
+trace_properties (v, "local", "v");
+
+for (var i = 0; i < values.length; i++) {
+ trace ("Testing: " + names[i]);
+ var o = values[i];
+ o.stringValueOf = String.prototype.valueOf;
+ var v = o.stringValueOf ();
+ trace (v);
+ trace (typeof (v));
+ trace_properties (v, "local", "v");
+}
+
+getURL ("fscommand:quit", "");
commit 78904a299c998206d50606e05d941ef29e6b597a
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 16:01:27 2008 +0300
Make String.valueOf work corrently when called on non-string objects
diff --git a/swfdec/swfdec_as_string.c b/swfdec/swfdec_as_string.c
index 1f7505e..058b213 100644
--- a/swfdec/swfdec_as_string.c
+++ b/swfdec/swfdec_as_string.c
@@ -336,10 +336,18 @@ void
swfdec_as_string_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
- if (!SWFDEC_IS_AS_STRING (object))
+ if (object == NULL)
return;
- SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STRING (object)->string);
+ if (SWFDEC_IS_AS_STRING (object)) {
+ SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STRING (object)->string);
+ } else {
+ SwfdecAsValue val;
+
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, object);
+ SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_value_to_string (cx, &val));
+ }
+
}
static void
commit c24f4d1cfec27587132d2803beceff50feaa4231
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 15:27:51 2008 +0300
Add a test for various string functions with multi byte characters
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 8906043..0f2a234 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -3441,6 +3441,15 @@ EXTRA_DIST = \
string-length-old-mb-7.swf.trace \
string-length-old-mb-8.swf \
string-length-old-mb-8.swf.trace \
+ string-non-ascii.as \
+ string-non-ascii-5.swf \
+ string-non-ascii-5.swf.trace \
+ string-non-ascii-6.swf \
+ string-non-ascii-6.swf.trace \
+ string-non-ascii-7.swf \
+ string-non-ascii-7.swf.trace \
+ string-non-ascii-8.swf \
+ string-non-ascii-8.swf.trace \
string-object-tostring.as \
string-object-tostring-5.swf \
string-object-tostring-5.swf.trace \
diff --git a/test/trace/string-non-ascii-5.swf b/test/trace/string-non-ascii-5.swf
new file mode 100644
index 0000000..2c21b4f
Binary files /dev/null and b/test/trace/string-non-ascii-5.swf differ
diff --git a/test/trace/string-non-ascii-5.swf.trace b/test/trace/string-non-ascii-5.swf.trace
new file mode 100644
index 0000000..9448529
--- /dev/null
+++ b/test/trace/string-non-ascii-5.swf.trace
@@ -0,0 +1,11 @@
+öLö ääGH
+ã¶l㶠ã¤ã¤gh
+
+32
+ölö ääghÃÂ¥ ÃÂ¥ÃÂ¥ ÃÂ¥!
+6
+3
+ö
+ö
+ölö äägh
+ö ä
diff --git a/test/trace/string-non-ascii-6.swf b/test/trace/string-non-ascii-6.swf
new file mode 100644
index 0000000..026e821
Binary files /dev/null and b/test/trace/string-non-ascii-6.swf differ
diff --git a/test/trace/string-non-ascii-6.swf.trace b/test/trace/string-non-ascii-6.swf.trace
new file mode 100644
index 0000000..034ced1
--- /dev/null
+++ b/test/trace/string-non-ascii-6.swf.trace
@@ -0,0 +1,11 @@
+ÃLÃ ÃÃGH
+ölö äägh
+ä
+228
+ölö ääghå åå å!
+4
+2
+ ä
+ ä
+ölö ,,gh
+ äägh
diff --git a/test/trace/string-non-ascii-7.swf b/test/trace/string-non-ascii-7.swf
new file mode 100644
index 0000000..dc48d19
Binary files /dev/null and b/test/trace/string-non-ascii-7.swf differ
diff --git a/test/trace/string-non-ascii-7.swf.trace b/test/trace/string-non-ascii-7.swf.trace
new file mode 100644
index 0000000..034ced1
--- /dev/null
+++ b/test/trace/string-non-ascii-7.swf.trace
@@ -0,0 +1,11 @@
+ÃLÃ ÃÃGH
+ölö äägh
+ä
+228
+ölö ääghå åå å!
+4
+2
+ ä
+ ä
+ölö ,,gh
+ äägh
diff --git a/test/trace/string-non-ascii-8.swf b/test/trace/string-non-ascii-8.swf
new file mode 100644
index 0000000..dd18ea7
Binary files /dev/null and b/test/trace/string-non-ascii-8.swf differ
diff --git a/test/trace/string-non-ascii-8.swf.trace b/test/trace/string-non-ascii-8.swf.trace
new file mode 100644
index 0000000..034ced1
--- /dev/null
+++ b/test/trace/string-non-ascii-8.swf.trace
@@ -0,0 +1,11 @@
+ÃLÃ ÃÃGH
+ölö äägh
+ä
+228
+ölö ääghå åå å!
+4
+2
+ ä
+ ä
+ölö ,,gh
+ äägh
diff --git a/test/trace/string-non-ascii.as b/test/trace/string-non-ascii.as
new file mode 100644
index 0000000..889a263
--- /dev/null
+++ b/test/trace/string-non-ascii.as
@@ -0,0 +1,17 @@
+// makeswf -v 7 -r 15 -o string-non-ascii-7.swf string-non-ascii.as
+
+var s = "ölö äägh";
+
+trace (s.toUpperCase ());
+trace (s.toLowerCase ());
+trace (s.charAt (5));
+trace (s.charCodeAt (5));
+trace (s.concat ("å ", "åå", " å!"));
+trace (s.indexOf ("ä"));
+trace (s.lastIndexOf ("ö"));
+trace (s.slice (3, 5));
+trace (s.substring (3, 5));
+trace (s.split ("ä"));
+trace (s.substr (3, 5));
+
+getURL ("FSCommand:quit", "");
commit bb225f93c2fd3aee69a5fee3b8e56a4ff9b83e89
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 15:26:21 2008 +0300
Fix String.slice for multi byte characters
diff --git a/swfdec/swfdec_as_string.c b/swfdec/swfdec_as_string.c
index eba21cb..1f7505e 100644
--- a/swfdec/swfdec_as_string.c
+++ b/swfdec/swfdec_as_string.c
@@ -473,7 +473,7 @@ swfdec_as_string_slice (SwfdecAsContext *cx, SwfdecAsObject *object,
return;
str = swfdec_as_string_object_to_string (cx, object);
- length = strlen (str);
+ length = g_utf8_strlen (str, -1);
start = swfdec_as_value_to_integer (cx, &argv[0]);
if (start < 0)
@@ -490,7 +490,7 @@ swfdec_as_string_slice (SwfdecAsContext *cx, SwfdecAsObject *object,
}
SWFDEC_AS_VALUE_SET_STRING (ret,
- swfdec_as_context_give_string (cx, g_strndup (str + start, end - start)));
+ swfdec_as_str_sub (cx, str, start, end - start));
}
SWFDEC_AS_NATIVE (251, 7, swfdec_as_string_concat)
commit bfc4203f3eca7178703c543b8987b64b2b2e5911
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 14:53:51 2008 +0300
Fix String.split's behaviour when called without arguments. Added to a test.
string-split-empty test was expanded to include testing of this case
diff --git a/swfdec/swfdec_as_string.c b/swfdec/swfdec_as_string.c
index 16c5d6d..eba21cb 100644
--- a/swfdec/swfdec_as_string.c
+++ b/swfdec/swfdec_as_string.c
@@ -351,16 +351,13 @@ swfdec_as_string_split_5 (SwfdecAsContext *cx, SwfdecAsObject *object,
const char *str, *end, *delim;
int count;
- if (argc < 1)
- return;
-
str = swfdec_as_string_object_to_string (cx, object);
arr = SWFDEC_AS_ARRAY (swfdec_as_array_new (cx));
if (arr == NULL)
return;
SWFDEC_AS_VALUE_SET_OBJECT (ret, SWFDEC_AS_OBJECT (arr));
/* hi, i'm the special case */
- if (SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[0])) {
+ if (argc < 1 || SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[0])) {
delim = SWFDEC_AS_STR_COMMA;
} else {
delim = swfdec_as_value_to_string (cx, &argv[0]);
@@ -407,16 +404,13 @@ swfdec_as_string_split_6 (SwfdecAsContext *cx, SwfdecAsObject *object,
int count;
guint len;
- if (argc < 1)
- return;
-
str = swfdec_as_string_object_to_string (cx, object);
arr = SWFDEC_AS_ARRAY (swfdec_as_array_new (cx));
if (arr == NULL)
return;
SWFDEC_AS_VALUE_SET_OBJECT (ret, SWFDEC_AS_OBJECT (arr));
/* hi, i'm the special case */
- if (SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[0])) {
+ if (argc < 1 || SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[0])) {
SWFDEC_AS_VALUE_SET_STRING (&val, str);
swfdec_as_array_push (arr, &val);
return;
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 551e263..8906043 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -3498,6 +3498,8 @@ EXTRA_DIST = \
string-split-empty-6.swf.trace \
string-split-empty-7.swf \
string-split-empty-7.swf.trace \
+ string-split-empty-8.swf \
+ string-split-empty-8.swf.trace \
string-to-number.as \
string-to-number-5.swf \
string-to-number-5.swf.trace \
diff --git a/test/trace/string-split-empty-5.swf b/test/trace/string-split-empty-5.swf
index afab696..68bec93 100644
Binary files a/test/trace/string-split-empty-5.swf and b/test/trace/string-split-empty-5.swf differ
diff --git a/test/trace/string-split-empty-5.swf.trace b/test/trace/string-split-empty-5.swf.trace
index c3496f3..fa02bf7 100644
--- a/test/trace/string-split-empty-5.swf.trace
+++ b/test/trace/string-split-empty-5.swf.trace
@@ -1,4 +1,4 @@
-Check String.split() on empty string
+Check String.split() on empty string or without parameters
object
1
@@ -11,3 +11,9 @@ object
object
1
+object
+1
+
+object
+1
+hello
diff --git a/test/trace/string-split-empty-6.swf b/test/trace/string-split-empty-6.swf
index e922169..c8431d1 100644
Binary files a/test/trace/string-split-empty-6.swf and b/test/trace/string-split-empty-6.swf differ
diff --git a/test/trace/string-split-empty-6.swf.trace b/test/trace/string-split-empty-6.swf.trace
index c647cab..316c1e7 100644
--- a/test/trace/string-split-empty-6.swf.trace
+++ b/test/trace/string-split-empty-6.swf.trace
@@ -1,4 +1,4 @@
-Check String.split() on empty string
+Check String.split() on empty string or without parameters
object
1
@@ -11,3 +11,9 @@ object
object
1
+object
+1
+
+object
+1
+hello
diff --git a/test/trace/string-split-empty-7.swf b/test/trace/string-split-empty-7.swf
index 4ce442a..d058e50 100644
Binary files a/test/trace/string-split-empty-7.swf and b/test/trace/string-split-empty-7.swf differ
diff --git a/test/trace/string-split-empty-7.swf.trace b/test/trace/string-split-empty-7.swf.trace
index c647cab..316c1e7 100644
--- a/test/trace/string-split-empty-7.swf.trace
+++ b/test/trace/string-split-empty-7.swf.trace
@@ -1,4 +1,4 @@
-Check String.split() on empty string
+Check String.split() on empty string or without parameters
object
1
@@ -11,3 +11,9 @@ object
object
1
+object
+1
+
+object
+1
+hello
diff --git a/test/trace/string-split-empty-8.swf b/test/trace/string-split-empty-8.swf
new file mode 100644
index 0000000..501cf8a
Binary files /dev/null and b/test/trace/string-split-empty-8.swf differ
diff --git a/test/trace/string-split-empty-8.swf.trace b/test/trace/string-split-empty-8.swf.trace
new file mode 100644
index 0000000..316c1e7
--- /dev/null
+++ b/test/trace/string-split-empty-8.swf.trace
@@ -0,0 +1,19 @@
+Check String.split() on empty string or without parameters
+object
+1
+
+object
+1
+
+object
+1
+
+object
+1
+
+object
+1
+
+object
+1
+hello
diff --git a/test/trace/string-split-empty.as b/test/trace/string-split-empty.as
index 68b4390..12ef59a 100644
--- a/test/trace/string-split-empty.as
+++ b/test/trace/string-split-empty.as
@@ -1,9 +1,9 @@
// makeswf -v 7 -s 200x150 -r 1 -o string-split-empty.swf string-split-empty.as
-trace ("Check String.split() on empty string");
+trace ("Check String.split() on empty string or without parameters");
-s = "";
-a = s.split ("x");
+var s = "";
+var a = s.split ("x");
trace (typeof (a));
trace (a.length);
trace (a);
@@ -14,4 +14,15 @@ for (i = -1; i < 2; i++) {
trace (a);
}
-loadMovie ("FSCommand:quit", "");
+var a = s.split ();
+trace (typeof (a));
+trace (a.length);
+trace (a);
+
+s = "hello";
+var a = s.split ();
+trace (typeof (a));
+trace (a.length);
+trace (a);
+
+getURL ("FSCommand:quit", "");
diff --git a/test/trace/string-split.as b/test/trace/string-split.as
index 97f266a..a020b2d 100644
--- a/test/trace/string-split.as
+++ b/test/trace/string-split.as
@@ -5,6 +5,8 @@ trace ("Check String.split()");
#include "values.as"
s = new String ("aaaa");
+trace (s.split ());
+trace (typeof (s.split ()));
trace (s.split ("a"));
trace (s.split ("a", 3));
trace (s.split ("a", -2));
commit a9930c557e5d731800807921d9620c36e80f2ac7
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 14:43:40 2008 +0300
Update object-properties test to be more complete.
One part of it is disabled for now though, since Swfdec doesn't pass
diff --git a/test/trace/object-properties-5.swf b/test/trace/object-properties-5.swf
index 9c9c183..21552ce 100644
Binary files a/test/trace/object-properties-5.swf and b/test/trace/object-properties-5.swf differ
diff --git a/test/trace/object-properties-5.swf.trace b/test/trace/object-properties-5.swf.trace
index f91fb6c..08f97c9 100644
--- a/test/trace/object-properties-5.swf.trace
+++ b/test/trace/object-properties-5.swf.trace
@@ -50,5 +50,15 @@ local.a = object
__proto__ (hp) = _global.Object.prototype
constructor (h) = _global.Object
local.b = object
+ no children
+local.c = object
__proto__ (hp) = _global.Object.prototype
constructor (hp) = _global.Object
+local.e = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
+local.f = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
diff --git a/test/trace/object-properties-6.swf b/test/trace/object-properties-6.swf
index 4476d6e..540abd3 100644
Binary files a/test/trace/object-properties-6.swf and b/test/trace/object-properties-6.swf differ
diff --git a/test/trace/object-properties-6.swf.trace b/test/trace/object-properties-6.swf.trace
index 3468245..2c6d1cf 100644
--- a/test/trace/object-properties-6.swf.trace
+++ b/test/trace/object-properties-6.swf.trace
@@ -41,5 +41,15 @@ local.a = object
__proto__ (hp) = _global.Object.prototype
constructor (h) = _global.Object
local.b = object
+ no children
+local.c = object
__proto__ (hp) = _global.Object.prototype
constructor (hp) = _global.Object
+local.e = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
+local.f = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
diff --git a/test/trace/object-properties-7.swf b/test/trace/object-properties-7.swf
index 8ac3d61..211c2c5 100644
Binary files a/test/trace/object-properties-7.swf and b/test/trace/object-properties-7.swf differ
diff --git a/test/trace/object-properties-7.swf.trace b/test/trace/object-properties-7.swf.trace
index 7f22a1a..784c496 100644
--- a/test/trace/object-properties-7.swf.trace
+++ b/test/trace/object-properties-7.swf.trace
@@ -40,5 +40,15 @@ local.a = object
__constructor__ (h) = _global.Object
__proto__ (hp) = _global.Object.prototype
local.b = object
+ no children
+local.c = object
__proto__ (hp) = _global.Object.prototype
constructor (hp) = _global.Object
+local.e = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
+local.f = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
diff --git a/test/trace/object-properties-8.swf b/test/trace/object-properties-8.swf
index 91f8be4..901dba2 100644
Binary files a/test/trace/object-properties-8.swf and b/test/trace/object-properties-8.swf differ
diff --git a/test/trace/object-properties-8.swf.trace b/test/trace/object-properties-8.swf.trace
index 7f22a1a..784c496 100644
--- a/test/trace/object-properties-8.swf.trace
+++ b/test/trace/object-properties-8.swf.trace
@@ -40,5 +40,15 @@ local.a = object
__constructor__ (h) = _global.Object
__proto__ (hp) = _global.Object.prototype
local.b = object
+ no children
+local.c = object
__proto__ (hp) = _global.Object.prototype
constructor (hp) = _global.Object
+local.e = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
+local.f = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Object
+ x = number : 1
diff --git a/test/trace/object-properties.as b/test/trace/object-properties.as
index 2482772..7a1a893 100644
--- a/test/trace/object-properties.as
+++ b/test/trace/object-properties.as
@@ -3,10 +3,19 @@
#include "trace_properties.as"
var a = new Object ();
-var b = { };
+var b = Object ();
+var c = {};
+// FIXME: doesn't work in Swfdec currently
+//var d = new Object ({ x: 1 });
+var e = Object ({ x: 1 });
+var f = { x: 1 };
trace_properties (_global.Object, "_global", "Object");
trace_properties (a, "local", "a");
trace_properties (b, "local", "b");
+trace_properties (c, "local", "c");
+//trace_properties (d, "local", "d");
+trace_properties (e, "local", "e");
+trace_properties (f, "local", "f");
-loadMovie ("FSCommand:quit", "");
+getURL ("FSCommand:quit", "");
commit 0aa21654b7248d641818155d023d1c7921e4e6e1
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 14:39:13 2008 +0300
Make Object () action script call work correctly
new Object () with an argument doesn't work right currently
diff --git a/swfdec/swfdec_as_object.c b/swfdec/swfdec_as_object.c
index e6a7862..b2dbb96 100644
--- a/swfdec/swfdec_as_object.c
+++ b/swfdec/swfdec_as_object.c
@@ -1696,6 +1696,29 @@ swfdec_as_object_decode (SwfdecAsObject *object, const char *str)
g_strfreev (varlist);
}
+static void
+swfdec_as_object_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+ if (argc > 0) {
+ SwfdecAsObject *result = swfdec_as_value_to_object (cx, &argv[0]);
+ if (result != NULL) {
+ if (!cx->frame->construct) {
+ SWFDEC_AS_VALUE_SET_OBJECT (ret, result);
+ } else {
+ SWFDEC_FIXME ("new Object (x) should return x");
+ SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
+ }
+ return;
+ }
+ }
+
+ if (!cx->frame->construct)
+ object = swfdec_as_object_new_empty (cx);
+
+ SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
+}
+
void
swfdec_as_object_init_context (SwfdecAsContext *context)
{
@@ -1706,7 +1729,7 @@ swfdec_as_object_init_context (SwfdecAsContext *context)
if (!proto)
return;
object = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
- SWFDEC_AS_STR_Object, 0, NULL, 0));
+ SWFDEC_AS_STR_Object, 0, swfdec_as_object_construct, 0));
if (!object)
return;
context->Object = object;
commit ef9ca0cc228eb7ed60057ca08e85fd93cd38f02e
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Jul 10 13:17:18 2008 +0300
Add more stubs for NetStream's properties
Actually all the properties handled in swfdec_net_stream_get_variable should be added as native properties to the prototype when new NetStream is constructed with a NetConnection that is connected
diff --git a/swfdec/swfdec_as_strings.c b/swfdec/swfdec_as_strings.c
index 126713a..a5a41b0 100644
--- a/swfdec/swfdec_as_strings.c
+++ b/swfdec/swfdec_as_strings.c
@@ -517,5 +517,10 @@ const char swfdec_as_strings[] =
SWFDEC_AS_CONSTANT_STRING ("Transform")
SWFDEC_AS_CONSTANT_STRING ("bufferLength")
SWFDEC_AS_CONSTANT_STRING ("bufferTime")
+ SWFDEC_AS_CONSTANT_STRING ("audiocodec")
+ SWFDEC_AS_CONSTANT_STRING ("currentFps")
+ SWFDEC_AS_CONSTANT_STRING ("decodedFrames")
+ SWFDEC_AS_CONSTANT_STRING ("liveDelay")
+ SWFDEC_AS_CONSTANT_STRING ("videoCodec")
/* add more here */
;
diff --git a/swfdec/swfdec_net_stream.c b/swfdec/swfdec_net_stream.c
index 885b634..3687436 100644
--- a/swfdec/swfdec_net_stream.c
+++ b/swfdec/swfdec_net_stream.c
@@ -510,6 +510,16 @@ swfdec_net_stream_get_variable (SwfdecAsObject *object, SwfdecAsObject *orig,
SWFDEC_STUB ("Netstream.bufferLength (get)");
} else if (variable == SWFDEC_AS_STR_bufferTime) {
SWFDEC_STUB ("Netstream.bufferTime (get)");
+ } else if (variable == SWFDEC_AS_STR_audiocodec) {
+ SWFDEC_STUB ("Netstream.audiocodec (get)");
+ } else if (variable == SWFDEC_AS_STR_currentFps) {
+ SWFDEC_STUB ("Netstream.currentFps (get)");
+ } else if (variable == SWFDEC_AS_STR_decodedFrames) {
+ SWFDEC_STUB ("Netstream.decodedFrames (get)");
+ } else if (variable == SWFDEC_AS_STR_liveDelay) {
+ SWFDEC_STUB ("Netstream.liveDelay (get)");
+ } else if (variable == SWFDEC_AS_STR_videoCodec) {
+ SWFDEC_STUB ("Netstream.videoCodec (get)");
}
return FALSE;
}
More information about the Swfdec-commits
mailing list