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

Native unit tests for pin_edges.h. More...

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
void setUp (void)
 
void tearDown (void)
 
void test_a_press_while_forced_is_dropped_not_carried_over (void)
 
void test_changed_is_either_edge_active_is_the_level (void)
 
void test_each_pin_keeps_its_own_level (void)
 
void test_low_at_startup_is_a_press (void)
 
void test_no_rotation_while_forced (void)
 
void test_pinEdges_from_the_two_levels (void)
 
void test_press_once_then_held_is_no_edge (void)
 
void test_press_release_press (void)
 
void test_release_once_then_no_edge (void)
 
void test_rotation_on_a_press_when_nothing_is_forced (void)
 
void test_startup_is_released (void)
 

Variables

constexpr bool HIGH_ { false }
 
constexpr bool LOW_ { true }
 

Detailed Description

Native unit tests for pin_edges.h.

The edges of the active-LOW input pins: pinEdges(), trackPinEdges<pin>() and isRotationRequested(). Each pin keeps its previous level in a static of its own trackPinEdges<pin>(), for the whole run: each test uses pins of its own, so that it starts from the startup state (released).

Definition in file test_main.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 186 of file test_main.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 16 of file test_main.cpp.

◆ tearDown()

void tearDown ( void )

Definition at line 17 of file test_main.cpp.

◆ test_a_press_while_forced_is_dropped_not_carried_over()

void test_a_press_while_forced_is_dropped_not_carried_over ( void )

Definition at line 169 of file test_main.cpp.

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

◆ test_changed_is_either_edge_active_is_the_level()

void test_changed_is_either_edge_active_is_the_level ( void )

Definition at line 54 of file test_main.cpp.

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

◆ test_each_pin_keeps_its_own_level()

void test_each_pin_keeps_its_own_level ( void )

Definition at line 118 of file test_main.cpp.

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

◆ test_low_at_startup_is_a_press()

void test_low_at_startup_is_a_press ( void )

Definition at line 76 of file test_main.cpp.

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

◆ test_no_rotation_while_forced()

void test_no_rotation_while_forced ( void )

Definition at line 164 of file test_main.cpp.

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

◆ test_pinEdges_from_the_two_levels()

void test_pinEdges_from_the_two_levels ( void )

Definition at line 26 of file test_main.cpp.

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

◆ test_press_once_then_held_is_no_edge()

void test_press_once_then_held_is_no_edge ( void )

Definition at line 84 of file test_main.cpp.

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

◆ test_press_release_press()

void test_press_release_press ( void )

Definition at line 136 of file test_main.cpp.

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

◆ test_release_once_then_no_edge()

void test_release_once_then_no_edge ( void )

Definition at line 102 of file test_main.cpp.

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

◆ test_rotation_on_a_press_when_nothing_is_forced()

void test_rotation_on_a_press_when_nothing_is_forced ( void )

Definition at line 156 of file test_main.cpp.

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

◆ test_startup_is_released()

void test_startup_is_released ( void )

Definition at line 66 of file test_main.cpp.

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

Variable Documentation

◆ HIGH_

bool HIGH_ { false }
inlineconstexpr

released: the pin is HIGH

Definition at line 20 of file test_main.cpp.

◆ LOW_

bool LOW_ { true }
inlineconstexpr

active: the pin is LOW

Definition at line 19 of file test_main.cpp.