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

Native unit tests for utils_dualtariff.h: the scheduled boosts of the dual tariff. More...

#include <unity.h>
#include "utils_dualtariff.h"
#include "utils_override.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_boost_of_zero_minutes_has_no_length (void)
 
void test_a_start_before_the_period_wraps_to_a_large_value (void)
 
void test_a_target_may_be_in_several_boosts (void)
 
void test_an_empty_list (void)
 
void test_before_end_for (void)
 
void test_before_end_from_3_to_12_hours (void)
 
void test_boost_window_across_the_millis_wraparound (void)
 
void test_boost_window_includes_its_start_and_excludes_its_end (void)
 
void test_boost_windows_are_computed_at_compile_time (void)
 
void test_boosts_from_the_settings (void)
 
void test_ends_within_off_peak (void)
 
void test_first_starts_at_the_start_and_lasts_its_duration (void)
 
void test_for_the_largest_minutes_is_not_until_the_end (void)
 
void test_from_start_for (void)
 
void test_hours_and_minutes (void)
 
void test_last_starts_back_from_the_end_and_has_no_end (void)
 
void test_no_boost_in_the_settings (void)
 
void test_resolve (void)
 
void test_starts_within_off_peak (void)
 
void test_targets_become_masks (void)
 
void test_twelve_hours (void)
 
void test_until_the_end_has_no_end (void)
 
void test_without_for_lasts_until_the_end (void)
 

Detailed Description

Native unit tests for utils_dualtariff.h: the scheduled boosts of the dual tariff.

Each boost has a window (FIRST, LAST, FROM_START/BEFORE_END with or without FOR, in HOURS() or MINUTES()) and its targets. The firmware resolves each window at compile time, in ms from the start of the off-peak period, and forces the targets while millis() - start is in it. No config.h, no stubs: the real code.

Definition in file test_main.cpp.

Function Documentation

◆ main()

int main ( void )

Definition at line 250 of file test_main.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 23 of file test_main.cpp.

◆ tearDown()

void tearDown ( void )

Definition at line 24 of file test_main.cpp.

◆ test_a_boost_of_zero_minutes_has_no_length()

void test_a_boost_of_zero_minutes_has_no_length ( void )

Definition at line 126 of file test_main.cpp.

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

◆ test_a_start_before_the_period_wraps_to_a_large_value()

void test_a_start_before_the_period_wraps_to_a_large_value ( void )

Definition at line 242 of file test_main.cpp.

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

◆ test_a_target_may_be_in_several_boosts()

void test_a_target_may_be_in_several_boosts ( void )

Definition at line 199 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_an_empty_list()

void test_an_empty_list ( void )

Definition at line 204 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_before_end_for()

void test_before_end_for ( void )

Definition at line 56 of file test_main.cpp.

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

◆ test_before_end_from_3_to_12_hours()

void test_before_end_from_3_to_12_hours ( void )

Definition at line 79 of file test_main.cpp.

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

◆ test_boost_window_across_the_millis_wraparound()

void test_boost_window_across_the_millis_wraparound ( void )

Definition at line 152 of file test_main.cpp.

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

◆ test_boost_window_includes_its_start_and_excludes_its_end()

void test_boost_window_includes_its_start_and_excludes_its_end ( void )

Definition at line 139 of file test_main.cpp.

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

◆ test_boost_windows_are_computed_at_compile_time()

void test_boost_windows_are_computed_at_compile_time ( 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_boosts_from_the_settings()

void test_boosts_from_the_settings ( void )

Definition at line 211 of file test_main.cpp.

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

◆ test_ends_within_off_peak()

void test_ends_within_off_peak ( void )

Definition at line 113 of file test_main.cpp.

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

◆ test_first_starts_at_the_start_and_lasts_its_duration()

void test_first_starts_at_the_start_and_lasts_its_duration ( void )

Definition at line 37 of file test_main.cpp.

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

◆ test_for_the_largest_minutes_is_not_until_the_end()

void test_for_the_largest_minutes_is_not_until_the_end ( void )

Definition at line 96 of file test_main.cpp.

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

◆ test_from_start_for()

void test_from_start_for ( void )

Definition at line 49 of file test_main.cpp.

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

◆ test_hours_and_minutes()

void test_hours_and_minutes ( void )

Definition at line 30 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_last_starts_back_from_the_end_and_has_no_end()

void test_last_starts_back_from_the_end_and_has_no_end ( void )

Definition at line 43 of file test_main.cpp.

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

◆ test_no_boost_in_the_settings()

void test_no_boost_in_the_settings ( void )

Definition at line 231 of file test_main.cpp.

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

◆ test_resolve()

void test_resolve ( void )

Definition at line 192 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_starts_within_off_peak()

void test_starts_within_off_peak ( void )

Definition at line 103 of file test_main.cpp.

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

◆ test_targets_become_masks()

void test_targets_become_masks ( void )

Definition at line 178 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_twelve_hours()

void test_twelve_hours ( 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_until_the_end_has_no_end()

void test_until_the_end_has_no_end ( void )

Definition at line 63 of file test_main.cpp.

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

◆ test_without_for_lasts_until_the_end()

void test_without_for_lasts_until_the_end ( void )

Definition at line 186 of file test_main.cpp.

Here is the caller graph for this function: