unit_test: support reference clock, test delay function

This commit is contained in:
morris
2020-08-13 11:56:52 +08:00
parent e90dbe29cb
commit 75a372a9f0
8 changed files with 3058 additions and 2308 deletions

View File

@@ -6,7 +6,6 @@
#include "esp_timer.h"
#include "esp_timer_impl.h"
#include "unity.h"
#include "soc/frc_timer_reg.h"
#include "soc/timer_group_reg.h"
#include "esp_heap_caps.h"
#include "freertos/FreeRTOS.h"
@@ -16,6 +15,10 @@
#include "esp_freertos_hooks.h"
#include "esp_rom_sys.h"
#if CONFIG_ESP_TIMER_IMPL_FRC2
#include "soc/frc_timer_reg.h"
#endif
#ifdef CONFIG_ESP_TIMER_PROFILING
#define WITH_PROFILING 1
#endif
@@ -855,6 +858,7 @@ TEST_CASE("Test case when esp_timer_impl_set_alarm needs set timer < now_time",
TEST_ASSERT(alarm_reg <= (count_reg + offset));
}
#ifdef CONFIG_ESP_TIMER_IMPL_FRC2
TEST_CASE("Test esp_timer_impl_set_alarm when the counter is near an overflow value", "[esp_timer]")
{
for (int i = 0; i < 1024; ++i) {
@@ -864,3 +868,4 @@ TEST_CASE("Test esp_timer_impl_set_alarm when the counter is near an overflow va
esp_timer_impl_set_alarm(1); // timestamp is expired
}
}
#endif