summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2014-08-07 14:31:42 -0700
committerJeremy Allison <jra@samba.org>2014-08-30 00:27:13 +0200
commitba8bc46c467c17f35ecea9064c91829c5be87136 (patch)
tree84c778d459fb9a5c68b931c1dde8468cfca8bd5c /source4/torture/raw
parent61dbb57475eda861fabf38ab61dc6109159ed524 (diff)
downloadsamba-ba8bc46c467c17f35ecea9064c91829c5be87136.tar.gz
torture: Use torture_fail macro in check_buffer for read requests
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/read.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index f176e7faf64..8551c0b3473 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -42,9 +42,9 @@
}} while (0)
#define CHECK_BUFFER(buf, seed, len) do { \
- if (!check_buffer(buf, seed, len, __LINE__)) { \
+ if (!check_buffer(tctx, buf, seed, len, __LINE__)) { \
ret = false; \
- goto done; \
+ torture_fail_goto(tctx, done, "buffer check failed\n"); \
}} while (0)
#define CHECK_READX_ALIGN(io) do { \
@@ -70,15 +70,17 @@ static void setup_buffer(uint8_t *buf, unsigned int seed, int len)
/*
check a random buffer based on a seed
*/
-static bool check_buffer(uint8_t *buf, unsigned int seed, int len, int line)
+static bool check_buffer(struct torture_context *tctx, uint8_t *buf,
+ unsigned int seed, int len, int line)
{
int i;
srandom(seed);
for (i=0;i<len;i++) {
uint8_t v = random();
if (buf[i] != v) {
- printf("Buffer incorrect at line %d! ofs=%d v1=0x%x v2=0x%x\n",
- line, i, buf[i], v);
+ torture_warning(tctx, "Buffer incorrect at line %d! "
+ "ofs=%d v1=0x%x v2=0x%x\n", line, i,
+ buf[i], v);
return false;
}
}