Make it clearer when RAW-STREAMS is failing (don't always print names).
authorJeremy Allison <jra@samba.org>
Mon, 22 Dec 2008 19:58:38 +0000 (11:58 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 22 Dec 2008 19:58:38 +0000 (11:58 -0800)
Jeremy.

source4/torture/raw/streams.c

index 4e2a204cb61ea042495b78daa0174937cbb9eb67..ba74530c6f97a01c6594a41c4cf03b3f343a18df 100644 (file)
@@ -996,14 +996,16 @@ static bool test_stream_names2(struct torture_context *tctx,
                        break;
                }
 
-               printf("(%s) %s:Stream%c0x%02X:$DATA%s => expected[%s]\n",
-                      __location__, fname, isprint(i)?(char)i:' ', i,
-                      isprint(i)?"":" (not printable)",
-                      nt_errstr(expected));
 
                io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
                io.ntcreatex.in.fname = path;
                status = smb_raw_open(cli->tree, mem_ctx, &io);
+               if (!NT_STATUS_EQUAL(status, expected)) {
+                       printf("(%s) %s:Stream%c0x%02X:$DATA%s => expected[%s]\n",
+                               __location__, fname, isprint(i)?(char)i:' ', i,
+                               isprint(i)?"":" (not printable)",
+                               nt_errstr(expected));
+               }
                CHECK_STATUS(status, expected);
 
                talloc_free(path);