From 4b73689468ebe2e25a22d73fecb1a035b2303efd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Jan 2005 11:45:43 +0000 Subject: r4711: - deprecate talloc_destroy() - expanded the talloc_realloc() test a little (I was concerned about a possible bug, which turned out to be an illusion) - don't enable gcov by default in Makefile.talloc (This used to be commit 4ec47cc1083c4cdb780e548177631c5914bf677a) --- source4/lib/talloc/testsuite.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'source4/lib/talloc/testsuite.c') diff --git a/source4/lib/talloc/testsuite.c b/source4/lib/talloc/testsuite.c index d93894b520..bc1c18fdc1 100644 --- a/source4/lib/talloc/testsuite.c +++ b/source4/lib/talloc/testsuite.c @@ -575,7 +575,7 @@ static BOOL test_realloc_child(void) int count; struct el2 { const char *name; - } **list; + } **list, **list2, **list3; } *el1; struct el2 *el2; @@ -587,11 +587,22 @@ static BOOL test_realloc_child(void) el1->list = talloc(el1, struct el2 *); el1->list[0] = talloc(el1->list, struct el2); el1->list[0]->name = talloc_strdup(el1->list[0], "testing"); + + el1->list2 = talloc(el1, struct el2 *); + el1->list2[0] = talloc(el1->list2, struct el2); + el1->list2[0]->name = talloc_strdup(el1->list2[0], "testing2"); + + el1->list3 = talloc(el1, struct el2 *); + el1->list3[0] = talloc(el1->list3, struct el2); + el1->list3[0]->name = talloc_strdup(el1->list3[0], "testing2"); el2 = talloc(el1->list, struct el2); + el2 = talloc(el1->list2, struct el2); + el2 = talloc(el1->list3, struct el2); - el1->list = talloc_realloc(el1, el1->list, struct el2 *, 2); - el1->list[1] = el2; + el1->list = talloc_realloc(el1, el1->list, struct el2 *, 100); + el1->list2 = talloc_realloc(el1, el1->list2, struct el2 *, 200); + el1->list3 = talloc_realloc(el1, el1->list3, struct el2 *, 300); talloc_free(root); -- cgit