HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
Loading...
Searching...
No Matches
ntc_handler_comprehensive_test.cpp File Reference

Comprehensive test suite for NtcTemperatureHandler. More...

#include "TestFramework.h"
#include "esp32_bus_setup.hpp"
#include "esp32_test_config.hpp"
#include "handlers/ntc/NtcTemperatureHandler.h"
#include <cmath>
#include <memory>
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Include dependency graph for ntc_handler_comprehensive_test.cpp:

Functions

static void threshold_callback (BaseTemperature *sensor, float temperature, hf_u32_t type, void *user_data)
 
static bool create_handler () noexcept
 
static bool test_initialize () noexcept
 
static bool test_sensor_info () noexcept
 
static bool test_capabilities () noexcept
 
static bool test_read_temperature () noexcept
 
static bool test_read_temperature_consistency () noexcept
 
static bool test_set_calibration_offset () noexcept
 
static bool test_enable_filtering () noexcept
 
static bool test_threshold_monitoring () noexcept
 
static void continuous_callback (BaseTemperature *sensor, const hf_temp_reading_t *reading, void *user_data)
 
static bool test_continuous_monitoring () noexcept
 
static bool test_statistics () noexcept
 
static bool test_diagnostics () noexcept
 
static bool test_sleep_mode () noexcept
 
static bool test_self_test () noexcept
 
static bool test_health_check () noexcept
 
void app_main (void)
 

Variables

static const char * TAG = "NTC_Handler_Test"
 
static TestResults g_test_results
 
static constexpr bool ENABLE_INITIALIZATION_TESTS = true
 
static constexpr bool ENABLE_TEMPERATURE_READING_TESTS = true
 
static constexpr bool ENABLE_CALIBRATION_TESTS = true
 
static constexpr bool ENABLE_FILTERING_TESTS = true
 
static constexpr bool ENABLE_THRESHOLD_TESTS = true
 
static constexpr bool ENABLE_CONTINUOUS_MONITORING_TESTS = true
 
static constexpr bool ENABLE_STATISTICS_TESTS = true
 
static constexpr bool ENABLE_SLEEP_MODE_TESTS = true
 
static constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
 
static std::unique_ptr< NtcTemperatureHandlerg_handler
 
static volatile bool g_threshold_triggered = false
 
static volatile float g_threshold_temperature = 0.0f
 
static volatile int g_continuous_count = 0
 

Detailed Description

Comprehensive test suite for NtcTemperatureHandler.

Tests: BaseAdc-driven init, temperature reading (Celsius/Fahrenheit), calibration offset, EMA filtering, voltage divider config, conversion methods, threshold monitoring, continuous monitoring (PeriodicTimer), statistics, diagnostics, self-test, health check, sleep mode, and thread safety via RtosMutex.

Author
HardFOC Team
Date
2025-2026

Function Documentation

◆ app_main()

void app_main ( void )
Here is the call graph for this function:

◆ continuous_callback()

static void continuous_callback ( BaseTemperature * sensor,
const hf_temp_reading_t * reading,
void * user_data )
static
Here is the caller graph for this function:

◆ create_handler()

static bool create_handler ( )
staticnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_capabilities()

static bool test_capabilities ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_continuous_monitoring()

static bool test_continuous_monitoring ( )
staticnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_diagnostics()

static bool test_diagnostics ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_enable_filtering()

static bool test_enable_filtering ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_health_check()

static bool test_health_check ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_initialize()

static bool test_initialize ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_read_temperature()

static bool test_read_temperature ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_read_temperature_consistency()

static bool test_read_temperature_consistency ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_self_test()

static bool test_self_test ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_sensor_info()

static bool test_sensor_info ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_set_calibration_offset()

static bool test_set_calibration_offset ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_sleep_mode()

static bool test_sleep_mode ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_statistics()

static bool test_statistics ( )
staticnoexcept
Here is the caller graph for this function:

◆ test_threshold_monitoring()

static bool test_threshold_monitoring ( )
staticnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ threshold_callback()

static void threshold_callback ( BaseTemperature * sensor,
float temperature,
hf_u32_t type,
void * user_data )
static
Here is the caller graph for this function:

Variable Documentation

◆ ENABLE_CALIBRATION_TESTS

constexpr bool ENABLE_CALIBRATION_TESTS = true
staticconstexpr

◆ ENABLE_CONTINUOUS_MONITORING_TESTS

constexpr bool ENABLE_CONTINUOUS_MONITORING_TESTS = true
staticconstexpr

◆ ENABLE_ERROR_HANDLING_TESTS

constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
staticconstexpr

◆ ENABLE_FILTERING_TESTS

constexpr bool ENABLE_FILTERING_TESTS = true
staticconstexpr

◆ ENABLE_INITIALIZATION_TESTS

constexpr bool ENABLE_INITIALIZATION_TESTS = true
staticconstexpr

◆ ENABLE_SLEEP_MODE_TESTS

constexpr bool ENABLE_SLEEP_MODE_TESTS = true
staticconstexpr

◆ ENABLE_STATISTICS_TESTS

constexpr bool ENABLE_STATISTICS_TESTS = true
staticconstexpr

◆ ENABLE_TEMPERATURE_READING_TESTS

constexpr bool ENABLE_TEMPERATURE_READING_TESTS = true
staticconstexpr

◆ ENABLE_THRESHOLD_TESTS

constexpr bool ENABLE_THRESHOLD_TESTS = true
staticconstexpr

◆ g_continuous_count

volatile int g_continuous_count = 0
static

◆ g_handler

std::unique_ptr<NtcTemperatureHandler> g_handler
static

◆ g_test_results

TestResults g_test_results
static

◆ g_threshold_temperature

volatile float g_threshold_temperature = 0.0f
static

◆ g_threshold_triggered

volatile bool g_threshold_triggered = false
static

◆ TAG

const char* TAG = "NTC_Handler_Test"
static