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

Embedded tests for teleinfo.h: the IoT frame on the ATmega328P (16-bit int) More...

#include <Arduino.h>
#include <unity.h>
#include "../halt_after_tests.h"
#include "serial_output.h"
#include "teleinfo.h"
Include dependency graph for test_main.cpp:

Go to the source code of this file.

Classes

class  FramePrint
 
struct  TestSource< PHASES >
 A data source of writeFrameStep(): 2 loads, 1 relay, 2 temperature sensors (the 2nd invalid). More...
 

Functions

static void appendLine (char *expected, const char *tagAndValue)
 
static const char * expectedLine (const char *tagAndValue)
 
void loop ()
 
void setUp (void)
 
void setup ()
 
template<typename Source>
static void streamFrame (FramePrint &out)
 
void tearDown (void)
 
void test_frame_single_phase (void)
 
void test_frame_three_phases (void)
 
void test_lineSize_calculation (void)
 
void test_teleinfo_line_contents (void)
 

Detailed Description

Embedded tests for teleinfo.h: the IoT frame on the ATmega328P (16-bit int)

The code of the firmware, run on the target: the lines (digits of 16-bit values, checksum) and whole frames written step by step, with and without the per-phase lines. The expected text is built independently, its checksums summed by appendLine(). The native tests (test/native/test_teleinfo) check the frame byte for byte against the buffered frame of the former firmware.

Definition in file test_main.cpp.

Function Documentation

◆ appendLine()

static void appendLine ( char * expected,
const char * tagAndValue )
static

Definition at line 32 of file test_main.cpp.

Here is the caller graph for this function:

◆ expectedLine()

static const char * expectedLine ( const char * tagAndValue)
static

Definition at line 48 of file test_main.cpp.

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

◆ loop()

void loop ( )

Definition at line 249 of file test_main.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 21 of file test_main.cpp.

◆ setup()

void setup ( )

Definition at line 239 of file test_main.cpp.

◆ streamFrame()

template<typename Source>
static void streamFrame ( FramePrint & out)
static

Definition at line 173 of file test_main.cpp.

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

◆ tearDown()

void tearDown ( void )

Definition at line 26 of file test_main.cpp.

◆ test_frame_single_phase()

void test_frame_single_phase ( void )

Definition at line 217 of file test_main.cpp.

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

◆ test_frame_three_phases()

void test_frame_three_phases ( void )

Definition at line 188 of file test_main.cpp.

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

◆ test_lineSize_calculation()

void test_lineSize_calculation ( 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_teleinfo_line_contents()

void test_teleinfo_line_contents ( void )

Definition at line 69 of file test_main.cpp.

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