svn commit: samba r16165 - in branches/SAMBA_4_0/source/torture: .
jelmer at samba.org
jelmer at samba.org
Mon Jun 12 19:50:00 GMT 2006
Author: jelmer
Date: 2006-06-12 19:49:53 +0000 (Mon, 12 Jun 2006)
New Revision: 16165
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16165
Log:
Add some more helper utilities
Modified:
branches/SAMBA_4_0/source/torture/ui.c
branches/SAMBA_4_0/source/torture/ui.h
Changeset:
Modified: branches/SAMBA_4_0/source/torture/ui.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ui.c 2006-06-12 19:48:58 UTC (rev 16164)
+++ branches/SAMBA_4_0/source/torture/ui.c 2006-06-12 19:49:53 UTC (rev 16165)
@@ -79,6 +79,11 @@
test->context->failed++;
}
+BOOL torture_result(struct torture_context *torture)
+{
+ return (torture->failed == 0);
+}
+
void torture_skip(struct torture_test *test, const char *fmt, ...) _PRINTF_ATTRIBUTE(2,3)
{
va_list ap;
Modified: branches/SAMBA_4_0/source/torture/ui.h
===================================================================
--- branches/SAMBA_4_0/source/torture/ui.h 2006-06-12 19:48:58 UTC (rev 16164)
+++ branches/SAMBA_4_0/source/torture/ui.h 2006-06-12 19:49:53 UTC (rev 16165)
@@ -78,6 +78,21 @@
return False; \
}
+#define torture_assert_casestr_equal(ctx,got,expected,string) \
+ if (strcasecmp(got, expected) != 0) { \
+ torture_fail(ctx, "%s:%d (%s): got %s, expected %s", __FILE__, \
+ __LINE__, string, got, expected); \
+ return False; \
+ }
+
+#define torture_assert_str_equal(ctx,got,expected,string) \
+ if (strcmp(got, expected) != 0) { \
+ torture_fail(ctx, "%s:%d (%s): got %s, expected %s", __FILE__, \
+ __LINE__, string, got, expected); \
+ return False; \
+ }
+
+
/* Convenience macros */
#define torture_assert_ntstatus_ok(ctx,expr,string) \
@@ -92,3 +107,4 @@
void torture_ok(struct torture_test *test);
void torture_fail(struct torture_test *test, const char *reason, ...) _PRINTF_ATTRIBUTE(2,3);
void torture_skip(struct torture_test *test, const char *reason, ...) _PRINTF_ATTRIBUTE(2,3);
+BOOL torture_result(struct torture_context *torture);
More information about the samba-cvs
mailing list