gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r10087: add new directory for real ne


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r10087: add new directory for real networking tests.
Date: Tue, 31 Mar 2009 20:49:29 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10087
committer: address@hidden
branch nick: rtmp
timestamp: Tue 2009-03-31 20:49:29 -0600
message:
  add new directory for real networking tests.
added:
  testsuite/network.all/
  testsuite/network.all/Dejagnu.c
  testsuite/network.all/Makefile.am
  testsuite/network.all/http.as
  testsuite/network.all/netstream.as
  testsuite/network.all/network.exp
  testsuite/network.all/remoting.README
  testsuite/network.all/rtmp.as
modified:
  configure.ac
  testsuite/Makefile.am
=== modified file 'configure.ac'
--- a/configure.ac      2009-03-16 23:34:13 +0000
+++ b/configure.ac      2009-04-01 02:49:29 +0000
@@ -2197,8 +2197,8 @@
 dnl AC_CONFIG_LINKS(doc/C/images)
 dnl AC_CONFIG_LINKS(gnashconfig.h,libltdl/config.h)
 
AC_CONFIG_LINKS(cygnal/testsuite/cygnal.all/cygnalrc:cygnal/testsuite/cygnal.all/cygnalrc.in)
-AC_CONFIG_LINKS(testsuite/libbase/gnashrc:testsuite/libbase/gnashrc.in)
-AC_CONFIG_LINKS(testsuite/libbase/gnashrc-local:testsuite/libbase/gnashrc-local.in)
+AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc:testsuite/libbase.all/gnashrc.in)
+AC_CONFIG_LINKS(testsuite/libbase.all/gnashrc-local:testsuite/libbase.all/gnashrc-local.in)
 
 AC_OUTPUT(Makefile
 po/Makefile
@@ -2219,7 +2219,7 @@
 pythonmodule/Makefile
 testsuite/Makefile
 testsuite/media/Makefile
-testsuite/libbase/Makefile
+testsuite/libbase.all/Makefile
 testsuite/actionscript.all/Makefile
 testsuite/samples/Makefile
 testsuite/swfdec/Makefile
@@ -2228,6 +2228,7 @@
 testsuite/misc-haxe.all/Makefile
 testsuite/misc-swfmill.all/Makefile
 testsuite/misc-swfc.all/Makefile
+testsuite/network.all/Makefile
 testsuite/movies.all/Makefile
 testsuite/libcore.all/Makefile
 testsuite/libamf.all/Makefile

=== modified file 'testsuite/Makefile.am'
--- a/testsuite/Makefile.am     2009-02-25 22:33:03 +0000
+++ b/testsuite/Makefile.am     2009-04-01 02:49:29 +0000
@@ -18,7 +18,7 @@
 AUTOMAKE_OPTIONS = 
 
 if ENABLE_MING
-DIR_MING = misc-ming.all actionscript.all
+DIR_MING = misc-ming.all actionscript.all network.all
 endif
 
 if ENABLE_MTASC
@@ -44,10 +44,11 @@
 DIST_SUBDIRS = \
        media \
        actionscript.all \
-       libbase \
+       libbase.all     \
        libamf.all \
        libnet.all \
        libcore.all \
+       network.all \
        samples \
        swfdec \
        misc-ming.all \
@@ -63,7 +64,8 @@
        media \
        $(DIR_SWFDEC_TESTSUITE) \
        libnet.all \
-       libbase \
+       libbase.all     \
+       network.all \
        libamf.all \
        libcore.all \
        samples \

=== added directory 'testsuite/network.all'
=== added file 'testsuite/network.all/Dejagnu.c'
--- a/testsuite/network.all/Dejagnu.c   1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/Dejagnu.c   2009-04-01 02:49:29 +0000
@@ -0,0 +1,95 @@
+/* 
+ *   Copyright (C) 2005, 2006, 2009 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
+ *
+ *
+ */ 
+
+/*
+ * Generate a Dejagnu.swf file for import from self-contained
+ * SWF testcases
+ *
+ * run as ./Dejagnu <mediadir>
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 5
+#define OUTPUT_FILENAME "Dejagnu.swf"
+
+int
+main(int argc, char** argv)
+{
+       SWFMovie mo;
+       SWFMovieClip dejaclip;
+       const char *srcdir=".";
+       SWFFont bfont; 
+
+
+       /*********************************************
+        *
+        * Initialization
+        *
+        *********************************************/
+
+       if ( argc>1 ) srcdir=argv[1];
+       else
+       {
+               fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
+               return 1;
+       }
+
+       puts("Setting things up");
+
+       Ming_init();
+        Ming_useSWFVersion (OUTPUT_VERSION);
+       Ming_setScale(20.0); /* let's talk pixels */
+ 
+       mo = newSWFMovie();
+       SWFMovie_setRate(mo, 1);
+       SWFMovie_setDimension(mo, 628, 1024);
+
+       bfont = get_default_font(srcdir);
+
+       /*********************************************
+        *
+        * Body
+        *
+        *********************************************/
+
+       dejaclip = get_dejagnu_clip((SWFBlock)bfont, 3000, 0, 50, 800, 800);
+
+       SWFMovie_add(mo, (SWFBlock)dejaclip);
+       SWFMovie_addExport(mo, (SWFBlock)dejaclip, "dejagnu");
+
+       SWFMovie_nextFrame(mo); /* showFrame */
+
+
+       /*****************************************************
+        *
+        * Output movie
+        *
+        *****************************************************/
+
+       puts("Saving " OUTPUT_FILENAME );
+
+       SWFMovie_save(mo, OUTPUT_FILENAME);
+
+       return 0;
+}

