From 4f2d148ae562d6ba37557f4a23948437348d4ecf Mon Sep 17 00:00:00 2001 From: Roy Oursler Date: Thu, 25 May 2017 14:59:28 -0700 Subject: [PATCH] erasure_code: Limit efence test length Change-Id: Ib3bb0fa2fbcbbb759af7ea54fef5ea24ee1ba7cd Signed-off-by: Roy Oursler --- erasure_code/erasure_code_test.c | 3 ++- erasure_code/erasure_code_update_test.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/erasure_code/erasure_code_test.c b/erasure_code/erasure_code_test.c index 7fe3208..d25186a 100644 --- a/erasure_code/erasure_code_test.c +++ b/erasure_code/erasure_code_test.c @@ -47,6 +47,7 @@ #define KMAX TEST_SOURCES #define EFENCE_TEST_MIN_SIZE 16 +#define EFENCE_TEST_MAX_SIZE EFENCE_TEST_MIN_SIZE + 0x100 #ifdef EC_ALIGNED_ADDR // Define power of 2 range to check ptr, len alignment @@ -489,7 +490,7 @@ int main(int argc, char *argv[]) for (j = 0; j < TEST_LEN; j++) buffs[i][j] = rand(); - for (size = EFENCE_TEST_MIN_SIZE; size <= TEST_SIZE; size += align) { + for (size = EFENCE_TEST_MIN_SIZE; size <= EFENCE_TEST_MAX_SIZE; size += align) { for (i = 0; i < m; i++) { // Line up TEST_SIZE from end efence_buffs[i] = buffs[i] + TEST_LEN - size; } diff --git a/erasure_code/erasure_code_update_test.c b/erasure_code/erasure_code_update_test.c index a21ff5a..207dfcd 100644 --- a/erasure_code/erasure_code_update_test.c +++ b/erasure_code/erasure_code_update_test.c @@ -56,6 +56,8 @@ #define MMAX TEST_SOURCES #define KMAX TEST_SOURCES +#define EFENCE_TEST_MAX_SIZE 0x100 + #ifdef EC_ALIGNED_ADDR // Define power of 2 range to check ptr, len alignment # define PTR_ALIGN_CHK_B 0 @@ -592,7 +594,7 @@ int main(int argc, char *argv[]) } } - for (size = 0; size <= TEST_SIZE; size += align) { + for (size = 0; size <= EFENCE_TEST_MAX_SIZE; size += align) { for (i = 0; i < m; i++) { // Line up TEST_SIZE from end efence_buffs[i] = buffs[i] + TEST_LEN - size; efence_update_buffs[i] = update_buffs[i] + TEST_LEN - size;