|
3-phase PV router
|
Native unit tests for load_map.h and remote_loads_core.h. More...

Go to the source code of this file.
Classes | |
| struct | RecordingRadio |
| Stands in for RFM69::send(): records who would have been sent what. More... | |
Variables | |
| static constexpr uint8_t | sendIds [] { 15, 16, 17 } |
| static constexpr uint8_t | sendMap [] { Load::local(5), Load::remote(1), Load::remote(2), Load::remote(1) } |
Native unit tests for load_map.h and remote_loads_core.h.
Tests the packed load-map encoding, the per-unit bitmask builder, the override pins derived from the map, the config checks and the send loop. No config.h, no Arduino, no stubs - just the real headers.
Definition in file test_main.cpp.
|
static |
Run one mains cycle: feed the states to the core, for the given map.
Definition at line 26 of file test_main.cpp.

|
static |
Claim a unit's payload if a transmission is due, else return -1.
Definition at line 33 of file test_main.cpp.


| int main | ( | int | , |
| char ** | ) |
|
static |
Build a LoadStates array from a bit pattern, bit i = load i.
Definition at line 41 of file test_main.cpp.

| void setUp | ( | void | ) |
Definition at line 17 of file test_main.cpp.
| void tearDown | ( | void | ) |
Definition at line 18 of file test_main.cpp.
| void test_a_change_on_one_unit_does_not_flag_the_other | ( | void | ) |
Definition at line 342 of file test_main.cpp.


| void test_a_change_restarts_the_refresh_counter | ( | void | ) |
Definition at line 402 of file test_main.cpp.


| void test_a_unit_beyond_the_core_is_ignored | ( | void | ) |
Definition at line 476 of file test_main.cpp.


| void test_all_off_still_refreshes | ( | void | ) |
Definition at line 431 of file test_main.cpp.


| void test_bitOf_counts_within_the_same_unit | ( | void | ) |
Definition at line 154 of file test_main.cpp.


| void test_census_is_constexpr | ( | void | ) |
Definition at line 86 of file test_main.cpp.


| void test_census_of_an_all_local_map | ( | void | ) |
Definition at line 99 of file test_main.cpp.


| void test_change_flags_a_transmission | ( | void | ) |
Definition at line 287 of file test_main.cpp.


| void test_draining_clears_the_flag | ( | void | ) |
Definition at line 299 of file test_main.cpp.


| void test_eight_loads_on_one_unit | ( | void | ) |
Definition at line 254 of file test_main.cpp.


| void test_first_load_of_a_unit_is_bit_zero | ( | void | ) |
Definition at line 239 of file test_main.cpp.


| void test_index_alignment_with_a_leading_local_load | ( | void | ) |
Definition at line 270 of file test_main.cpp.


| void test_interleaved_map | ( | void | ) |
Definition at line 220 of file test_main.cpp.


| void test_isValidMap_accepts_a_mixed_map | ( | void | ) |
Definition at line 562 of file test_main.cpp.


| void test_isValidMap_checks_a_remote_status_led | ( | void | ) |
Definition at line 590 of file test_main.cpp.


| void test_isValidMap_rejects_the_unused_pin_sentinel | ( | void | ) |
Definition at line 581 of file test_main.cpp.


| void test_isValidMap_rejects_unusable_local_pins | ( | void | ) |
Definition at line 570 of file test_main.cpp.


| void test_load_masks_of_a_mixed_map | ( | void | ) |
Definition at line 523 of file test_main.cpp.


| void test_load_masks_of_an_all_local_map | ( | void | ) |
Definition at line 531 of file test_main.cpp.


| void test_local_keeps_unit_zero | ( | void | ) |
Definition at line 53 of file test_main.cpp.


| void test_local_loads_are_ignored | ( | void | ) |
Definition at line 181 of file test_main.cpp.


| void test_masks_feed_the_override_config | ( | void | ) |
Definition at line 539 of file test_main.cpp.


| void test_no_unit_configured_is_a_no_op | ( | void | ) |
Definition at line 446 of file test_main.cpp.


| void test_node_ids_accepts_distinct_ids | ( | void | ) |
Definition at line 625 of file test_main.cpp.


| void test_node_ids_rejects_a_duplicate | ( | void | ) |
Definition at line 634 of file test_main.cpp.


| void test_node_ids_rejects_a_short_table | ( | void | ) |
Definition at line 660 of file test_main.cpp.


| void test_node_ids_rejects_out_of_range | ( | void | ) |
Definition at line 649 of file test_main.cpp.


| void test_node_ids_rejects_the_router_id | ( | void | ) |
Definition at line 642 of file test_main.cpp.


| void test_out_of_range_accessors_are_safe | ( | void | ) |
Definition at line 489 of file test_main.cpp.


| void test_overrideMasks_give_no_bit_to_an_out_of_range_entry | ( | void | ) |
Definition at line 142 of file test_main.cpp.


| void test_overrideMasks_match_the_shift_they_replace | ( | void | ) |
Definition at line 119 of file test_main.cpp.


| void test_overridePinOf_local_is_the_physical_pin | ( | void | ) |
Definition at line 502 of file test_main.cpp.


| void test_overridePinOf_remote_is_a_virtual_pin | ( | void | ) |
Definition at line 512 of file test_main.cpp.


| void test_payload_tracks_the_latest_state_even_if_unsent | ( | void | ) |
Definition at line 325 of file test_main.cpp.


| void test_refresh_counter_restarts_after_a_refresh | ( | void | ) |
Definition at line 384 of file test_main.cpp.


| void test_refresh_fires_on_the_fifth_unchanged_cycle | ( | void | ) |
Definition at line 364 of file test_main.cpp.


| void test_remote_encodes_the_unit_number | ( | void | ) |
Definition at line 61 of file test_main.cpp.


| void test_remote_led_pin_round_trips | ( | void | ) |
Definition at line 79 of file test_main.cpp.


| void test_remote_unit_out_of_range_is_flagged | ( | void | ) |
Definition at line 601 of file test_main.cpp.


| void test_remote_without_led_has_pin_zero | ( | void | ) |
Definition at line 73 of file test_main.cpp.


| void test_remoteOrdinal_counts_remote_entries_only | ( | void | ) |
Definition at line 110 of file test_main.cpp.


| void test_reset_clears_every_unit | ( | void | ) |
Definition at line 459 of file test_main.cpp.


| void test_sendPending_addresses_each_unit_by_its_node_id | ( | void | ) |
Definition at line 692 of file test_main.cpp.


| void test_sendPending_drains_what_it_sends | ( | void | ) |
Definition at line 709 of file test_main.cpp.


| void test_sendPending_only_addresses_the_unit_that_changed | ( | void | ) |
Definition at line 723 of file test_main.cpp.


| void test_sendPending_refreshes_every_unit | ( | void | ) |
Definition at line 742 of file test_main.cpp.


| void test_sendPending_without_units_never_sends | ( | void | ) |
Definition at line 763 of file test_main.cpp.


| void test_single_unit_payload | ( | void | ) |
Definition at line 169 of file test_main.cpp.


| void test_three_units_one_load_each | ( | void | ) |
Definition at line 206 of file test_main.cpp.


| void test_two_units_are_independent | ( | void | ) |
Definition at line 192 of file test_main.cpp.


| void test_unchanged_state_does_not_flag | ( | void | ) |
Definition at line 312 of file test_main.cpp.


|
staticconstexpr |
Definition at line 690 of file test_main.cpp.
|
staticconstexpr |
Definition at line 689 of file test_main.cpp.