=== added file 'testsuite/network.all/Makefile.am'
--- a/testsuite/network.all/Makefile.am 1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/Makefile.am 2009-04-01 02:49:29 +0000
@@ -0,0 +1,140 @@
+## Process this file with automake to generate Makefile.in
+# 
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 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
+
+AUTOMAKE_OPTIONS = dejagnu -Wno-portability
+
+abs_top_builddir=$(shell cd $(top_builddir); pwd)
+abs_builddir=$(shell cd $(top_builddir)/testsuite/network.all; pwd)
+abs_mediadir = $(shell cd $(srcdir)/../media; pwd)
+
+CLEANFILES =  \
+       gnash-dbg.log \
+       site.exp.bak \
+       testrun.sum \
+       testrun.log
+
+EXTRA_DIST = \
+       http.as \
+       rtmp.as \
+       netstream.as
+
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/libbase \
+       -I$(top_srcdir)/libmedia \
+       -I$(top_srcdir)/libsound \
+       -I$(top_srcdir)/backend \
+       -I$(top_srcdir)/libcore  \
+       -I$(top_srcdir)/libcore/parser  \
+       -I$(top_srcdir)/libcore/vm \
+       -I$(top_srcdir)/libcore/asobj \
+       -I$(top_srcdir)/testsuite \
+       -I$(top_srcdir)/testsuite/misc-ming.all \
+       $(MING_CFLAGS) \
+       $(OPENGL_CFLAGS) \
+       $(BOOST_CFLAGS) \
+       -DMING_VERSION_CODE=$(MING_VERSION_CODE) \
+       $(NULL)
+
+AM_LDFLAGS = \
+       $(MING_LIBS) \
+       $(OPENGL_LIBS) \
+       $(GIF_LIBS) \
+       $(NULL)
+
+check_PROGRAMS = \
+       Dejagnu \
+       Dejagnu.swf \
+       $(NULL)
+
+check_SCRIPTS = \
+       http.swf \
+       rtmp.swf
+
+# if MAKESWF_SUPPORTS_PREBUILT_CLIPS
+#   check_SCRIPTS += remotingTestRunner
+#   check_SCRIPTS += red5testRunner
+# endif
+
+check_LTLIBRARIES = libgnashmingutils.la 
+libgnashmingutils_la_SOURCES = \
+       $(top_srcdir)/testsuite/misc-ming.all/ming_utils.h \
+       $(top_srcdir)/testsuite/misc-ming.all/ming_utils.c
+
+http.swf: $(srcdir)/http.as Dejagnu.swf Makefile ../actionscript.all/check.as 
../actionscript.all/utils.as
+       $(MAKESWF) -n network -r12 -o $@ -v7 -DRED5_HOST='\"$(RED5_HOST)\"' 
-DUSE_DEJAGNU_MODULE -DOUTPUT_VERSION=7 Dejagnu.swf $(srcdir)/http.as 
$(srcdir)/../actionscript.all/dejagnu_so_fini.as
+
+httpTestRunner: $(srcdir)/../generic-testrunner.sh http.swf
+       sh $< $(top_builddir) http.swf > $@
+       chmod 755 $@
+
+rtmp.swf: $(srcdir)/rtmp.as Dejagnu.swf Makefile ../actionscript.all/check.as 
../actionscript.all/utils.as
+       $(MAKESWF) -n network -r12 -o $@ -v7 -DRED5_HOST='\"$(RED5_HOST)\"' 
-DUSE_DEJAGNU_MODULE -DOUTPUT_VERSION=7 Dejagnu.swf $(srcdir)/rtmp.as 
$(srcdir)/../actionscript.all/dejagnu_so_fini.as
+
+rtmpTestRunner: $(srcdir)/../generic-testrunner.sh rtmp.swf
+       sh $< $(top_builddir) rtmp.swf > $@
+       chmod 755 $@
+
+netstream.swf: $(srcdir)/netstream.as Dejagnu.swf Makefile 
../actionscript.all/check.as ../actionscript.all/utils.as
+       $(MAKESWF) -n network -r12 -o $@ -v7 -DRED5_HOST='\"$(RED5_HOST)\"' 
-DUSE_DEJAGNU_MODULE -DOUTPUT_VERSION=7 Dejagnu.swf $(srcdir)/netstream.as 
$(srcdir)/../actionscript.all/dejagnu_so_fini.as
+
+netstreamRunner: $(srcdir)/../generic-testrunner.sh netstream.swf
+       sh $< $(top_builddir) netstream.swf > $@
+       chmod 755 $@
+
+Dejagnu_SOURCES = \
+       Dejagnu.c       \
+       $(NULL)
+Dejagnu_LDADD = libgnashmingutils.la
+
+Dejagnu.swf: Dejagnu
+       ./Dejagnu $(top_srcdir)/testsuite/media
+
+clean-local: 
+       -rm *.swf media *.pp *unner
+
+TEST_DRIVERS = network.exp
+TEST_CASES = \
+       http.swf \
+       rtmp.swf \
+       $(NULL)
+
+if MAKESWF_SUPPORTS_PREBUILT_CLIPS
+# if ENABLE_HTTP_TESTSUITE
+# TEST_CASES += remotingTestRunner
+# endif
+# TEST_CASES += red5testRunner
+endif
+
+check-DEJAGNU: site-update $(check_PROGRAMS)
+       @runtest=$(RUNTEST); \
+       if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+           GNASH_GC_TRIGGER_THRESHOLD=0 GNASHRC=../gnashrc $$runtest 
$(RUNTESTFLAGS) $(TEST_DRIVERS); true; \
+       else \
+         echo "WARNING: could not find \`runtest'" 1>&2; \
+          for i in "$(TEST_CASES)"; do \
+           GNASH_GC_TRIGGER_THRESHOLD=0 GNASHRC=../gnashrc $(SHELL) $$i; \
+         done; \
+       fi
+
+site-update: site.exp
+       @rm -fr site.exp.bak
+       @cp site.exp site.exp.bak
+       @sed -e '/testcases/d' site.exp.bak > site.exp
+       @echo "# This is a list of the pre-compiled testcases" >> site.exp
+       @echo "set testcases \"$(TEST_CASES)\"" >> site.exp
+

