From 5eea409d4c57aba091a7ed8d8304627c9796f873 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 7 Jul 2005 08:21:45 +0000 Subject: r8199: - we don't need to pre-declare 'var status;' everywhere - added testing of echo_TestCall(), which uses strings (This used to be commit 67aa628413342fd812afd966c95ea9d470b3151b) --- testprogs/ejs/echo.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'testprogs') diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js index e7cb86731f..0ae269846f 100644 --- a/testprogs/ejs/echo.js +++ b/testprogs/ejs/echo.js @@ -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 \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"); -- cgit