3-phase PV router
Loading...
Searching...
No Matches
test_main.cpp File Reference

Native unit tests for utils_override.h. More...

#include <unity.h>
#include "utils_override.h"
Include dependency graph for test_main.cpp:

Go to the source code of this file.

Macros

#define REMOTE_LOAD(n)
 

Functions

int main (void)
 
void setUp (void)
 
void tearDown (void)
 
void test_are_pins_valid_all_valid (void)
 
void test_are_pins_valid_rejects_pin_0 (void)
 
void test_are_pins_valid_rejects_pin_1 (void)
 
void test_are_pins_valid_rejects_pin_14_and_above (void)
 
void test_indicesToBitmask_all_bits (void)
 
void test_indicesToBitmask_consecutive (void)
 
void test_indicesToBitmask_multiple_indices (void)
 
void test_indicesToBitmask_single_index (void)
 
void test_KeyIndexPair_construction (void)
 
void test_KeyIndexPair_from_bitmask (void)
 
void test_KeyIndexPair_getLocalBitmask (void)
 
void test_KeyIndexPair_getRemoteBitmask_empty (void)
 
void test_KeyIndexPair_getRemoteBitmask_mixed (void)
 
void test_KeyIndexPair_getRemoteBitmask_remote_only (void)
 
void test_KeyIndexPair_single_pin (void)
 
void test_OverrideTable_findLocalBitmask_found (void)
 
void test_OverrideTable_findLocalBitmask_not_found (void)
 
void test_OverrideTable_findRemoteBitmask_found (void)
 
void test_OverrideTable_findRemoteBitmask_not_found (void)
 
void test_OverrideTable_from_the_settings_matches_plain_pins (void)
 
void test_OverrideTable_getLocalBitmask_out_of_bounds (void)
 
void test_OverrideTable_getPin_out_of_bounds (void)
 
void test_OverrideTable_getRemoteBitmask_local_only (void)
 
void test_OverrideTable_getRemoteBitmask_mixed (void)
 
void test_OverrideTable_getRemoteBitmask_out_of_bounds (void)
 
void test_OverrideTable_getRemoteBitmask_remote_only (void)
 
void test_OverrideTable_many_entries (void)
 
void test_OverrideTable_multiple_entries (void)
 
void test_OverrideTable_multiple_entries_mixed (void)
 
void test_OverrideTable_single_entry (void)
 
void test_OverrideTable_with_bitmask_constructor (void)
 
void test_PinList_default_constructor (void)
 
void test_PinList_from_bitmask (void)
 
void test_PinList_from_bitmask_empty (void)
 
void test_PinList_from_bitmask_full (void)
 
void test_PinList_from_uint32_bitmask_local_only (void)
 
void test_PinList_from_uint32_bitmask_mixed (void)
 
void test_PinList_from_uint32_bitmask_remote_only (void)
 
void test_PinList_max_pins (void)
 
void test_PinList_single_pin (void)
 
void test_PinList_toLocalBitmask (void)
 
void test_PinList_toRemoteBitmask_empty (void)
 
void test_PinList_toRemoteBitmask_local_only (void)
 
void test_PinList_toRemoteBitmask_mixed (void)
 
void test_PinList_toRemoteBitmask_multiple_remote (void)
 
void test_PinList_toRemoteBitmask_single_remote (void)
 
void test_PinList_variadic_constructor (void)
 
void test_TargetMap_a_group_and_single_targets_in_one_list (void)
 
void test_TargetMap_groups (void)
 
void test_TargetMap_LOAD_gives_the_pin_or_the_remote_rank (void)
 
void test_TargetMap_out_of_range_gives_pin_0 (void)
 
void test_TargetMap_plain_pins_pass_through (void)
 
void test_TargetMap_RELAY_needs_relay_diversion (void)
 

Detailed Description

Native unit tests for utils_override.h.

Tests pure C++ bitmask utilities: PinList, KeyIndexPair, OverrideTable, TargetMap, indicesToBitmask, are_pins_valid. No config.h, no stubs - just the real code.

Definition in file test_main.cpp.

Macro Definition Documentation

◆ REMOTE_LOAD

#define REMOTE_LOAD ( n)
Value:
constexpr uint8_t REMOTE_PIN_BASE
Base value for virtual pins representing remote loads.

Definition at line 278 of file test_main.cpp.

Function Documentation

◆ main()

int main ( void )

Definition at line 551 of file test_main.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 14 of file test_main.cpp.

◆ tearDown()

void tearDown ( void )

Definition at line 15 of file test_main.cpp.

◆ test_are_pins_valid_all_valid()

void test_are_pins_valid_all_valid ( void )

Definition at line 50 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_are_pins_valid_rejects_pin_0()

void test_are_pins_valid_rejects_pin_0 ( void )

Definition at line 58 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_are_pins_valid_rejects_pin_1()

void test_are_pins_valid_rejects_pin_1 ( void )

Definition at line 64 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_are_pins_valid_rejects_pin_14_and_above()

void test_are_pins_valid_rejects_pin_14_and_above ( void )

Definition at line 70 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_indicesToBitmask_all_bits()

void test_indicesToBitmask_all_bits ( void )

Definition at line 40 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_indicesToBitmask_consecutive()

void test_indicesToBitmask_consecutive ( void )

Definition at line 34 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_indicesToBitmask_multiple_indices()

void test_indicesToBitmask_multiple_indices ( void )

Definition at line 28 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_indicesToBitmask_single_index()

void test_indicesToBitmask_single_index ( void )

Definition at line 21 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_KeyIndexPair_construction()