=== added file 'testsuite/network.all/http.as'
--- a/testsuite/network.all/http.as     1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/http.as     2009-04-01 02:49:29 +0000
@@ -0,0 +1,547 @@
+// This test relies on a default deploy of red5 on localhost
+//
+// Build with:
+//     makeswf -n network -o red5test.swf ../Dejagnu.swf red5test.as 
../actionscript.all/dejagnu_so_fini.as
+// Run with:
+//     firefox red5test.swf
+// Or:
+//     gnash red5test.swf
+//
+//
+
+#define info _root.note
+#define note _root.note
+#define fail_check _root.fail
+#define pass_check  _root.pass
+#define xfail_check _root.xfail
+#define xpass_check _root.xpass
+
+note("SWF" + OUTPUT_VERSION + " - " + System.capabilities.version + "\n");
+rcsid="red5test.as - <bzr revno here>";
+
+#include "../actionscript.all/check.as"
+#include "../actionscript.all/utils.as"
+#include "../actionscript.all/dejagnu.as"
+
+stop();
+
+endOfTest = function()
+{
+       //note("END OF TEST");
+//        check_totals(9);
+    totals();
+    play();
+};
+
+// -P FlashVars='hostname=localhost,rtmptport5080=rtmpport=1935'
+if (hostname == undefined) {
+    hostname="localhost";
+    note("No hostname specified, defaulting to "+hostname);
+}
+
+if (rtmptport == undefined) {
+    rtmptport = 5080;
+    note("No RTMPT port specified, defaulting to "+rtmptport);
+}
+
+if (rtmpport == undefined) {
+    rtmpport = 1935;
+    note("No RTMP port specified, defaulting to "+rtmpport);
+}
+
+nc = new NetConnection;
+nc.statuses = new Array();
+nc.onStatus = function()
+{
+    this.statuses.push(arguments);
+    note('NetConnection.onStatus called with args: ');
+};
+
+nc.onResult = function()
+{
+    this.statuses.push(arguments);
+    note('NetConnection.onResult called with args: '+dumpObject(arguments));
+};
+
+function ResultHandler() {
+    this.onResult = function(result) {
+        note('default onResult called with args: '+dumpObject(arguments));
+    };
+//     this.onCustom = function(result) {
+//         note('default onCustom called with args: '+dumpObject(arguments));
+//     };
+//     this.onDebugEvents = function(result) {
+//         note('default onDebugEvents called with args: 
'+dumpObject(arguments));
+//     };
+//     this.onStatus = function(result) {
+//     note("default onStatus called with args: "+dumpObject(arguments));
+//     };
+};
+
+
+
+rtmpuri = "http://"+hostname+":"+rtmptport+"/echo/gateway";;
+note("Connecting to "+rtmpuri);
+nc.connect(rtmpuri);
+// The network connection is not opened at connect() time, but when
+// the first call() is made.
+check_equals(nc.isConnected, false);
+check_equals(nc.statuses.length, 0);
+
+nc.onResult = function()
+{
+    note("Got a result back from the server.");
+    check_equals(nc.isConnected, true); // now it is connected
+    check_equals(nc.statuses.length, 1);
+    lastStatusArgs = nc.statuses[nc.statuses.length-1];
+    check_equals(lastStatusArgs[0].level, 'status');
+    check_equals(lastStatusArgs[0].code, 'NetConnection.Connect.Success');
+};
+
+
+//
+// The Red5 echo tests Null, Undefined, Boolean True, Boolean False,
+// String, Number, Array, Object, Date, Custom Class Remote Class
+//
+
+// This call starts the actual network connection
+result1=false;;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a null result back from the server."+dumpObject(arguments));
+    note(arguments[0]);
+    if (arguments.length == 1) {
+       if (arguments[0] == null) {
+           result1=true;
+       }
+    }
+};
+nc.call("echo", o, null);
+
+result2=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got an undefined result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == undefined) {
+           result2=true;
+       }
+    }
+};
+nc.call("echo", o, undefined);
+
+// bt=new Boolean(true);
+// o=new ResultHandler();
+// o.onResult = function()
+// {
+//     check_equals(arguments.toString(), trued);
+// };
+// nc.call("echo", o, bt);
+
+// bf=new Boolean(false);
+// nc.call("echo", o, bf);
+
+// Empty String
+result3=false;
+tstr = new String();
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a string result back from the server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0].length == 0) {
+           result3 = true;
+       }
+    }
+};
+nc.call("echo", o, tstr);
+
+// Hello World!
+result4=false;
+tstr2 = "Hello World!";
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a string result back from the server."+dumpObject(arguments));
+//     note("ARG4 is: " +dumpObject(arguments[0]));
+    str = arguments[0].toString();
+    if (arguments.length == 1) {
+       if ((arguments[0].length == 12)
+           && (arguments[0].toString() == "Hello World!")) {
+           result4 = true;
+       }
+    }
+};
+nc.call("echo", o, tstr2);
+
+// test1,test2,test3,test4
+
+// Number 0
+result5=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 0 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 0) {
+           result5 = true;
+       }
+    }
+};
+nc.call("echo", o, 0);
+
+// Number 1
+result6=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 1 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 1) {
+           result6 = true;
+       }
+    }
+};
+nc.call("echo", o, 1);
+
+// Number -1
+result7=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -1 result back from the 
server."+dumpObject(arguments));
+    if ((arguments.length == 1)) {
+       note("FIXME: "+arguments[0].to_number());
+       result7 = true;
+    }
+};
+nc.call("echo", o, -1);
+
+// Number 256
+result8=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 256 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 256) {
+           result8 = true;
+       }
+    }
+};
+nc.call("echo", o, 256);
+
+// Number -256
+result9=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -256 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -256) {
+           result9 = true;
+       }
+    }
+};
+nc.call("echo", o, -256);
+
+// Number 65536
+result10=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 65536 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 65536) {
+           result10 = true;
+       }
+    }
+};
+nc.call("echo", o, 65536);
+
+// Number -65536
+result11=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -65536 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -65536) {
+           result11 = true;
+       }
+    }
+};
+nc.call("echo", o, -65536);
+
+// 1.5
+result12=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 1.5 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 1.5) {
+           result12 = true;
+       }
+    }
+};
+nc.call("echo", o, 1.5);
+
+// -1.5
+result13=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -1.5 result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -1.5) {
+           result13 = true;
+       }
+    }
+};
+nc.call("echo", o, -1.5);
+
+// Number NaN
+result14=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical NaN result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == NaN) {
+           result14 = true;
+       }
+    }
+};
+nc.call("echo", o, NaN);
+
+// Number Infinity
+result15=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got an numerical infinity result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == infinity) {
+           result15 = true;
+       }
+    }
+};
+nc.call("echo", o, infinity);
+
+// Number -Infinity
+result16=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -infinity result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -infinity) {
+           result16 = true;
+       }
+    }
+};
+nc.call("echo", o, -infinity);
+
+// o=new ResultHandler();
+// o.onResult = function()
+// {
+//     note("Got a result back from the server.");
+//     check_equals(arguments.toString(), '1,two,true,4,5,6');
+//     endOfTest();
+// };
+// nc.call("echo", o, 1, 'two', true, [4,5,6]);
+
+// o=new ResultHandler();
+// o.onResult = function()
+// {
+//     note("Got a result back from the server.");
+//     check_equals(arguments.toString(), '1,2,3');
+// };
+// nc.call("echo", o, 1, 2, 3);
+
+
+// Test empty array
+tar = new Array();
+result17=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got an empty array result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0].length == 0) {
+           result17 = true;
+       }
+    }
+};
+nc.call("echo", o, tar);
+
+// Test array with only one item
+result18=false;
+tar = new Array();
+tar.push(1);
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a single item array result back from the 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0][0] == 1) {
+           result18 = true;
+       }
+    }
+};
+nc.call("echo", o, tar);
+
+// Test array with multiple items
+result19=false;
+tar = new Array();
+tar.push(1);
+tar.push(2);
+tar.push(3);
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got an 3 item array result back from the 
server."+dumpObject(arguments));
+    if ((arguments.length == 1) && (arguments[0].length == 3)) {
+       if ((arguments[0][0] == 1) && (arguments[0][1] == 2) && 
(arguments[0][2] == 3))  {
+           result19 = true;
+       }
+    }
+//    note(arguments[0].toString());
+//    check_equals(arguments[0].toString(), "1.2.3");
+};
+nc.call("echo", o, tar);
+
+// Test sparse array
+result20=false;
+tar2 = new Array();
+tar2.push(1);
+tar2.push();
+tar2.push();
+tar2.push();
+tar2.push(5);
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a sparse result back from the server."+dumpObject(arguments));
+    if ((arguments.length == 1) && (arguments[0].length == 2)) {
+       if ((arguments[0][0] == 1) && (arguments[0][1] == 5))  {
+           result20 = true;
+       }   
+    }
+//    check_equals(arguments.toString(), "1..,,5");
+};
+nc.call("echo", o, tar2);
+
+// Do the tests to see what happened last, to give the callbacks time
+// to be executed, as they're a background thread.
+if (result1) {
+    pass("RTMPT: Echo NULL Object");
+} else {
+    fail("RTMPT: Echo NULL Object");
+}
+
+if (result2) {
+    pass("RTMPT: Echo UNDEFINED Object");
+} else {
+    fail("RTMPT: Echo UNDEFINED Object");
+}
+
+if (result3) {
+    pass("RTMPT: Echo empty String");
+} else {
+    fail("RTMPT: Echo empty String");
+}
+
+if (result4) {
+    pass("RTMPT: Echo short String");
+} else {
+    fail("RTMPT: Echo short String");
+}
+
+if (result5) {
+    pass("RTMPT: Echo Number 0");
+} else {
+    fail("RTMPT: Echo Number 0");
+}
+
+if (result6) {
+    pass("RTMPT: Echo Number 1");
+} else {
+    fail("RTMPT: Echo Number 1");
+}
+
+if (result7) {
+    pass("RTMPT: Echo Number -1");
+} else {
+    fail("RTMPT: Echo Number -1");
+}
+if (result8) {
+    pass("RTMPT: Echo Number 256");
+} else {
+    fail("RTMPT: Echo Number 256");
+}
+if (result9) {
+    pass("RTMPT: Echo Number -256");
+} else {
+    fail("RTMPT: Echo Number -256");
+}
+if (result10) {
+    pass("RTMPT: Echo Number 65536");
+} else {
+    fail("RTMPT: Echo Number 65536");
+}
+if (result11) {
+    pass("RTMPT: Echo Number -65536");
+} else {
+    fail("RTMPT: Echo Number -65536");
+}
+if (result12) {
+    pass("RTMPT: Echo Number 1.5");
+} else {
+    fail("RTMPT: Echo Number 1.5");
+}
+if (result13) {
+    pass("RTMPT: Echo Number -1.5");
+} else {
+    fail("RTMPT: Echo Number -1.5");
+}
+if (result14) {
+    pass("RTMPT: Echo Number NaN");
+} else {
+    fail("RTMPT: Echo Number NaN");
+}
+if (result15) {
+    pass("RTMPT: Echo Number Infinity");
+} else {
+    fail("RTMPT: Echo Number Infinity");
+}
+if (result16) {
+    pass("RTMPT: Echo Number -Infinity");
+} else {
+    fail("RTMPT: Echo Number -Infinity");
+}
+
+if (result17) {
+    pass("RTMPT: Echo empty array");
+} else {
+    fail("RTMPT: Echo empty array");
+}
+if (result18) {
+    pass("RTMPT: Echo 1 item array");
+} else {
+    fail("RTMPT: Echo 1 item array");
+}
+if (result19) {
+    pass("ERTMPT: cho 3 item array");
+} else {
+    fail("RTMPT: Echo 3 item array");
+}
+if (result20) {
+    pass("RTMPT: Echo sparse array");
+} else {
+    fail("RTMPT: cho sparse array");
+}
+

