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

Comprehensive test suite for Ws2812Handler. More...

#include "TestFramework.h"
#include "esp32_bus_setup.hpp"
#include "esp32_test_config.hpp"
#include "handlers/ws2812/Ws2812Handler.h"
#include <memory>
#include "esp_log.h"
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Include dependency graph for ws2812_handler_comprehensive_test.cpp:

Functions

static bool create_handler () noexcept
 
static bool test_construction () noexcept
 
static bool test_initialize () noexcept
 
static bool test_is_initialized () noexcept
 
static bool test_set_pixel () noexcept
 
static bool test_set_all_pixels () noexcept
 
static bool test_show () noexcept
 
static bool test_clear () noexcept
 
static bool test_pixel_out_of_range () noexcept
 
static bool test_color_sequence () noexcept
 
static bool test_set_brightness () noexcept
 
static bool test_brightness_range () noexcept
 
static bool test_set_effect_rainbow () noexcept
 
static bool test_tick () noexcept
 
static bool test_step () noexcept
 
static bool test_get_strip () noexcept
 
static bool test_get_animator () noexcept
 
static bool test_get_num_leds () noexcept
 
static bool test_dump_diagnostics () noexcept
 
static bool test_operations_before_init () noexcept
 
static bool test_deinitialize () noexcept
 
void app_main (void)
 

Variables

static const char * TAG = "WS2812_Handler_Test"
 
static TestResults g_test_results
 
static constexpr bool ENABLE_CONSTRUCTION_TESTS = true
 
static constexpr bool ENABLE_INITIALIZATION_TESTS = true
 
static constexpr bool ENABLE_PIXEL_CONTROL_TESTS = true
 
static constexpr bool ENABLE_BRIGHTNESS_TESTS = true
 
static constexpr bool ENABLE_ANIMATION_TESTS = true
 
static constexpr bool ENABLE_DIRECT_ACCESS_TESTS = true
 
static constexpr bool ENABLE_DIAGNOSTICS_TESTS = true
 
static constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
 
static std::unique_ptr< Ws2812Handlerg_handler
 
static bool g_hw_present = false
 

Detailed Description

Comprehensive test suite for Ws2812Handler.

Tests: Config-based construction, initialization, pixel set (individual + all), clear, show, brightness, animation effects (rainbow, chase, breathe), tick/step, GetNumLeds, direct strip/animator access, diagnostics dump, and pre-init error handling.

Note
This test requires a WS2812B LED strip connected to the data GPIO. Without hardware, initialization may still succeed (RMT configures regardless) but visual confirmation requires LEDs.
Author
HardFOC Team
Date
2025-2026

Function Documentation

◆ app_main()

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

◆ create_handler()

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

◆ test_brightness_range()

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

◆ test_clear()

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

◆ test_color_sequence()

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

◆ test_construction()

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

◆ test_deinitialize()

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

◆ test_dump_diagnostics()

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

◆ test_get_animator()

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

◆ test_get_num_leds()

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

◆ test_get_strip()

static bool test_get_strip ( )
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_is_initialized()

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

◆ test_operations_before_init()

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

◆ test_pixel_out_of_range()

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

◆ test_set_all_pixels()

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

◆ test_set_brightness()

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

◆ test_set_effect_rainbow()

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

◆ test_set_pixel()

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

◆ test_show()

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

◆ test_step()

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

◆ test_tick()

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

Variable Documentation

◆ ENABLE_ANIMATION_TESTS

constexpr bool ENABLE_ANIMATION_TESTS = true
staticconstexpr

◆ ENABLE_BRIGHTNESS_TESTS

constexpr bool ENABLE_BRIGHTNESS_TESTS = true
staticconstexpr

◆ ENABLE_CONSTRUCTION_TESTS

constexpr bool ENABLE_CONSTRUCTION_TESTS = true
staticconstexpr

◆ ENABLE_DIAGNOSTICS_TESTS

constexpr bool ENABLE_DIAGNOSTICS_TESTS = true
staticconstexpr

◆ ENABLE_DIRECT_ACCESS_TESTS

constexpr bool ENABLE_DIRECT_ACCESS_TESTS = true
staticconstexpr

◆ ENABLE_ERROR_HANDLING_TESTS

constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
staticconstexpr

◆ ENABLE_INITIALIZATION_TESTS

constexpr bool ENABLE_INITIALIZATION_TESTS = true
staticconstexpr

◆ ENABLE_PIXEL_CONTROL_TESTS

constexpr bool ENABLE_PIXEL_CONTROL_TESTS = true
staticconstexpr

◆ g_handler

std::unique_ptr<Ws2812Handler> g_handler
static

◆ g_hw_present

bool g_hw_present = false
static

◆ g_test_results

TestResults g_test_results
static

◆ TAG

const char* TAG = "WS2812_Handler_Test"
static