From fff25c858cb97d91e63dd6ece300e867e7b3ae99 Mon Sep 17 00:00:00 2001 From: Eric Marsman Date: Mon, 19 Jun 2017 11:20:17 -0400 Subject: [PATCH] Can oom (#389) reduce queue size to resolve memory errors. Tests updated as well. Temporary update to alleviate some of #388. --- src/tests/canread_tests.cpp | 8 ++++---- src/util/bytebuffer.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests/canread_tests.cpp b/src/tests/canread_tests.cpp index 1f49e399d..cb64dde0f 100644 --- a/src/tests/canread_tests.cpp +++ b/src/tests/canread_tests.cpp @@ -365,15 +365,15 @@ START_TEST (test_translate_many_signals) { getConfiguration()->pipeline.uart = NULL; ck_assert_int_eq(0, SENT_BYTES); - for(int i = 7; i < 23; i++) { + for(int i = 7; i < 19; i++) { can::read::translateSignal(&getSignals()[i], &TEST_MESSAGE, getSignals(), getSignalCount(), &getConfiguration()->pipeline); fail_unless(getSignals()[i].received); } fail_unless(USB_PROCESSED); - // 8 signals sent - ck_assert_int_eq(15 * 34 + 2, SENT_BYTES); - // 6 in the output queue + // 8 signals sent - depends on queue size + ck_assert_int_eq(11 * 34 + 2, SENT_BYTES); + // 1 in the output queue fail_if(queueEmpty()); ck_assert_int_eq(1 * 34, QUEUE_LENGTH(uint8_t, OUTPUT_QUEUE)); } diff --git a/src/util/bytebuffer.h b/src/util/bytebuffer.h index 7f4e42e5e..ce6166323 100644 --- a/src/util/bytebuffer.h +++ b/src/util/bytebuffer.h @@ -4,7 +4,7 @@ #include "emqueue.h" #include "commands/commands.h" -QUEUE_DECLARE(uint8_t, 512) +QUEUE_DECLARE(uint8_t, 384) namespace openxc { namespace util {