=== added file 'testsuite/network.all/netstream.as'
--- a/testsuite/network.all/netstream.as        1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/netstream.as        2009-04-01 02:49:29 +0000
@@ -0,0 +1,28 @@
+
+//Open a new NetConnection to attach a remote object
+var nc = new NetConnection();
+
+//RTMP=(Real-Time Messaging Protocol) 
+//rtmp://host[:port]/appName[/instanceName]
+
+//nc.connect("http://localhost";);
+nc.connect("rtmp://localhost/oflaDemo");
+
+//Declare a Streaming Object called NetStream
+var ns = new NetStream(nc);
+ns.setBufferTime(10);
+
+// Attach de stream to the video
+// ns.attachVideo();
+
+//Push Play on the movie
+// NewStream.attachAudio(Microphone.get());
+// NewStream.attachVideo(Camera.get()); 
+
+// this is a url variable passed in the object call
+//ns.publish(stream);
+ns.play("DarkKnight.flv");
+
+note(dumpObject(ns));
+
+           

=== added file 'testsuite/network.all/network.exp'
--- a/testsuite/network.all/network.exp 1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/network.exp 2009-04-01 02:49:29 +0000
@@ -0,0 +1,190 @@
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 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
+
+load_lib "dejagnu.exp"
+
+# If tracing has been enabled at the top level, then turn it on here
+# too.
+if $tracelevel {
+    strace $tracelevel
+}
+
+# After these many seconds of execution the test script is aborted with a 
failure.
+# This is to handle deadlocks. We don't reset the timeout when a match is
+# found to avoid hanging in case of a testcase sending matches in an infinite 
loops.
+# (not unlikely as it seems, think about flash movies...)
+#
+# Expressed in seconds.
+#
+set timeout 100
+set file all
+set params ""
+
+# Send something to the copy of Cygnal we started
+# See if a remote service has a server answering on that port.
+# echo "xxx " | telnet localhost 5080
+
+set chost localhost
+set cport 5080
+set server_dead "true"
+
+proc probe {  } {
+    global chost
+    global cport
+    verbose "Trying to ping $chost to see if the host is alive"
+    global server_dead 
+    spawn -noecho ping -c 1 $chost
+    set nid $spawn_id
+    global timeout
+
+    expect {
+       "packets transmitted, 1 received" {
+           verbose "Got ping resposne, $chost is alive..."
+           set server_dead "false"
+       }
+       eof {
+           verbose "Ping all done..."
+           set server_dead "false"
+       }
+       timeout {
+           verbose "Ping still running after ${timeout} seconds, killing it 
(deadlock?)"
+           catch close
+           set server_dead "true"
+       }
+    }
+
+    return true
+}
+
+# Make sure we can access the resource on the specified host,m which won't 
always
+# be localhost.
+if { [probe] != true } {
+    verbose "$chost is Dead!"
+    exit
+}
+
+global env
+set env(LANG) en_US.UTF-8
+set env(LANGUAGE) en_US.UTF-8
+set env(LC_ALL) en_US.UTF-8
+
+set gproc [lookfor_file $objdir utilities/gprocessor]
+set goptions "-vv"
+verbose "Starting gprocessor \"$gproc $goptions\" for testing"
+
+# testcases is set by the Makefile in the site.exp data file.
+foreach file $testcases {
+
+    verbose "Running test $file"
+
+    # spawn the executable and look for the DejaGnu output messages from the
+    # test case.
+
+    # this version of the call allows use of 'wait' to check return code
+    # -open [open "|cmd" "r"] doesn't work for that
+  
+    # Ignore SIGHUP or we'd get a lot of them on Debian stable
+    verbose "Starting gprocessor \"$gproc $goptions $file\" for testing"
+    spawn -noecho -ignore SIGHUP $gproc $goptions $file 
+
+    expect {
+       -re "^\[^\n]*NOTE:\[^\n]*\n" {
+           regsub ".*NOTE: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2]
+           verbose "${file} $output" 
+            # notes tipically come from the test runner, so we'll trust it to 
mean 
+            # things are someone not too bad...
+           # -continue_timer
+           exp_continue
+       }
+       -re "^\[^\n]*XPASSED:\[^\n]*\n" {
+           regsub ".*XPASSED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2]
+           xpass "${file}: $output"
+           exp_continue -continue_timer
+       }
+       -re "^\[^\n]*PASSED:\[^\n]*\n" {
+           regsub ".*PASSED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2]
+           pass "${file}: $output"
+           exp_continue -continue_timer
+       }
+       -re "^\[^\n]*XFAILED:\[^\n]*\n" {
+           regsub ".*XFAILED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2] 
+           xfail "${file}: $output"
+           exp_continue -continue_timer
+       }
+       -re "^\[^\n]*FAILED:\[^\n]*\n" {
+           regsub ".*FAILED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2] 
+           fail "${file}: $output"
+           exp_continue -continue_timer
+       }
+       -re "^\[^\n]*UNTESTED:\[^\n]*\n" {
+           regsub ".*UNTESTED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2]
+           untested "${file}: $output"
+           exp_continue -continue_timer
+       }
+       -re "^\[^\n]*UNRESOLVED:\[^\n]*\n" {
+           regsub ".*UNRESOLVED: " $expect_out(0,string) "" output
+           set output [string range $output 0 end-2]
+           unresolved "${file}: $output"
+           exp_continue -continue_timer
+       }
+       -re "^\[^\n]*\n" {
+            # just remove non-matching lines!
+            exp_continue -continue_timer
+       }
+       eof {
+           #       unresolved "${file} died prematurely"
+           #       catch close
+           #       return "${file} died prematurely"
+       }
+       timeout {
+               fail "Test case ${file} still running after ${timeout} seconds, 
killing it (deadlock?)"
+               catch close
+               continue;
+       }
+   }
+
+       # wait for the process to coplete to
+       # check return code
+       set retcode [wait]
+
+       # debugging
+       #set i 0; foreach j $retcode { print "${file} wait($i) $j"; incr i }
+
+       # This snippet catches segfaults and aborts.
+       # Would also catch SIGHUP, but we're ignoring them
+       # as on Debian Stable we unexpectedly get them for no apparent reason
+       #
+       if { [ llength $retcode ] > 5 } {
+               fail "${file} died prematurely ([lindex $retcode 6])"
+       }
+
+       # This snippet catches non-zero returns
+       if { [ lindex $retcode 3 ] != 0 } {
+               fail "${file} exited with non-zero code ([lindex $retcode 3])"
+       }
+
+
+    # force a close of the executable to be safe.
+#    catch close
+}
+
+

