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

Native unit tests for load_priorities.h: the load priority state machine. More...

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

Go to the source code of this file.

Functions

int main (void)
 
void setUp (void)
 
void tearDown (void)
 
void test_a_surplus_brings_every_load_on_then_its_end_every_load_off (void)
 
void test_an_override_forces_its_load_on (void)
 
void test_anti_flicker_thresholds_leave_a_dead_band (void)
 
void test_calibration_mode_keeps_every_load_off (void)
 
void test_diversion_off_switches_every_load_off (void)
 
void test_each_half_resets_the_opposite_threshold (void)
 
void test_high_energy_switches_the_first_load_on (void)
 
void test_low_energy_switches_the_last_load_off (void)
 
void test_next_ignores_the_load_numbers (void)
 
void test_next_to_add_is_the_first_load_off (void)
 
void test_next_to_add_none_when_all_on (void)
 
void test_next_to_remove_is_the_last_load_on (void)
 
void test_next_to_remove_none_when_all_off (void)
 
void test_nothing_to_switch_starts_no_post_transition_period (void)
 
void test_physical_states_follow_the_load_numbers (void)
 
void test_rotate_a_single_load_changes_nothing (void)
 
void test_rotate_keeps_each_load_state (void)
 
void test_rotate_moves_the_last_load_first (void)
 
void test_rotate_n_times_is_back_to_the_start (void)
 
void test_switching_on_follows_the_priorities_not_the_load_numbers (void)
 
void test_the_load_switched_last_may_switch_back_at_once (void)
 
void test_the_lower_threshold_stays_within_the_bucket (void)
 
void test_the_middle_of_the_bucket_counts_as_the_lower_half (void)
 
void test_the_next_load_waits_for_the_end_of_the_post_transition_period (void)
 
void test_the_override_is_asked_for_the_physical_load (void)
 
void test_the_previous_load_waits_for_the_end_of_the_post_transition_period (void)
 
void test_the_upper_threshold_follows_the_bucket_during_the_post_transition_period (void)
 
void test_the_upper_threshold_stays_within_the_bucket (void)
 

Detailed Description

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.

Function Documentation

◆ main()

int main ( void )

Definition at line 473 of file test_main.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 63 of file test_main.cpp.

◆ tearDown()

void tearDown ( void )

Definition at line 64 of file test_main.cpp.

◆ test_a_surplus_brings_every_load_on_then_its_end_every_load_off()

void test_a_surplus_brings_every_load_on_then_its_end_every_load_off ( void )

Definition at line 314 of file test_main.cpp.

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

◆ test_an_override_forces_its_load_on()

void test_an_override_forces_its_load_on ( void )

Definition at line 421 of file test_main.cpp.

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

◆ test_anti_flicker_thresholds_leave_a_dead_band()

void test_anti_flicker_thresholds_leave_a_dead_band ( void )

Definition at line 284 of file test_main.cpp.

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

◆ test_calibration_mode_keeps_every_load_off()

void test_calibration_mode_keeps_every_load_off ( void )

Definition at line 457 of file test_main.cpp.

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

◆ test_diversion_off_switches_every_load_off()

void test_diversion_off_switches_every_load_off ( void )

Definition at line 409 of file test_main.cpp.

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

◆ test_each_half_resets_the_opposite_threshold()

void test_each_half_resets_the_opposite_threshold ( void )

Definition at line 266 of file test_main.cpp.

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

◆ test_high_energy_switches_the_first_load_on()

void test_high_energy_switches_the_first_load_on ( void )

Definition at line 119 of file test_main.cpp.

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

◆ test_low_energy_switches_the_last_load_off()

void test_low_energy_switches_the_last_load_off ( void )

Definition at line 195 of file test_main.cpp.

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

◆ test_next_ignores_the_load_numbers()

void test_next_ignores_the_load_numbers ( void )

Definition at line 106 of file test_main.cpp.

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

◆ test_next_to_add_is_the_first_load_off()

void test_next_to_add_is_the_first_load_off ( 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_next_to_add_none_when_all_on()

void test_next_to_add_none_when_all_on ( void )

Definition at line 81 of file test_main.cpp.

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

◆ test_next_to_remove_is_the_last_load_on()

void test_next_to_remove_is_the_last_load_on ( void )

Definition at line 88 of file test_main.cpp.

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

◆ test_next_to_remove_none_when_all_off()

void test_next_to_remove_none_when_all_off ( void )

Definition at line 99 of file test_main.cpp.

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

◆ test_nothing_to_switch_starts_no_post_transition_period()

void test_nothing_to_switch_starts_no_post_transition_period ( void )

Definition at line 299 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_physical_states_follow_the_load_numbers()

void test_physical_states_follow_the_load_numbers ( void )

Definition at line 397 of file test_main.cpp.

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

◆ test_rotate_a_single_load_changes_nothing()

void test_rotate_a_single_load_changes_nothing ( void )

Definition at line 375 of file test_main.cpp.

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

◆ test_rotate_keeps_each_load_state()

void test_rotate_keeps_each_load_state ( void )

Definition at line 349 of file test_main.cpp.

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

◆ test_rotate_moves_the_last_load_first()

void test_rotate_moves_the_last_load_first ( void )

Definition at line 338 of file test_main.cpp.

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

◆ test_rotate_n_times_is_back_to_the_start()

void test_rotate_n_times_is_back_to_the_start ( void )

Definition at line 360 of file test_main.cpp.

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

◆ test_switching_on_follows_the_priorities_not_the_load_numbers()

void test_switching_on_follows_the_priorities_not_the_load_numbers ( void )

Definition at line 133 of file test_main.cpp.

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

◆ test_the_load_switched_last_may_switch_back_at_once()

void test_the_load_switched_last_may_switch_back_at_once ( void )

Definition at line 241 of file test_main.cpp.

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

◆ test_the_lower_threshold_stays_within_the_bucket()

void test_the_lower_threshold_stays_within_the_bucket ( void )

Definition at line 228 of file test_main.cpp.

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

◆ test_the_middle_of_the_bucket_counts_as_the_lower_half()

void test_the_middle_of_the_bucket_counts_as_the_lower_half ( void )

Definition at line 255 of file test_main.cpp.

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

◆ test_the_next_load_waits_for_the_end_of_the_post_transition_period()

void test_the_next_load_waits_for_the_end_of_the_post_transition_period ( void )

Definition at line 145 of file test_main.cpp.

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

◆ test_the_override_is_asked_for_the_physical_load()

void test_the_override_is_asked_for_the_physical_load ( void )

Definition at line 440 of file test_main.cpp.

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

◆ test_the_previous_load_waits_for_the_end_of_the_post_transition_period()

void test_the_previous_load_waits_for_the_end_of_the_post_transition_period ( void )

Definition at line 208 of file test_main.cpp.

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

◆ test_the_upper_threshold_follows_the_bucket_during_the_post_transition_period()

void test_the_upper_threshold_follows_the_bucket_during_the_post_transition_period ( void )

Definition at line 166 of file test_main.cpp.

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

◆ test_the_upper_threshold_stays_within_the_bucket()

void test_the_upper_threshold_stays_within_the_bucket ( void )

Definition at line 182 of file test_main.cpp.

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