summaryrefslogtreecommitdiff
path: root/source4/torture/local/resolve.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-06-16 22:06:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:09 -0500
commit582d46ec42144bddccddacadd52a0256f58cb453 (patch)
tree0545454b21f1ef986117f7c2e72fe957d2b662e2 /source4/torture/local/resolve.c
parentcc9d70bbba4e326ba89dec8cdc58b64b89f33091 (diff)
downloadsamba-582d46ec42144bddccddacadd52a0256f58cb453.tar.gz
samba-582d46ec42144bddccddacadd52a0256f58cb453.tar.bz2
samba-582d46ec42144bddccddacadd52a0256f58cb453.zip
r16304: Improve testing UI API. This now allows registering the full
test suite tree, looks a bit more like other unit testing API's, fixes some memory responsibility issues, introduces testcases, and removes the need for tests to call torture_ok(). (This used to be commit 0445b1a56a02552f895f400960b9ced39244a144)
Diffstat (limited to 'source4/torture/local/resolve.c')
-rw-r--r--source4/torture/local/resolve.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/source4/torture/local/resolve.c b/source4/torture/local/resolve.c
index 29606f4966..da83b45341 100644
--- a/source4/torture/local/resolve.c
+++ b/source4/torture/local/resolve.c
@@ -26,11 +26,9 @@
#include "torture/torture.h"
#include "torture/ui.h"
-static BOOL test_async_resolve(struct torture_context *torture)
+static BOOL test_async_resolve(struct torture_context *test, const void *_data)
{
struct nbt_name n;
- struct torture_test *test = torture_test(torture, "async_resolve",
- "asynchronous resolve");
struct event_context *ev;
int timelimit = lp_parm_int(-1, "torture", "timelimit", 10);
const char *host = lp_parm_string(-1, "torture", "host");
@@ -56,21 +54,18 @@ static BOOL test_async_resolve(struct torture_context *torture)
torture_comment(test, "async rate of %.1f resolves/sec",
count/timeval_elapsed(&tv));
- talloc_free(test);
return True;
}
/*
test resolution using sync method
*/
-static BOOL test_sync_resolve(struct torture_context *torture)
+static BOOL test_sync_resolve(struct torture_context *test, const void *_data)
{
int timelimit = lp_parm_int(-1, "torture", "timelimit", 10);
struct timeval tv = timeval_current();
int count = 0;
const char *host = lp_parm_string(-1, "torture", "host");
- struct torture_test *test = torture_test(torture, "sync resolve",
- "synchronous resolve");
torture_comment(test, "Testing sync resolve of localhost for %d seconds",
timelimit);
@@ -82,15 +77,17 @@ static BOOL test_sync_resolve(struct torture_context *torture)
torture_comment(test, "sync rate of %.1f resolves/sec",
count/timeval_elapsed(&tv));
- talloc_free(test);
return True;
}
BOOL torture_local_resolve(struct torture_context *torture)
{
- test_async_resolve(torture);
- test_sync_resolve(torture);
+ struct torture_suite *suite = torture_suite_create(torture,
+ "LOCAL-RESOLVE");
- return torture_result(torture);
+ torture_suite_add_simple_tcase(suite, "async", test_async_resolve, NULL);
+ torture_suite_add_simple_tcase(suite, "sync", test_sync_resolve, NULL);
+
+ return torture_run_suite(torture, suite);
}