X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftal%2Ftest%2Frun-iter.c;h=7021be27555df5705b43a85ecf69bbb317a1ff77;hp=6fc7537140c6d5a6b131dfe110be1ba4406d20d2;hb=0f6d854ab9d85ac7e4487ff3eee464be6bb528aa;hpb=932d65dd6537250e617516749f03a00fea3b34f6 diff --git a/ccan/tal/test/run-iter.c b/ccan/tal/test/run-iter.c index 6fc75371..7021be27 100644 --- a/ccan/tal/test/run-iter.c +++ b/ccan/tal/test/run-iter.c @@ -6,21 +6,14 @@ int main(void) { - char *p[NUM], *iter; + char *p[NUM] = { NULL }, *iter; int i; plan_tests(NUM + 1 + NUM); - /* Create a random tree, but make sure we get multiple - * top-level groups! */ + /* Create a random tree */ for (i = 0; i < NUM; i++) { - p[i] = tal(NULL, char); - *p[i] = '0'; - if (next_group(&null_parent.c.group) != &null_parent.c.group) - break; - } - for (i++; i < NUM; i++) { - p[i] = tal(p[rand() % i], char); + p[i] = tal(p[rand() % (i + 1)], char); *p[i] = '0'; }