From 45cf68ce8f9426757c37a8352f9d9104be814407 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 16 Nov 2008 16:19:58 +0100 Subject: s4:torture: fix the build with auto dependencies metze --- lib/torture/config.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/torture') diff --git a/lib/torture/config.mk b/lib/torture/config.mk index 8a7f2a3b6b..abd89260f6 100644 --- a/lib/torture/config.mk +++ b/lib/torture/config.mk @@ -4,6 +4,7 @@ PUBLIC_DEPENDENCIES = \ LIBSAMBA-HOSTCONFIG \ LIBSAMBA-UTIL \ LIBTALLOC +CFLAGS = -I$(libtorturesrcdir) -I$(libtorturesrcdir)/../ torture_VERSION = 0.0.1 torture_SOVERSION = 0 -- cgit From 3d0a3c1078d936a52ce82720ddc09b4037653655 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 5 Nov 2008 12:00:44 +1100 Subject: Add helpful function for comparison of DATA_BLOB elements --- lib/torture/torture.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/torture') diff --git a/lib/torture/torture.h b/lib/torture/torture.h index f16d2707bb..73ea1eb643 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -284,6 +284,21 @@ void torture_result(struct torture_context *test, } \ } while(0) +#define torture_assert_data_blob_equal(torture_ctx,got,expected,cmt)\ + do { const DATA_BLOB __got = (got), __expected = (expected); \ + if (__got.length != __expected.length) { \ + torture_result(torture_ctx, TORTURE_FAIL, \ + __location__": "#got".len %d did not match "#expected" len %d: %s", \ + (int)__got.length, (int)__expected.length, cmt); \ + return false; \ + } \ + if (memcmp(__got.data, __expected.data, __got.length) != 0) { \ + torture_result(torture_ctx, TORTURE_FAIL, \ + __location__": "#got" of len %d did not match"#expected": %s", (int)__got.length, cmt); \ + return false; \ + } \ + } while(0) + #define torture_assert_file_contains_text(torture_ctx,filename,expected,cmt)\ do { \ char *__got; \ -- cgit