=== added file 'testsuite/network.all/remoting.README'
--- a/testsuite/network.all/remoting.README     1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/remoting.README     2009-04-01 02:49:29 +0000
@@ -0,0 +1,51 @@
+Test for remoting trough NetConnection and http.
+
+SERVER
+------
+
+The server part of the test is a PHP file.
+There's one copy available at
+http://www.gnashdev.org/testcases/remoting.php
+
+If you want to test offline you can copy remoting.php
+somewhere in your web server directories and specify 
+the base url at configure time, for example:
+
+ $ ./configure --enable-http-testsuite=http://localhost/gnashtests/
+ $ cp remoting.php /var/www/gnashtests/
+
+Note that in order for the php file to work you might need to 
+add the following line to your .htaccess file:
+
+  php_flag always_populate_raw_post_data on in place
+
+Also, if you run the client (remote.swf) from a different domain
+then the one the server is on, you'll need a crossdomain.xml file
+on the web root of the server.
+
+The most open version of a crossdomain.xml only contains this line:
+
+ <cross-domain-policy> <allow-access-from domain="*" /> </cross-domain-policy>
+
+CLIENT
+------
+
+The client part is an SWF, compiled by Ming from remoting.as.
+The SWF will embed the url to the remoting.php file.
+This is for convenience to allow testing it with the proprietary
+player to verify it expects the correct behaviour.
+
+The embedded url is set at configure time (--enable-http-testsuite)
+but can be overridden by a query string, for example:
+
+    $ gnash -v remoting.swf?url=remoting.php # relative url
+
+The generated remoting.swf is set to have "network" sandbox so
+you'll be able to run it from the filesystem and have it access
+network resources (as long as crossdomain.xml file is in place).
+
+Note that the proprietary player doesn't let you specify a query
+string for a filesystem-loaded file, so use --enable-http-testsuite
+to specify the embedded (default) url.
+
+

