From a13360119256cc3d579cb8e936ffb35b2f6799cd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 14 Sep 2006 05:13:20 +0000 Subject: r18498: While passing stack values into torture_tcase_add_test is bad, values assigned into a static initialiser must be constant. Wishing sweet dreams on the jet-lagged tridge :-) Andrew Bartlett (This used to be commit 174014d956cb1d246bd07218ea289418195a73fb) --- source4/torture/local/irpc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source4/torture/local/irpc.c b/source4/torture/local/irpc.c index 2ce9eb675d..91f1e2fe53 100644 --- a/source4/torture/local/irpc.c +++ b/source4/torture/local/irpc.c @@ -242,12 +242,17 @@ struct torture_suite *torture_local_irpc(TALLOC_CTX *mem_ctx) struct torture_suite *suite = torture_suite_create(mem_ctx, "LOCAL-IRPC"); struct torture_tcase *tcase = torture_suite_add_tcase(suite, "irpc"); int i; - static uint32_t values[] = {0, 0x7FFFFFFE, 0xFFFFFFFE, 0xFFFFFFFF, - random() & 0xFFFFFFFF}; + uint32_t *values = talloc_array(tcase, uint32_t, 5); + + values[0] = 0; + values[1] = 0x7FFFFFFE; + values[2] = 0xFFFFFFFE; + values[3] = 0xFFFFFFFF; + values[4] = random() & 0xFFFFFFFF; tcase->setup = irpc_setup; - for (i = 0; i < ARRAY_SIZE(values); i++) { + for (i = 0; i < 5; i++) { torture_tcase_add_test(tcase, "addone", test_addone, (void *)values[i]); } -- cgit