diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-07 07:47:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:19 -0500 |
commit | 3c2dc30b3ee719ceb7846f975b83a79c9cb1a9d7 (patch) | |
tree | 7dca782e4d35595dd6ebcc5b333aad2a3293c463 /testprogs/ejs | |
parent | 0fe84a92fbd8cded71cce8c31b510296a1165fb6 (diff) | |
download | samba-3c2dc30b3ee719ceb7846f975b83a79c9cb1a9d7.tar.gz samba-3c2dc30b3ee719ceb7846f975b83a79c9cb1a9d7.tar.bz2 samba-3c2dc30b3ee719ceb7846f975b83a79c9cb1a9d7.zip |
r8197: added testing of echo_SinkData() and echo_SourceData()
(This used to be commit f1d6b328c46265b04fe7c0626d94bb2c844507c9)
Diffstat (limited to 'testprogs/ejs')
-rw-r--r-- | testprogs/ejs/echo.js | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js index 992c6be5dd..e7cb86731f 100644 --- a/testprogs/ejs/echo.js +++ b/testprogs/ejs/echo.js @@ -16,7 +16,7 @@ function ramp_array(N) { var a = new Array(N); for (i=0;i<N;i++) { - a[i] = i+1; + a[i] = i; } return a; } @@ -81,6 +81,45 @@ function test_EchoData(conn) } } + +/* + test the echo_SinkData interface +*/ +function test_SinkData(conn) +{ + var status; + var io = irpcObj(); + + print("Testing echo_SinkData\n"); + + for (i=0; i<30; i=i+5) { + io.input.len = i; + io.input.data = ramp_array(i); + status = dcerpc_echo_SinkData(conn, io); + check_status_ok(status); + } +} + + +/* + test the echo_SourceData interface +*/ +function test_SourceData(conn) +{ + var status; + var io = irpcObj(); + + print("Testing echo_SourceData\n"); + + for (i=0; i<30; i=i+5) { + io.input.len = i; + status = dcerpc_echo_SourceData(conn, io); + check_status_ok(status); + correct = ramp_array(i); + check_array_equal(correct, io.output.data); + } +} + if (ARGV.length == 0) { print("Usage: echo.js <RPCBINDING>\n"); exit(0); @@ -98,5 +137,7 @@ if (status.is_ok != true) { test_AddOne(conn); test_EchoData(conn); +test_SinkData(conn); +test_SourceData(conn); print("All OK\n"); |