r25000: Fix some more C++ compatibility warnings.
[abartlet/samba.git/.git] / source4 / torture / raw / streams.c
index 978a5fcc3a9ccdde6dcf7c5fcbfbf0a919bdd17f..c51c6ea2dfb221d6b6791c04f2b43f3366b228db 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -74,7 +73,7 @@ static BOOL check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
                return False;
        }
 
-       buf = talloc_size(mem_ctx, strlen(value)+11);
+       buf = talloc_array(mem_ctx, uint8_t, strlen(value)+11);
        
        ret = smbcli_read(cli->tree, fnum, buf, 0, strlen(value)+11);
        if (ret != strlen(value)) {
@@ -214,28 +213,19 @@ done:
 /* 
    basic testing of streams calls
 */
-BOOL torture_raw_streams(struct torture_context *torture)
+bool torture_raw_streams(struct torture_context *torture, 
+                                                struct smbcli_state *cli)
 {
-       struct smbcli_state *cli;
        BOOL ret = True;
-       TALLOC_CTX *mem_ctx;
-
-       if (!torture_open_connection(&cli)) {
-               return False;
-       }
-
-       mem_ctx = talloc_init("torture_raw_streams");
 
        if (!torture_setup_dir(cli, BASEDIR)) {
                return False;
        }
 
-       ret &= test_stream_io(cli, mem_ctx);
+       ret &= test_stream_io(cli, torture);
 
        smb_raw_exit(cli->session);
        smbcli_deltree(cli->tree, BASEDIR);
 
-       torture_close_connection(cli);
-       talloc_free(mem_ctx);
        return ret;
 }