3-phase PV router
Loading...
Searching...
No Matches
test_main.cpp File Reference
#include <Arduino.h>
#include <unity.h>
#include "utils_pins.h"
#include "utils_relay.h"
Include dependency graph for test_main.cpp:

Go to the source code of this file.

Functions

void feed_import_to_ordering_relays (void)
 
void feed_surplus_to_ordering_relays (void)
 
void loop ()
 
void setUp (void)
 
void setup ()
 
void tearDown (void)
 
void test_duration_overflow (void)
 
void test_duration_overflow_saturates_at_uint16_max (void)
 
void test_duration_overflow_stays_at_max_after_more_increments (void)
 
void test_duration_overflow_wrap_would_block_relay (void)
 
void test_get_importThreshold (void)
 
void test_get_minOFF (void)
 
void test_get_minON (void)
 
void test_get_pin (void)
 
void test_get_size (void)
 
void test_get_surplusThreshold (void)
 
void test_isRelayON (void)
 
void test_proceed_relay (void)
 
void test_proceed_settle_change (void)
 
void test_relay_initialization (void)
 
void test_relay_initialization_with_negative_thresholds (void)
 
void test_relay_initialization_with_positive_thresholds (void)
 
void test_relay_ordering (void)
 
void test_relay_ordering_import_turns_off_descending (void)
 
void test_relay_ordering_surplus_turns_on_ascending (void)
 
void test_relay_override_minimum_ON_time (void)
 
void test_relay_override_turnON (void)
 
void test_relay_turnOFF (void)
 
void test_relay_turnON (void)
 
void test_settle_change_allows_changes_after_60_seconds (void)
 
void test_settle_change_blocks_initial_relay_changes (void)
 
void test_settle_change_blocks_turn_off_as_well (void)
 
void test_settle_change_resets_after_relay_change (void)
 
void wait_for_relay_change_allowed (void)
 

Variables

constexpr RelayEngine< 3, 3 > orderingTestRelays
 
constexpr RelayEngine< 1, 2 > overflowTestRelays
 
constexpr RelayEngine relays
 
constexpr RelayEngine< 2, 1 > settleTestRelays
 

Function Documentation

◆ feed_import_to_ordering_relays()

void feed_import_to_ordering_relays ( void )

Definition at line 407 of file test_main.cpp.

Here is the caller graph for this function:

◆ feed_surplus_to_ordering_relays()

void feed_surplus_to_ordering_relays ( void )

Definition at line 398 of file test_main.cpp.

Here is the caller graph for this function:

◆ loop()

void loop ( )

Definition at line 665 of file test_main.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 11 of file test_main.cpp.

◆ setup()

void setup ( )

Definition at line 658 of file test_main.cpp.

◆ tearDown()

void tearDown ( void )

Definition at line 16 of file test_main.cpp.

◆ test_duration_overflow()

void test_duration_overflow ( void )

Definition at line 649 of file test_main.cpp.

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

◆ test_duration_overflow_saturates_at_uint16_max()

void test_duration_overflow_saturates_at_uint16_max ( void )

Definition at line 539 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_duration_overflow_stays_at_max_after_more_increments()

void test_duration_overflow_stays_at_max_after_more_increments ( void )

Definition at line 567 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_duration_overflow_wrap_would_block_relay()

void test_duration_overflow_wrap_would_block_relay ( void )

Definition at line 594 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_get_importThreshold()

void test_get_importThreshold ( void )

Definition at line 57 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_get_minOFF()

void test_get_minOFF ( void )

Definition at line 69 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_get_minON()

void test_get_minON ( void )

Definition at line 63 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_get_pin()

void test_get_pin ( void )

Definition at line 45 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_get_size()

void test_get_size ( void )

Definition at line 226 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_get_surplusThreshold()

void test_get_surplusThreshold ( void )

Definition at line 51 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_isRelayON()

void test_isRelayON ( void )

Definition at line 75 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_proceed_relay()

void test_proceed_relay ( void )

Definition at line 215 of file test_main.cpp.

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

◆ test_proceed_settle_change()

void test_proceed_settle_change ( 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_relay_initialization()

void test_relay_initialization ( 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_relay_initialization_with_negative_thresholds()

void test_relay_initialization_with_negative_thresholds ( 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_relay_initialization_with_positive_thresholds()

void test_relay_initialization_with_positive_thresholds ( void )

Definition at line 29 of file test_main.cpp.

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

◆ test_relay_ordering()

void test_relay_ordering ( void )

Definition at line 523 of file test_main.cpp.

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

◆ test_relay_ordering_import_turns_off_descending()

void test_relay_ordering_import_turns_off_descending ( void )

Definition at line 474 of file test_main.cpp.

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

◆ test_relay_ordering_surplus_turns_on_ascending()

void test_relay_ordering_surplus_turns_on_ascending ( void )

Definition at line 425 of file test_main.cpp.

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

◆ test_relay_override_minimum_ON_time()

void test_relay_override_minimum_ON_time ( void )

Definition at line 179 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_relay_override_turnON()

void test_relay_override_turnON ( void )

Definition at line 138 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_relay_turnOFF()

void test_relay_turnOFF ( void )

Definition at line 109 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_relay_turnON()

void test_relay_turnON ( void )

Definition at line 80 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_settle_change_allows_changes_after_60_seconds()

void test_settle_change_allows_changes_after_60_seconds ( void )

Definition at line 268 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_settle_change_blocks_initial_relay_changes()

void test_settle_change_blocks_initial_relay_changes ( void )

Definition at line 243 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_settle_change_blocks_turn_off_as_well()

void test_settle_change_blocks_turn_off_as_well ( void )

Definition at line 335 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_settle_change_resets_after_relay_change()

void test_settle_change_resets_after_relay_change ( void )

Definition at line 294 of file test_main.cpp.

Here is the caller graph for this function:

◆ wait_for_relay_change_allowed()

void wait_for_relay_change_allowed ( void )

Definition at line 416 of file test_main.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ orderingTestRelays

RelayEngine< 3, 3 > orderingTestRelays
constexpr
Initial value:
{ { 11, 500, 100, 1, 1 },
{ 12, 500, 100, 1, 1 },
{ 13, 500, 100, 1, 1 } } }

Definition at line 393 of file test_main.cpp.

◆ overflowTestRelays

RelayEngine< 1, 2 > overflowTestRelays
constexpr
Initial value:
{ { 10, 500, 100, 1, 1 } } }

Definition at line 536 of file test_main.cpp.

◆ relays

RelayEngine relays
constexpr
Initial value:
{ { { 2, 1000, 200, 1, 1 },
{ 3, 100, 20, 2, 3 } } }

Definition at line 8 of file test_main.cpp.

◆ settleTestRelays

RelayEngine< 2, 1 > settleTestRelays
constexpr
Initial value:
{ { 8, 500, 100, 1, 1 },
{ 9, 800, 150, 1, 1 } } }

Definition at line 239 of file test_main.cpp.