diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-09-14 05:13:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:39 -0500 |
commit | a13360119256cc3d579cb8e936ffb35b2f6799cd (patch) | |
tree | 43eea4a706c3bc9bba6bf3bf17d25d9bd6b8a008 /source4 | |
parent | 870cae2736f25f8ad8d5b44e5266a67869cdd38e (diff) | |
download | samba-a13360119256cc3d579cb8e936ffb35b2f6799cd.tar.gz samba-a13360119256cc3d579cb8e936ffb35b2f6799cd.tar.bz2 samba-a13360119256cc3d579cb8e936ffb35b2f6799cd.zip |
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)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/local/irpc.c | 11 |
1 files 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]); } |