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.
This commit is contained in:
Marius Vikhammer 2021-02-18 11:43:52 +08:00
parent 8e7db81ce8
commit 451465ff8c

View File

@ -87,8 +87,13 @@ TEST_CASE("esp_timer orders timers correctly", "[esp_timer]")
}
fflush(stream);
fseek(stream, 0, SEEK_SET);
/* 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) {
char line[128];
TEST_ASSERT_NOT_NULL(fgets(line, sizeof(line), stream));
#if WITH_PROFILING
int timer_id;