From 97dd6de2809156f8fcdb4d958be8ba5c7a1e1c0a Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Wed, 2 Oct 2019 06:21:10 +0200 Subject: [PATCH] Fixes for recorder and tests. --- src/recorder.cpp | 2 +- src/tests.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/recorder.cpp b/src/recorder.cpp index 8c03c7a..88661f5 100644 --- a/src/recorder.cpp +++ b/src/recorder.cpp @@ -36,7 +36,7 @@ Recorder::Recorder() { LOGln("Recorder * Sending data to port %d", _client_port); } } else if (*(char*)data == 'E') { - String effect = String(((char*)(data+1))); + String effect = String((char*)data+1); LOGln("Recorder * Setting effect %s", effect.c_str()); Window::getFullWindow()->clear(); change_current_effect(effect); diff --git a/src/tests.cpp b/src/tests.cpp index 85e0939..056d55f 100644 --- a/src/tests.cpp +++ b/src/tests.cpp @@ -11,15 +11,18 @@ namespace tests { int i=0; Effect* effect; int32_t diffs[3] = {0, 0, 0}; + String effect_name; while (1) { for (int j=0; j<3; j++) { int free_at_start = ESP.getFreeHeap(); effect = select_effect(i); + effect->loop(1); if (effect == NULL) return; + effect_name = effect->get_name(); delete effect; diffs[i] = ESP.getFreeHeap() - free_at_start; } - LOGln("Tests * Memory leakage of effect #%d: %d, %d, %d", i, diffs[0], diffs[1], diffs[2]); + LOGln("Tests * Memory leakage of effect %s: %d, %d, %d", effect_name.c_str(), diffs[0], diffs[1], diffs[2]); i++; } }