summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-15 07:18:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:23:08 -0500
commita0bc4da1a307753e3b28a11863f50d66b0894190 (patch)
treed16430b5a02dd01188c7aa1722181eb947ec9442 /testprogs/ejs
parent7b8332369f3664af13bd7760561765a35c312b9e (diff)
downloadsamba-a0bc4da1a307753e3b28a11863f50d66b0894190.tar.gz
samba-a0bc4da1a307753e3b28a11863f50d66b0894190.tar.bz2
samba-a0bc4da1a307753e3b28a11863f50d66b0894190.zip
r8483: switched our generated ejs rpc code over to the new OO interface. This
means we don't pollute the name space, and also makes for faster startup times as we only create variables for the pipes that we use, not all pipes (This used to be commit 57d7a585e8162d21c7152952aa0cc7471968784f)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-xtestprogs/ejs/echo.js38
-rwxr-xr-xtestprogs/ejs/nbtstats5
2 files changed, 23 insertions, 20 deletions
diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js
index e5b0b2b1bf..d464f8623e 100755
--- a/testprogs/ejs/echo.js
+++ b/testprogs/ejs/echo.js
@@ -16,6 +16,8 @@ if (ok == false) {
libinclude("base.js");
+echo = rpcecho_init();
+
/*
generate a ramp as an integer array
*/
@@ -40,7 +42,7 @@ function test_AddOne(conn)
for (i=0;i<10;i++) {
io.input.in_data = i;
- status = dcerpc_echo_AddOne(conn, io);
+ status = echo.echo_AddOne(conn, io);
check_status_ok(status);
assert(io.output.out_data == i + 1);
}
@@ -58,7 +60,7 @@ function test_EchoData(conn)
for (i=0; i<30; i=i+5) {
io.input.len = i;
io.input.in_data = ramp_array(i);
- status = dcerpc_echo_EchoData(conn, io);
+ status = echo.echo_EchoData(conn, io);
check_status_ok(status);
check_array_equal(io.input.in_data, io.output.out_data);
}
@@ -77,7 +79,7 @@ function test_SinkData(conn)
for (i=0; i<30; i=i+5) {
io.input.len = i;
io.input.data = ramp_array(i);
- status = dcerpc_echo_SinkData(conn, io);
+ status = echo.echo_SinkData(conn, io);
check_status_ok(status);
}
}
@@ -94,7 +96,7 @@ function test_SourceData(conn)
for (i=0; i<30; i=i+5) {
io.input.len = i;
- status = dcerpc_echo_SourceData(conn, io);
+ status = echo.echo_SourceData(conn, io);
check_status_ok(status);
correct = ramp_array(i);
check_array_equal(correct, io.output.data);
@@ -112,7 +114,7 @@ function test_TestCall(conn)
print("Testing echo_TestCall\n");
io.input.s1 = "my test string";
- status = dcerpc_echo_TestCall(conn, io);
+ status = echo.echo_TestCall(conn, io);
check_status_ok(status);
assert("this is a test string" == io.output.s2);
}
@@ -128,7 +130,7 @@ function test_TestCall2(conn)
for (i=1;i<=7;i++) {
io.input.level = i;
- status = dcerpc_echo_TestCall2(conn, io);
+ status = echo.echo_TestCall2(conn, io);
check_status_ok(status);
}
}
@@ -143,7 +145,7 @@ function test_TestSleep(conn)
print("Testing echo_TestSleep\n");
io.input.seconds = 1;
- status = dcerpc_echo_TestSleep(conn, io);
+ status = echo.echo_TestSleep(conn, io);
check_status_ok(status);
}
@@ -156,18 +158,18 @@ function test_TestEnum(conn)
print("Testing echo_TestEnum\n");
- io.input.foo1 = ECHO_ENUM1;
+ io.input.foo1 = echo.ECHO_ENUM1;
io.input.foo2 = new Object();
- io.input.foo2.e1 = ECHO_ENUM1;
- io.input.foo2.e2 = ECHO_ENUM1_32;
+ io.input.foo2.e1 = echo.ECHO_ENUM1;
+ io.input.foo2.e2 = echo.ECHO_ENUM1_32;
io.input.foo3 = new Object();
- io.input.foo3.e1 = ECHO_ENUM2;
- status = dcerpc_echo_TestEnum(conn, io);
+ io.input.foo3.e1 = echo.ECHO_ENUM2;
+ status = echo.echo_TestEnum(conn, io);
check_status_ok(status);
- assert(io.output.foo1 == ECHO_ENUM1);
- assert(io.output.foo2.e1 == ECHO_ENUM2);
- assert(io.output.foo2.e2 == ECHO_ENUM1_32);
- assert(io.output.foo3.e1 == ECHO_ENUM2);
+ assert(io.output.foo1 == echo.ECHO_ENUM1);
+ assert(io.output.foo2.e1 == echo.ECHO_ENUM2);
+ assert(io.output.foo2.e2 == echo.ECHO_ENUM1_32);
+ assert(io.output.foo3.e1 == echo.ECHO_ENUM2);
}
/*
@@ -182,7 +184,7 @@ function test_TestSurrounding(conn)
io.input.data = new Object();
io.input.data.x = 10;
io.input.data.surrounding = ramp_array(10);
- status = dcerpc_echo_TestSurrounding(conn, io);
+ status = echo.echo_TestSurrounding(conn, io);
check_status_ok(status);
assert(io.output.data.surrounding.length == 20);
check_array_zero(io.output.data.surrounding);
@@ -198,7 +200,7 @@ function test_TestDoublePointer(conn)
print("Testing echo_TestDoublePointer\n");
io.input.data = 7;
- status = dcerpc_echo_TestDoublePointer(conn, io);
+ status = echo.echo_TestDoublePointer(conn, io);
check_status_ok(status);
assert(io.input.data == io.input.data);
}
diff --git a/testprogs/ejs/nbtstats b/testprogs/ejs/nbtstats
index fe93a728cd..20bc781f03 100755
--- a/testprogs/ejs/nbtstats
+++ b/testprogs/ejs/nbtstats
@@ -14,14 +14,15 @@ if (ok == false) {
}
var conn = new Object();
+var irpc = irpc_init();
status = irpc_connect(conn, "nbt_server");
assert(status.is_ok == true);
io = new Object();
io.input = new Object();
-io.input.level = NBTD_INFO_STATISTICS;
-status = dcerpc_nbtd_information(conn, io);
+io.input.level = irpc.NBTD_INFO_STATISTICS;
+status = irpc.nbtd_information(conn, io);
assert(status.is_ok == true);
assert(io.results.length == 1);