[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r10062: add the other data type tests
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r10062: add the other data type tests to the RTMP tests. |
Date: |
Thu, 26 Mar 2009 22:05:59 -0600 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10062
committer: address@hidden
branch nick: rtmp
timestamp: Thu 2009-03-26 22:05:59 -0600
message:
add the other data type tests to the RTMP tests.
modified:
testsuite/misc-ming.all/red5test.as
=== modified file 'testsuite/misc-ming.all/red5test.as'
--- a/testsuite/misc-ming.all/red5test.as 2009-03-27 03:49:51 +0000
+++ b/testsuite/misc-ming.all/red5test.as 2009-03-27 04:05:59 +0000
@@ -429,111 +429,111 @@
// 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("Echo NULL Object");
+ pass("RTMPT: Echo NULL Object");
} else {
- fail("Echo NULL Object");
+ fail("RTMPT: Echo NULL Object");
}
if (result2) {
- pass("Echo UNDEFINED Object");
+ pass("RTMPT: Echo UNDEFINED Object");
} else {
- fail("Echo UNDEFINED Object");
+ fail("RTMPT: Echo UNDEFINED Object");
}
if (result3) {
- pass("Echo empty String");
+ pass("RTMPT: Echo empty String");
} else {
- fail("Echo empty String");
+ fail("RTMPT: Echo empty String");
}
if (result4) {
- pass("Echo short String");
+ pass("RTMPT: Echo short String");
} else {
- fail("Echo short String");
+ fail("RTMPT: Echo short String");
}
if (result5) {
- pass("Echo Number 0");
+ pass("RTMPT: Echo Number 0");
} else {
- fail("Echo Number 0");
+ fail("RTMPT: Echo Number 0");
}
if (result6) {
- pass("Echo Number 1");
+ pass("RTMPT: Echo Number 1");
} else {
- fail("Echo Number 1");
+ fail("RTMPT: Echo Number 1");
}
if (result7) {
- pass("Echo Number -1");
+ pass("RTMPT: Echo Number -1");
} else {
- fail("Echo Number -1");
+ fail("RTMPT: Echo Number -1");
}
if (result8) {
- pass("Echo Number 256");
+ pass("RTMPT: Echo Number 256");
} else {
- fail("Echo Number 256");
+ fail("RTMPT: Echo Number 256");
}
if (result9) {
- pass("Echo Number -256");
+ pass("RTMPT: Echo Number -256");
} else {
- fail("Echo Number -256");
+ fail("RTMPT: Echo Number -256");
}
if (result10) {
- pass("Echo Number 65536");
+ pass("RTMPT: Echo Number 65536");
} else {
- fail("Echo Number 65536");
+ fail("RTMPT: Echo Number 65536");
}
if (result11) {
- pass("Echo Number -65536");
+ pass("RTMPT: Echo Number -65536");
} else {
- fail("Echo Number -65536");
+ fail("RTMPT: Echo Number -65536");
}
if (result12) {
- pass("Echo Number 1.5");
+ pass("RTMPT: Echo Number 1.5");
} else {
- fail("Echo Number 1.5");
+ fail("RTMPT: Echo Number 1.5");
}
if (result13) {
- pass("Echo Number -1.5");
+ pass("RTMPT: Echo Number -1.5");
} else {
- fail("Echo Number -1.5");
+ fail("RTMPT: Echo Number -1.5");
}
if (result14) {
- pass("Echo Number NaN");
+ pass("RTMPT: Echo Number NaN");
} else {
- fail("Echo Number NaN");
+ fail("RTMPT: Echo Number NaN");
}
if (result15) {
- pass("Echo Number Infinity");
+ pass("RTMPT: Echo Number Infinity");
} else {
- fail("Echo Number Infinity");
+ fail("RTMPT: Echo Number Infinity");
}
if (result16) {
- pass("Echo Number -Infinity");
+ pass("RTMPT: Echo Number -Infinity");
} else {
- fail("Echo Number -Infinity");
+ fail("RTMPT: Echo Number -Infinity");
}
if (result17) {
- pass("Echo empty array");
+ pass("RTMPT: Echo empty array");
} else {
- fail("Echo empty array");
+ fail("RTMPT: Echo empty array");
}
if (result18) {
- pass("Echo 1 item array");
+ pass("RTMPT: Echo 1 item array");
} else {
- fail("Echo 1 item array");
+ fail("RTMPT: Echo 1 item array");
}
if (result19) {
- pass("Echo 3 item array");
+ pass("ERTMPT: cho 3 item array");
} else {
- fail("Echo 3 item array");
+ fail("RTMPT: Echo 3 item array");
}
if (result20) {
- pass("Echo sparse array");
+ pass("RTMPT: Echo sparse array");
} else {
- fail("Echo sparse array");
+ fail("RTMPT: cho sparse array");
}
//
@@ -622,6 +622,283 @@
};
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 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
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
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
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
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
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
server."+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
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
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
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
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
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
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
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
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
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 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 {
@@ -634,3 +911,92 @@
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");
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r10062: add the other data type tests to the RTMP tests.,
rob <=