diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-08 04:16:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:21 -0500 |
commit | d105d5e9e40d9950f0c8e61ac17d352c4cb4e6e2 (patch) | |
tree | 21dd7f529f9b1749328e1c2ac4bbe49cefdfd3c1 /testprogs | |
parent | ce14638c046c4abe388a6848a3eb19c0ec11dc38 (diff) | |
download | samba-d105d5e9e40d9950f0c8e61ac17d352c4cb4e6e2.tar.gz samba-d105d5e9e40d9950f0c8e61ac17d352c4cb4e6e2.tar.bz2 samba-d105d5e9e40d9950f0c8e61ac17d352c4cb4e6e2.zip |
r8218: added testing of echo_TestSurrounding() and
echo_TestDoublePointer(). All echo.idl functions are now tested and
working from ejs.
(This used to be commit c065d677697d3e8dbe2575113823a7ac7109ca70)
Diffstat (limited to 'testprogs')
-rw-r--r-- | testprogs/ejs/echo.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js index 8cdacf8fc6..4bc8fdefb1 100644 --- a/testprogs/ejs/echo.js +++ b/testprogs/ejs/echo.js @@ -49,6 +49,16 @@ function check_array_equal(a1, a2) } /* + check that an array is all zeros +*/ +function check_array_zero(a) +{ + for (i=0; i<a.length; i++) { + assert(a[i] == 0); + } +} + +/* test the echo_AddOne interface */ function test_AddOne(conn) @@ -189,6 +199,39 @@ function test_TestEnum(conn) assert(io.output.foo3.e1 == 2); } +/* + test the echo_TestSurrounding interface +*/ +function test_TestSurrounding(conn) +{ + var io = irpcObj(); + + print("Testing echo_TestSurrounding\n"); + + io.input.data = new Object(); + io.input.data.x = 10; + io.input.data.surrounding = ramp_array(10); + status = dcerpc_echo_TestSurrounding(conn, io); + check_status_ok(status); + assert(io.output.data.surrounding.length == 20); + check_array_zero(io.output.data.surrounding); +} + +/* + test the echo_TestDoublePointer interface +*/ +function test_TestDoublePointer(conn) +{ + var io = irpcObj(); + + print("Testing echo_TestDoublePointer\n"); + + io.input.data = 7; + status = dcerpc_echo_TestDoublePointer(conn, io); + check_status_ok(status); + assert(io.input.data == io.input.data); +} + if (ARGV.length == 0) { print("Usage: echo.js <RPCBINDING>\n"); @@ -213,5 +256,7 @@ test_TestCall(conn); test_TestCall2(conn); test_TestSleep(conn); test_TestEnum(conn); +test_TestSurrounding(conn); +test_TestDoublePointer(conn); print("All OK\n"); |