summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-07-03 15:37:25 +0200
committerStefan Metzmacher <metze@samba.org>2020-07-07 10:30:39 +0000
commita4a6c03bf8448923525a4997e4a7a3bd1f29c70f (patch)
tree7aa70fb071e339bdab4b47782d161295675e4a1a
parentf6eb56bff29f73732048b31b4caa4138ada0e100 (diff)
downloadsamba-a4a6c03bf8448923525a4997e4a7a3bd1f29c70f.tar.gz
lib/torture: add back links to the parent objects
This makes would allow the full name of a test to be constructed if needed in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--lib/torture/torture.c3
-rw-r--r--lib/torture/torture.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/torture/torture.c b/lib/torture/torture.c
index 51ec99828dc..d808b788481 100644
--- a/lib/torture/torture.c
+++ b/lib/torture/torture.c
@@ -297,6 +297,7 @@ bool torture_suite_init_tcase(struct torture_suite *suite,
tcase->tests = NULL;
DLIST_ADD_END(suite->testcases, tcase);
+ tcase->suite = suite;
return true;
}
@@ -623,6 +624,7 @@ struct torture_tcase *torture_suite_add_simple_tcase_const(
test->dangerous = false;
DLIST_ADD_END(tcase->tests, test);
+ test->tcase = tcase;
return tcase;
}
@@ -671,6 +673,7 @@ bool torture_suite_add_suite(struct torture_suite *suite,
return false;
DLIST_ADD_END(suite->children, child);
+ child->parent = suite;
/* FIXME: Check for duplicates and return false if the
* added suite already exists as a child */
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index a6f829f1ff0..3f1f19a29b0 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -143,6 +143,8 @@ struct torture_test {
/** Use data for this test */
const void *data;
+
+ struct torture_tcase *tcase;
};
/*
@@ -157,6 +159,7 @@ struct torture_tcase {
void *data;
struct torture_test *tests;
struct torture_tcase *prev, *next;
+ const struct torture_suite *suite;
};
struct torture_suite
@@ -165,6 +168,7 @@ struct torture_suite
const char *description;
struct torture_tcase *testcases;
struct torture_suite *children;
+ const struct torture_suite *parent;
/* Pointers to siblings of this torture suite */
struct torture_suite *prev, *next;