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

Comprehensive test suite for Bno08xHandler. More...

#include "TestFramework.h"
#include "esp32_bus_setup.hpp"
#include "esp32_test_config.hpp"
#include "handlers/bno08x/Bno08xHandler.h"
#include <memory>
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Include dependency graph for bno08x_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_enable_accelerometer () noexcept
 
static bool test_disable_sensor () noexcept
 
static bool test_read_acceleration () noexcept
 
static bool test_read_imu_data () noexcept
 
static bool test_freshness_gating () noexcept
 
static bool test_full_config () noexcept
 
static bool test_hardware_reset () noexcept
 
static bool test_operations_before_init () noexcept
 
void app_main (void)
 

Variables

static const char * TAG = "BNO08x_Handler_Test"
 
static TestResults g_test_results
 
static constexpr bool ENABLE_INITIALIZATION_TESTS = true
 
static constexpr bool ENABLE_SENSOR_CONTROL_TESTS = true
 
static constexpr bool ENABLE_DATA_READING_TESTS = true
 
static constexpr bool ENABLE_FRESHNESS_TESTS = true
 
static constexpr bool ENABLE_CONFIG_TESTS = true
 
static constexpr bool ENABLE_CALLBACK_TESTS = true
 
static constexpr bool ENABLE_HARDWARE_CTRL_TESTS = true
 
static constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
 
static constexpr bool ENABLE_THREAD_SAFETY_TESTS = true
 
static std::unique_ptr< EspGpio > g_int_gpio
 
static std::unique_ptr< EspGpio > g_rst_gpio
 
static std::unique_ptr< Bno08xHandlerg_handler
 

Detailed Description

Comprehensive test suite for Bno08xHandler.

Tests the BNO08x IMU handler through its full public API, exercising the underlying CRTP I2C adapter and BNO085 driver.

Test Categories:

  1. Initialization & lifecycle (I2C probe, Begin, interface detection)
  2. Sensor enable/disable (accelerometer, gyroscope, magnetometer, etc.)
  3. Data reading (vectors, quaternion, Euler, activity, gestures)
  4. Freshness gating (HasNewData → valid flag)
  5. Configuration (apply, persist, intervals)
  6. Callback management
  7. Hardware reset / boot / wake pins
  8. Error mapping (SH-2 → Bno08xError)
  9. Thread safety

Hardware Required:

  • BNO085/BNO080 on I2C bus
  • INT and RST GPIOs connected
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 call graph for this function:
Here is the caller graph for this function:

◆ test_construction()

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

◆ test_disable_sensor()

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

◆ test_enable_accelerometer()

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

◆ test_freshness_gating()

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

◆ test_full_config()

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

◆ test_hardware_reset()

static bool test_hardware_reset ( )
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 call graph for this function:
Here is the caller graph for this function:

◆ test_read_acceleration()

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

◆ test_read_imu_data()

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

Variable Documentation

◆ ENABLE_CALLBACK_TESTS

constexpr bool ENABLE_CALLBACK_TESTS = true
staticconstexpr

◆ ENABLE_CONFIG_TESTS

constexpr bool ENABLE_CONFIG_TESTS = true
staticconstexpr

◆ ENABLE_DATA_READING_TESTS

constexpr bool ENABLE_DATA_READING_TESTS = true
staticconstexpr

◆ ENABLE_ERROR_HANDLING_TESTS

constexpr bool ENABLE_ERROR_HANDLING_TESTS = true
staticconstexpr

◆ ENABLE_FRESHNESS_TESTS

constexpr bool ENABLE_FRESHNESS_TESTS = true
staticconstexpr

◆ ENABLE_HARDWARE_CTRL_TESTS

constexpr bool ENABLE_HARDWARE_CTRL_TESTS = true
staticconstexpr

◆ ENABLE_INITIALIZATION_TESTS

constexpr bool ENABLE_INITIALIZATION_TESTS = true
staticconstexpr

◆ ENABLE_SENSOR_CONTROL_TESTS

constexpr bool ENABLE_SENSOR_CONTROL_TESTS = true
staticconstexpr

◆ ENABLE_THREAD_SAFETY_TESTS

constexpr bool ENABLE_THREAD_SAFETY_TESTS = true
staticconstexpr

◆ g_handler

std::unique_ptr<Bno08xHandler> g_handler
static

◆ g_int_gpio

std::unique_ptr<EspGpio> g_int_gpio
static

◆ g_rst_gpio

std::unique_ptr<EspGpio> g_rst_gpio
static

◆ g_test_results

TestResults g_test_results
static

◆ TAG

const char* TAG = "BNO08x_Handler_Test"
static