esp_timer: fix "esp_timer orders timers correctly" headerline handling
Discard header lines from esp_timer_dump that comes before the actual timer
info. "esp_timer orders timers correctly" would crash when reading the header lines.
@@ -87,9 +87,14 @@ TEST_CASE("esp_timer orders timers correctly", "[esp_timer]")
}
fflush(stream);
fseek(stream, 0, SEEK_SET);
- for (size_t i = 0; i < num_timers; ++i) {
+
+ /* Discard header lines */
char line[128];
TEST_ASSERT_NOT_NULL(fgets(line, sizeof(line), stream));
+ TEST_ASSERT_NOT_NULL(fgets(line, sizeof(line), stream));
+
+ for (size_t i = 0; i < num_timers; ++i) {
+ TEST_ASSERT_NOT_NULL(fgets(line, sizeof(line), stream));
#if WITH_PROFILING
int timer_id;
sscanf(line, "timer%d", &timer_id);