=== added file 'testsuite/network.all/rtmp.as'
--- a/testsuite/network.all/rtmp.as     1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/rtmp.as     2009-04-01 02:49:29 +0000
@@ -0,0 +1,544 @@
+// This test relies on a default deploy of red5 on localhost
+//
+// Build with:
+//     makeswf -n network -o red5test.swf ../Dejagnu.swf red5test.as 
../actionscript.all/dejagnu_so_fini.as
+// Run with:
+//     firefox red5test.swf
+// Or:
+//     gnash red5test.swf
+//
+//
+
+#define info _root.note
+#define note _root.note
+#define fail_check _root.fail
+#define pass_check  _root.pass
+#define xfail_check _root.xfail
+#define xpass_check _root.xpass
+
+note("SWF" + OUTPUT_VERSION + " - " + System.capabilities.version + "\n");
+rcsid="red5test.as - <bzr revno here>";
+
+#include "../actionscript.all/check.as"
+#include "../actionscript.all/utils.as"
+#include "../actionscript.all/dejagnu.as"
+
+stop();
+
+endOfTest = function()
+{
+       //note("END OF TEST");
+//        check_totals(9);
+    totals();
+    play();
+};
+
+// -P FlashVars='hostname=localhost,rtmptport5080=rtmpport=1935'
+if (hostname == undefined) {
+    hostname="localhost";
+    note("No hostname specified, defaulting to "+hostname);
+}
+
+if (rtmptport == undefined) {
+    rtmptport = 5080;
+    note("No RTMPT port specified, defaulting to "+rtmptport);
+}
+
+if (rtmpport == undefined) {
+    rtmpport = 1935;
+    note("No RTMP port specified, defaulting to "+rtmpport);
+}
+
+nc = new NetConnection;
+nc.statuses = new Array();
+nc.onStatus = function()
+{
+    this.statuses.push(arguments);
+    note('NetConnection.onStatus called with args: ');
+};
+
+nc.onResult = function()
+{
+    this.statuses.push(arguments);
+    note('NetConnection.onResult called with args: '+dumpObject(arguments));
+};
+
+function ResultHandler() {
+    this.onResult = function(result) {
+        note('default onResult called with args: '+dumpObject(arguments));
+    };
+//     this.onCustom = function(result) {
+//         note('default onCustom called with args: '+dumpObject(arguments));
+//     };
+//     this.onDebugEvents = function(result) {
+//         note('default onDebugEvents called with args: 
'+dumpObject(arguments));
+//     };
+//     this.onStatus = function(result) {
+//     note("default onStatus called with args: "+dumpObject(arguments));
+//     };
+};
+
+//
+// do the same thing for RTMP
+//
+ncrtmp = new NetConnection;
+ncrtmp.statuses = new Array();
+ncrtmp.onStatus = function()
+{
+    this.statuses.push(arguments);
+    note('NetConnection.onStatus called with args: '+dumpObject(arguments));
+    lastStatusArgs = ncrtmp.statuses[ncrtmp.statuses.length-1];
+    if ((lastStatusArgs[0].level == "status") && (lastStatusArgs[0].code == 
"NetConnection.Connect.Success")) {
+        pass("RTMP connection - status Success");
+    } else {
+        fail("RTMP connection - status Success");
+    }
+};
+
+nc.onResult = function()
+{
+    this.statuses.push(arguments);
+    note('NetConnection.onResult called with args: '+dumpObject(arguments));
+};
+
+
+rtmpuri = "rtmp://"+hostname+":"+rtmpport+"/echo";
+note("Connecting to "+rtmpuri);
+ncrtmp.connect(rtmpuri);
+
+// The network connection is not opened at connect() time, but when
+// the first call() is made.
+if ((ncrtmp.isConnected == false)  && (ncrtmp.statuses.length == 0)) {
+    pass("RTMP connection - connect");
+} else {
+    fail("RTMP connection - connect");
+}
+
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a result back from the  RTMP server.");
+    
+    // now it is connected
+    if ((ncrtmp.isConnected == true) && (ncrtmp.statuses.length == 1)) {
+        pass("RTMP connection - result");
+    } else {
+        fail("RTMP connection - result");        
+    }
+    
+    lastStatusArgs = ncrtmp.statuses[ncrtmp.statuses.length-1];
+    if ((lastStatusArgs[0].level == "status") && (lastStatusArgs[0].code == 
"NetConnection.Connect.Success")) {
+        pass("RTMP connection - status");
+    } else {
+        fail("RTMP connection - status");        
+    }
+    
+};
+
+// This call starts the actual network connection
+result1=false;;
+o.onResult = function()
+{
+    note("Got a null result back from the RTMP server."+dumpObject(arguments));
+    note(arguments[0]);
+    if (arguments.length == 1) {
+       if (arguments[0] == null) {
+           result1=true;
+       }
+    }
+};
+ncrtmp.call("echo", o, null);
+
+// Empty String
+result3=false;
+tstr = new String();
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a string result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0].length == 0) {
+           result3 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, tstr);
+
+// Hello World!
+result4=false;
+tstr2 = "Hello World!";
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a string result back from the RTMP 
server."+dumpObject(arguments));
+//     note("ARG4 is: " +dumpObject(arguments[0]));
+    str = arguments[0].toString();
+    if (arguments.length == 1) {
+       if ((arguments[0].length == 12)
+           && (arguments[0].toString() == "Hello World!")) {
+           result4 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, tstr2);
+
+// test1,test2,test3,test4
+
+// Number 0
+result5=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 0 result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 0) {
+           result5 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, 0);
+
+// Number 1
+result6=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 1 result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 1) {
+           result6 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, 1);
+
+// Number -1
+result7=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -1 result back from the RTMP 
server."+dumpObject(arguments));
+    if ((arguments.length == 1)) {
+       note("FIXME: "+arguments[0].to_number());
+       result7 = true;
+    }
+};
+ncrtmp.call("echo", o, -1);
+
+// Number 256
+result8=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 256 result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 256) {
+           result8 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, 256);
+
+// Number -256
+result9=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -256 result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -256) {
+           result9 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, -256);
+
+// Number 65536
+result10=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 65536 result back from the  
RTMPserver."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 65536) {
+           result10 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, 65536);
+
+// Number -65536
+result11=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -65536 result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -65536) {
+           result11 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, -65536);
+
+// 1.5
+result12=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical 1.5 result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == 1.5) {
+           result12 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, 1.5);
+
+// -1.5
+result13=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -1.5 result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -1.5) {
+           result13 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, -1.5);
+
+// Number NaN
+result14=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical NaN result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == NaN) {
+           result14 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, NaN);
+
+// Number Infinity
+result15=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got an numerical infinity result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == infinity) {
+           result15 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, infinity);
+
+// Number -Infinity
+result16=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a numerical -infinity result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0] == -infinity) {
+           result16 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, -infinity);
+
+// o=new ResultHandler();
+// o.onResult = function()
+// {
+//     note("Got a result back from the server.");
+//     check_equals(arguments.toString(), '1,two,true,4,5,6');
+//     endOfTest();
+// };
+// ncrtmp.call("echo", o, 1, 'two', true, [4,5,6]);
+
+// o=new ResultHandler();
+// o.onResult = function()
+// {
+//     note("Got a result back from the server.");
+//     check_equals(arguments.toString(), '1,2,3');
+// };
+// ncrtmp.call("echo", o, 1, 2, 3);
+
+
+// Test empty array
+tar = new Array();
+result17=false;
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got an empty array result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0].length == 0) {
+           result17 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, tar);
+
+// Test array with only one item
+result18=false;
+tar = new Array();
+tar.push(1);
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a single item array result back from the RTMP 
server."+dumpObject(arguments));
+    if (arguments.length == 1) {
+       if (arguments[0][0] == 1) {
+           result18 = true;
+       }
+    }
+};
+ncrtmp.call("echo", o, tar);
+
+// Test array with multiple items
+result19=false;
+tar = new Array();
+tar.push(1);
+tar.push(2);
+tar.push(3);
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got an 3 item array result back from the RTMP 
server."+dumpObject(arguments));
+    if ((arguments.length == 1) && (arguments[0].length == 3)) {
+       if ((arguments[0][0] == 1) && (arguments[0][1] == 2) && 
(arguments[0][2] == 3))  {
+           result19 = true;
+       }
+    }
+//    note(arguments[0].toString());
+//    check_equals(arguments[0].toString(), "1.2.3");
+};
+ncrtmp.call("echo", o, tar);
+
+// Test sparse array
+result20=false;
+tar2 = new Array();
+tar2.push(1);
+tar2.push();
+tar2.push();
+tar2.push();
+tar2.push(5);
+o=new ResultHandler();
+o.onResult = function()
+{
+    note("Got a sparse result back from the RTMP 
server."+dumpObject(arguments));
+    if ((arguments.length == 1) && (arguments[0].length == 2)) {
+       if ((arguments[0][0] == 1) && (arguments[0][1] == 5))  {
+           result20 = true;
+       }   
+    }
+//    check_equals(arguments.toString(), "1..,,5");
+};
+ncrtmp.call("echo", o, tar2);
+
+if (result1) {
+    pass("RTMP: Echo NULL Object");
+} else {
+    fail("RTMP: Echo NULL Object");
+}
+
+if (result3) {
+    pass("RTMP: Echo empty String");
+} else {
+    fail("RTMP: Echo empty String");
+}
+
+if (result4) {
+    pass("RTMP: Echo short String");
+} else {
+    fail("RTMP: Echo short String");
+}
+
+if (result5) {
+    pass("RTMP: Echo Number 0");
+} else {
+    fail("RTMP: Echo Number 0");
+}
+
+if (result6) {
+    pass("RTMP: Echo Number 1");
+} else {
+    fail("RTMP: Echo Number 1");
+}
+
+if (result7) {
+    pass("RTMP: Echo Number -1");
+} else {
+    fail("RTMP: Echo Number -1");
+}
+if (result8) {
+    pass("RTMP: Echo Number 256");
+} else {
+    fail("RTMP: Echo Number 256");
+}
+if (result9) {
+    pass("RTMP: Echo Number -256");
+} else {
+    fail("RTMP: Echo Number -256");
+}
+if (result10) {
+    pass("RTMP: Echo Number 65536");
+} else {
+    fail("RTMP: Echo Number 65536");
+}
+if (result11) {
+    pass("RTMP: Echo Number -65536");
+} else {
+    fail("RTMP: Echo Number -65536");
+}
+if (result12) {
+    pass("RTMP: Echo Number 1.5");
+} else {
+    fail("RTMP: Echo Number 1.5");
+}
+if (result13) {
+    pass("RTMP: Echo Number -1.5");
+} else {
+    fail("RTMP: Echo Number -1.5");
+}
+if (result14) {
+    pass("RTMP: Echo Number NaN");
+} else {
+    fail("Echo Number NaN");
+}
+if (result15) {
+    pass("RTMP: Echo Number Infinity");
+} else {
+    fail("RTMP: Echo Number Infinity");
+}
+if (result16) {
+    pass("RTMP: Echo Number -Infinity");
+} else {
+    fail("RTMP: Echo Number -Infinity");
+}
+
+if (result17) {
+    pass("RTMP: Echo empty array");
+} else {
+    fail("RTMP: Echo empty array");
+}
+if (result18) {
+    pass("RTMP: Echo 1 item array");
+} else {
+    fail("RTMP: Echo 1 item array");
+}
+if (result19) {
+    pass("RTMP: Echo 3 item array");
+} else {
+    fail("RTMP: Echo 3 item array");
+}
+if (result20) {
+    pass("RTMP: Echo sparse array");
+} else {
+    fail("RTMP: Echo sparse array");
+}


reply via email to

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