diff --git a/firmware/development/engine_sniffer.cpp b/firmware/development/engine_sniffer.cpp index 191ae08dc3..1c18e5290d 100644 --- a/firmware/development/engine_sniffer.cpp +++ b/firmware/development/engine_sniffer.cpp @@ -115,6 +115,10 @@ bool WaveChart::isFull() const { return counter >= CONFIG(engineChartSize); } +int WaveChart::getSize() { + return counter; +} + #if ! EFI_UNIT_TEST static void printStatus(void) { scheduleMsg(&logger, "engine chart: %s", boolToString(engineConfiguration->isEngineChartEnabled)); diff --git a/firmware/development/engine_sniffer.h b/firmware/development/engine_sniffer.h index 17e8cfd6c2..ad1deea51b 100644 --- a/firmware/development/engine_sniffer.h +++ b/firmware/development/engine_sniffer.h @@ -31,6 +31,7 @@ public: bool isStartedTooLongAgo() const; // looks like this is only used by functional tests on real hardware efitick_t pauseEngineSnifferUntilNt = 0; + int getSize(); private: Logging logging; diff --git a/unit_tests/tests/trigger/test_cam_vvt_input.cpp b/unit_tests/tests/trigger/test_cam_vvt_input.cpp index 6b1b8c34e6..2a5e8347cf 100644 --- a/unit_tests/tests/trigger/test_cam_vvt_input.cpp +++ b/unit_tests/tests/trigger/test_cam_vvt_input.cpp @@ -8,6 +8,9 @@ #include "engine_test_helper.h" extern WarningCodeState unitTestWarningCodeState; +#include "engine_sniffer.h" +extern WaveChart waveChart; + TEST(trigger, testNoStartUpWarningsNoSyncronizationTrigger) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); // one tooth does not need synchronization it just counts tooth @@ -163,4 +166,6 @@ TEST(sensors, testNB2CamInput) { ASSERT_NEAR(-67.6 - 720 - 720, engine->triggerCentral.getVVTPosition(0, 0), EPS3D); // actually position based on VVT! ASSERT_EQ(totalRevolutionCountBeforeVvtSync + 2, engine->triggerCentral.triggerState.getTotalRevolutionCounter()); + + ASSERT_EQ(28, waveChart.getSize()); }