Module: xenomai-3
Branch: wip/heapmem
Commit: d032d8c0fdf7f19ab45f86669f3cede931020956
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d032d8c0fdf7f19ab45f86669f3cede931020956

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue May 15 15:29:44 2018 +0200

testsuite/smokey: memcheck: fix test heap sizes

---

 testsuite/smokey/memcheck/memcheck.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testsuite/smokey/memcheck/memcheck.c 
b/testsuite/smokey/memcheck/memcheck.c
index 3f18477..7f97218 100644
--- a/testsuite/smokey/memcheck/memcheck.c
+++ b/testsuite/smokey/memcheck/memcheck.c
@@ -776,7 +776,7 @@ int memcheck_run(struct memcheck_descriptor *md,
        for (heap_size = md->seq_min_heap_size;
             heap_size < md->seq_max_heap_size; heap_size <<= 1) {
                for (runs = 0; runs < md->random_rounds; runs++) {
-                       block_size = (random() % heap_size) ?: 1;
+                       block_size = (random() % (heap_size / 2)) ?: 1;
                        ret = test_seq(md, heap_size, block_size, 0);
                        if (ret) {
                                smokey_trace("failed with %zuk heap, "
@@ -846,7 +846,7 @@ int memcheck_run(struct memcheck_descriptor *md,
                 * between loops.
                 */
                __RT(clock_nanosleep(CLOCK_MONOTONIC, 0, &idle, NULL));
-               block_size = (random() % (heap_size / 2)) ?: 1;
+               block_size = (random() % (md->pattern_heap_size / 2)) ?: 1;
                ret = test_seq(md, md->pattern_heap_size, block_size,
                               test_flags(md, 
MEMCHECK_SHUFFLE|MEMCHECK_PATTERN));
                if (ret) {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to