void test_KeyIndexPair_construction ( void )

Definition at line 147 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_KeyIndexPair_from_bitmask()

void test_KeyIndexPair_from_bitmask ( void )

Definition at line 170 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_KeyIndexPair_getLocalBitmask()

void test_KeyIndexPair_getLocalBitmask ( void )

Definition at line 155 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_KeyIndexPair_getRemoteBitmask_empty()

void test_KeyIndexPair_getRemoteBitmask_empty ( void )

Definition at line 347 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_KeyIndexPair_getRemoteBitmask_mixed()

void test_KeyIndexPair_getRemoteBitmask_mixed ( void )

Definition at line 362 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_KeyIndexPair_getRemoteBitmask_remote_only()

void test_KeyIndexPair_getRemoteBitmask_remote_only ( void )

Definition at line 354 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_KeyIndexPair_single_pin()

void test_KeyIndexPair_single_pin ( void )

Definition at line 163 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_findLocalBitmask_found()

void test_OverrideTable_findLocalBitmask_found ( void )

Definition at line 226 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_findLocalBitmask_not_found()

void test_OverrideTable_findLocalBitmask_not_found ( void )

Definition at line 239 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_findRemoteBitmask_found()

void test_OverrideTable_findRemoteBitmask_found ( void )

Definition at line 409 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_findRemoteBitmask_not_found()

void test_OverrideTable_findRemoteBitmask_not_found ( void )

Definition at line 421 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_from_the_settings_matches_plain_pins()

void test_OverrideTable_from_the_settings_matches_plain_pins ( void )

Definition at line 535 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_OverrideTable_getLocalBitmask_out_of_bounds()

void test_OverrideTable_getLocalBitmask_out_of_bounds ( void )

Definition at line 216 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_getPin_out_of_bounds()

void test_OverrideTable_getPin_out_of_bounds ( void )

Definition at line 206 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_getRemoteBitmask_local_only()

void test_OverrideTable_getRemoteBitmask_local_only ( void )

Definition at line 374 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_getRemoteBitmask_mixed()

void test_OverrideTable_getRemoteBitmask_mixed ( void )

Definition at line 391 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_getRemoteBitmask_out_of_bounds()

void test_OverrideTable_getRemoteBitmask_out_of_bounds ( void )

Definition at line 400 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_getRemoteBitmask_remote_only()

void test_OverrideTable_getRemoteBitmask_remote_only ( void )

Definition at line 382 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_many_entries()

void test_OverrideTable_many_entries ( void )

Definition at line 260 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_multiple_entries()

void test_OverrideTable_multiple_entries ( void )

Definition at line 192 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_multiple_entries_mixed()

void test_OverrideTable_multiple_entries_mixed ( void )

Definition at line 430 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_single_entry()

void test_OverrideTable_single_entry ( void )

Definition at line 181 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_OverrideTable_with_bitmask_constructor()

void test_OverrideTable_with_bitmask_constructor ( void )

Definition at line 249 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_default_constructor()

void test_PinList_default_constructor ( void )

Definition at line 81 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_from_bitmask()

void test_PinList_from_bitmask ( void )

Definition at line 119 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_from_bitmask_empty()

void test_PinList_from_bitmask_empty ( void )

Definition at line 129 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_from_bitmask_full()

void test_PinList_from_bitmask_full ( void )

Definition at line 136 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_from_uint32_bitmask_local_only()

void test_PinList_from_uint32_bitmask_local_only ( void )

Definition at line 313 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_from_uint32_bitmask_mixed()

void test_PinList_from_uint32_bitmask_mixed ( void )

Definition at line 333 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_from_uint32_bitmask_remote_only()

void test_PinList_from_uint32_bitmask_remote_only ( void )

Definition at line 323 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_max_pins()

void test_PinList_max_pins ( void )

Definition at line 105 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_single_pin()

void test_PinList_single_pin ( void )

Definition at line 97 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_toLocalBitmask()

void test_PinList_toLocalBitmask ( void )

Definition at line 112 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_toRemoteBitmask_empty()

void test_PinList_toRemoteBitmask_empty ( void )

Definition at line 280 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_toRemoteBitmask_local_only()

void test_PinList_toRemoteBitmask_local_only ( void )

Definition at line 286 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_toRemoteBitmask_mixed()

void test_PinList_toRemoteBitmask_mixed ( void )

Definition at line 305 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_toRemoteBitmask_multiple_remote()

void test_PinList_toRemoteBitmask_multiple_remote ( void )

Definition at line 299 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_toRemoteBitmask_single_remote()

void test_PinList_toRemoteBitmask_single_remote ( void )

Definition at line 293 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_PinList_variadic_constructor()

void test_PinList_variadic_constructor ( void )

Definition at line 88 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_TargetMap_a_group_and_single_targets_in_one_list()

void test_TargetMap_a_group_and_single_targets_in_one_list ( void )

Definition at line 528 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_TargetMap_groups()

void test_TargetMap_groups ( void )

Definition at line 509 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_TargetMap_LOAD_gives_the_pin_or_the_remote_rank()

void test_TargetMap_LOAD_gives_the_pin_or_the_remote_rank ( void )

Definition at line 478 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_TargetMap_out_of_range_gives_pin_0()

void test_TargetMap_out_of_range_gives_pin_0 ( void )

Definition at line 487 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_TargetMap_plain_pins_pass_through()

void test_TargetMap_plain_pins_pass_through ( void )

Definition at line 503 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_TargetMap_RELAY_needs_relay_diversion()

void test_TargetMap_RELAY_needs_relay_diversion ( void )

Definition at line 496 of file test_main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: