r8199: - we don't need to pre-declare 'var status;' everywhere
authorAndrew Tridgell <tridge@samba.org>
Thu, 7 Jul 2005 08:21:45 +0000 (08:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:19:19 +0000 (13:19 -0500)
- added testing of echo_TestCall(), which uses strings
(This used to be commit 67aa628413342fd812afd966c95ea9d470b3151b)

testprogs/ejs/echo.js

index e7cb86731f44a89238fb93e88b36226dde8e2a4e..0ae269846f6935c9d35dbb0a41f8c8e50cf4cbee 100644 (file)
@@ -2,6 +2,10 @@
        demonstrate access to rpc calls from ejs
 */     
 
+
+/*
+  helper function to setup a rpc io object, ready for input
+*/
 function irpcObj()
 {
        var o = new Object();
@@ -49,7 +53,6 @@ function check_array_equal(a1, a2)
 */
 function test_AddOne(conn)
 {
-       var status;
        var io = irpcObj();
 
        print("Testing echo_AddOne\n");
@@ -67,7 +70,6 @@ function test_AddOne(conn)
 */
 function test_EchoData(conn)
 {
-       var status;
        var io = irpcObj();
 
        print("Testing echo_EchoData\n");
@@ -87,7 +89,6 @@ function test_EchoData(conn)
 */
 function test_SinkData(conn)
 {
-       var status;
        var io = irpcObj();
 
        print("Testing echo_SinkData\n");
@@ -106,7 +107,6 @@ function test_SinkData(conn)
 */
 function test_SourceData(conn)
 {
-       var status;
        var io = irpcObj();
 
        print("Testing echo_SourceData\n");
@@ -120,6 +120,23 @@ function test_SourceData(conn)
        }
 }
 
+
+/*
+  test the echo_TestCall interface
+*/
+function test_TestCall(conn)
+{
+       var io = irpcObj();
+
+       print("Testing echo_TestCall\n");
+
+       io.input.s1 = "my test string";
+       status = dcerpc_echo_TestCall(conn, io);
+       check_status_ok(status);
+       assert("this is a test string" == io.output.s2);
+}
+
+
 if (ARGV.length == 0) {
    print("Usage: echo.js <RPCBINDING>\n");
    exit(0);
@@ -139,5 +156,6 @@ test_AddOne(conn);
 test_EchoData(conn);
 test_SinkData(conn);
 test_SourceData(conn);
+test_TestCall(conn);
 
 print("All OK\n");