r9345: used the data blob functions in the echo.js test code
authorAndrew Tridgell <tridge@samba.org>
Wed, 17 Aug 2005 02:56:07 +0000 (02:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:33:26 +0000 (13:33 -0500)
(This used to be commit f217f08b679ec3ed4784ed0fe74e9cbb935cdce9)

testprogs/ejs/echo.js

index aa44ca7eb0deb5f506fba1e45f557a210018773c..2875d1fb0e26bb376272edb938f49ceac16af19f 100755 (executable)
@@ -22,10 +22,11 @@ libinclude("base.js");
 function ramp_array(N)
 {
        var a = new Array(N);
+       var data = datablob_init();
        for (i=0;i<N;i++) {
                a[i] = i;
        }
-       return a;
+       return data.blobFromArray(a);
 }
 
 
@@ -60,7 +61,7 @@ function test_EchoData(echo)
                io.input.in_data = ramp_array(i);
                status = echo.echo_EchoData(io);
                check_status_ok(status);
-               check_array_equal(io.input.in_data, io.output.out_data);
+               assert(true == echo.blobCompare(io.input.in_data, io.output.out_data));
        }
 }
 
@@ -97,7 +98,7 @@ function test_SourceData(echo)
                status = echo.echo_SourceData(io);
                check_status_ok(status);
                correct = ramp_array(i);
-               check_array_equal(correct, io.output.data);
+               assert(true == echo.blobCompare(correct, io.output.data));
        }
 }
 
@@ -181,7 +182,7 @@ function test_TestSurrounding(echo)
        
        io.input.data = new Object();
        io.input.data.x = 10;
-       io.input.data.surrounding = ramp_array(10);
+       io.input.data.surrounding = new Array(10);
        status = echo.echo_TestSurrounding(io);
        check_status_ok(status);
        assert(io.output.data.surrounding.length == 20);
@@ -210,6 +211,7 @@ if (options.ARGV.length != 1) {
 }
 var binding = options.ARGV[0];
 var echo = rpcecho_init();
+datablob_init(echo);
 
 print("Connecting to " + binding + "\n");
 status = echo.connect(binding);