From 56cb320be0718e2b8b883149a7f878c8741eb00f Mon Sep 17 00:00:00 2001 From: Tony Cabello Miguel <> Date: Wed, 5 May 2021 15:26:41 +0200 Subject: [PATCH] OSD Test for Sats indicator fixed --- src/test/unit/osd_unittest.cc | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/test/unit/osd_unittest.cc b/src/test/unit/osd_unittest.cc index 9b92c454b..d397afdcb 100644 --- a/src/test/unit/osd_unittest.cc +++ b/src/test/unit/osd_unittest.cc @@ -1152,7 +1152,18 @@ TEST_F(OsdTest, TestGpsElements) osdRefresh(simulationTime); // then - displayPortTestBufferSubstring(2, 4, "%c%cNC", SYM_SAT_L, SYM_SAT_R); + // Sat indicator should blink and show "NC" + for (int i = 0; i < 15; i++) { + // Blinking should happen at 5Hz + simulationTime += 0.2e6; + osdRefresh(simulationTime); + + if (i % 2 == 0) { + displayPortTestBufferSubstring(2, 4, "%c%cNC", SYM_SAT_L, SYM_SAT_R); + } else { + displayPortTestBufferIsEmpty(); + } + } // when simulationGpsHealthy = true; @@ -1162,7 +1173,18 @@ TEST_F(OsdTest, TestGpsElements) osdRefresh(simulationTime); // then - displayPortTestBufferSubstring(2, 4, "%c%c%2d", SYM_SAT_L, SYM_SAT_R, 0); + // Sat indicator should blink and show "0" + for (int i = 0; i < 15; i++) { + // Blinking should happen at 5Hz + simulationTime += 0.2e6; + osdRefresh(simulationTime); + + if (i % 2 == 0) { + displayPortTestBufferSubstring(2, 4, "%c%c 0", SYM_SAT_L, SYM_SAT_R); + } else { + displayPortTestBufferIsEmpty(); + } + } // when simulationGpsHealthy = true; @@ -1172,8 +1194,14 @@ TEST_F(OsdTest, TestGpsElements) osdRefresh(simulationTime); // then - displayPortTestBufferSubstring(2, 4, "%c%c%2d", SYM_SAT_L, SYM_SAT_R, 10); + // Sat indicator should show "10" without flashing + for (int i = 0; i < 15; i++) { + // Blinking should happen at 5Hz + simulationTime += 0.2e6; + osdRefresh(simulationTime); + displayPortTestBufferSubstring(2, 4, "%c%c10", SYM_SAT_L, SYM_SAT_R); + } } // STUBS