|
MeshX 0.4
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
|
Property-based tests for MeshX PWM subsystem correctness. More...
#include <string.h>#include <stdbool.h>#include "unit_test.h"#include "../../meshx/interface/gpio/meshx_pwm.h"#include "../../meshx/interface/gpio/meshx_gpio.h"#include "../../meshx/interface/logging/meshx_log.h"#include "../../meshx/inc/module_id.h"Data Structures | |
| struct | pwm_test_config_t |
| Test configuration for PWM property tests. More... | |
| struct | pwm_test_state_t |
| Test state for tracking PWM operations. More... | |
Functions | |
| void | meshx_gpio_test_set_pin_count (uint8_t count) |
| void | meshx_gpio_test_set_pin_mode (uint8_t pin, meshx_gpio_mode_t mode) |
| void | meshx_pwm_test_set_pin_count (uint8_t count) |
| static void | init_test_state (void) |
| Initialize test state. | |
| static meshx_err_t | test_property_pwm_initialization (void) |
| Property 4.1: PWM initialization based on configuration. | |
| static meshx_err_t | test_property_pwm_start_stop (void) |
| Property 4.2: PWM start and stop operations. | |
| static meshx_err_t | test_property_duty_cycle_accuracy (void) |
| Property 4.3: Duty cycle accuracy. | |
| static meshx_err_t | test_property_frequency_accuracy (void) |
| Property 4.4: Frequency accuracy. | |
| static meshx_err_t | test_property_parameter_validation (void) |
| Property 4.5: Parameter validation against hardware limits. | |
| static meshx_err_t | test_property_channel_allocation (void) |
| Property 4.6: Hardware channel allocation and conflict handling. | |
| static meshx_err_t | test_property_state_maintenance (void) |
| Property 4.7: PWM state maintenance. | |
| static meshx_err_t | test_property_deinit_cleanup (void) |
| Property 4.8: Deinitialization and resource cleanup. | |
| static meshx_err_t | run_pwm_property_tests (void) |
| Comprehensive property test for PWM subsystem correctness. | |
| static meshx_err_t | pwm_property_test_handler (int cmd_id, int argc, char **argv) |
| PWM property test command handler. | |
| meshx_err_t | register_pwm_property_tests (void) |
| Register PWM property tests with unit test framework. | |
Variables | |
| static pwm_test_state_t | test_state |
Property-based tests for MeshX PWM subsystem correctness.
This file implements property-based tests for the MeshX PWM subsystem, specifically validating Property 4: PWM Subsystem Correctness.
Validates: Requirements 4.1-4.10
Property 4: PWM Subsystem Correctness For any GPIO pin configured for PWM output (with frequency, duty cycle, resolution, and channel specifications), the PWM subsystem SHALL:
|
static |
Initialize test state.
|
extern |
|
extern |
|
extern |
|
static |
PWM property test command handler.
This function is called by the unit test framework when PWM tests are requested.
| meshx_err_t register_pwm_property_tests | ( | void | ) |
Register PWM property tests with unit test framework.
|
static |
Comprehensive property test for PWM subsystem correctness.
Runs all property tests for Property 4: PWM Subsystem Correctness.
|
static |
Property 4.6: Hardware channel allocation and conflict handling.
Tests that hardware channel allocation and conflicts are handled properly.
|
static |
Property 4.8: Deinitialization and resource cleanup.
Tests that PWM subsystem deinitializes and cleans up resources during shutdown.
|
static |
Property 4.3: Duty cycle accuracy.
Tests that duty cycle can be set and get accurately (0-100%).
|
static |
Property 4.4: Frequency accuracy.
Tests that frequency can be set and get accurately.
|
static |
Property 4.5: Parameter validation against hardware limits.
Tests that PWM parameters are validated against hardware limits.
|
static |
Property 4.1: PWM initialization based on configuration.
Tests that PWM subsystem initializes correctly based on YAML configuration.
|
static |
Property 4.2: PWM start and stop operations.
Tests that PWM can be started and stopped as requested.
|
static |
Property 4.7: PWM state maintenance.
Tests that PWM state is maintained for runtime control and monitoring.
|
static |