|
3-phase PV router
|
Native unit tests for load_priorities.h: the load priority state machine. More...

Go to the source code of this file.
Native unit tests for load_priorities.h: the load priority state machine.
The priority array holds one logical load per element, the highest priority first: the physical load number in the low 7 bits, the ON state in the high bit. Once per mains cycle, Switching::onNewCycle() may switch one load, depending on the energy bucket; toPhysical() then gives the physical states. No config.h, no stubs: the real code, on a bucket of 1000 units.
Definition in file test_main.cpp.
| int main | ( | void | ) |
| void setUp | ( | void | ) |
Definition at line 63 of file test_main.cpp.
| void tearDown | ( | void | ) |
Definition at line 64 of file test_main.cpp.
| void test_a_surplus_brings_every_load_on_then_its_end_every_load_off | ( | void | ) |
Definition at line 314 of file test_main.cpp.


| void test_an_override_forces_its_load_on | ( | void | ) |
Definition at line 421 of file test_main.cpp.


| void test_anti_flicker_thresholds_leave_a_dead_band | ( | void | ) |
Definition at line 284 of file test_main.cpp.


| void test_calibration_mode_keeps_every_load_off | ( | void | ) |
Definition at line 457 of file test_main.cpp.


| void test_diversion_off_switches_every_load_off | ( | void | ) |
Definition at line 409 of file test_main.cpp.


| void test_each_half_resets_the_opposite_threshold | ( | void | ) |
Definition at line 266 of file test_main.cpp.


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


| void test_low_energy_switches_the_last_load_off | ( | void | ) |
Definition at line 195 of file test_main.cpp.


| void test_next_ignores_the_load_numbers | ( | void | ) |
Definition at line 106 of file test_main.cpp.


| void test_next_to_add_is_the_first_load_off | ( | void | ) |
Definition at line 70 of file test_main.cpp.


| void test_next_to_add_none_when_all_on | ( | void | ) |
Definition at line 81 of file test_main.cpp.


| void test_next_to_remove_is_the_last_load_on | ( | void | ) |
Definition at line 88 of file test_main.cpp.


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


| void test_nothing_to_switch_starts_no_post_transition_period | ( | void | ) |
| void test_physical_states_follow_the_load_numbers | ( | void | ) |
Definition at line 397 of file test_main.cpp.


| void test_rotate_a_single_load_changes_nothing | ( | void | ) |
Definition at line 375 of file test_main.cpp.


| void test_rotate_keeps_each_load_state | ( | void | ) |
Definition at line 349 of file test_main.cpp.


| void test_rotate_moves_the_last_load_first | ( | void | ) |
Definition at line 338 of file test_main.cpp.


| void test_rotate_n_times_is_back_to_the_start | ( | void | ) |
Definition at line 360 of file test_main.cpp.


| void test_switching_on_follows_the_priorities_not_the_load_numbers | ( | void | ) |
Definition at line 133 of file test_main.cpp.


| void test_the_load_switched_last_may_switch_back_at_once | ( | void | ) |
Definition at line 241 of file test_main.cpp.


| void test_the_lower_threshold_stays_within_the_bucket | ( | void | ) |
Definition at line 228 of file test_main.cpp.


| void test_the_middle_of_the_bucket_counts_as_the_lower_half | ( | void | ) |
Definition at line 255 of file test_main.cpp.


| void test_the_next_load_waits_for_the_end_of_the_post_transition_period | ( | void | ) |
Definition at line 145 of file test_main.cpp.


| void test_the_override_is_asked_for_the_physical_load | ( | void | ) |
Definition at line 440 of file test_main.cpp.


| void test_the_previous_load_waits_for_the_end_of_the_post_transition_period | ( | void | ) |
Definition at line 208 of file test_main.cpp.


| void test_the_upper_threshold_follows_the_bucket_during_the_post_transition_period | ( | void | ) |
Definition at line 166 of file test_main.cpp.


| void test_the_upper_threshold_stays_within_the_bucket | ( | void | ) |
Definition at line 182 of file test_main.cpp.

