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

The checks of a DS18B20 reading (ds18b20.h): CRC, conversion, range, power-on value. More...

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

Go to the source code of this file.

Functions

int main (int, char **)
 
void setUp ()
 
void tearDown ()
 
void test_85_after_a_big_jump_is_skipped ()
 
void test_85_after_a_small_jump_is_kept ()
 
void test_85_after_an_invalid_reading_far_from_the_last_valid_one_is_skipped ()
 
void test_85_after_an_invalid_reading_is_skipped ()
 
void test_a_first_reading_of_85_is_skipped ()
 
void test_a_skipped_or_out_of_range_value_is_no_reference ()
 
void test_a_skipped_power_on_value_is_not_sent ()
 
void test_a_steady_85_after_an_invalid_reading_is_kept ()
 
void test_all_ones_is_a_disconnected_probe ()
 
void test_all_zeros_passes_the_crc ()
 
void test_bad_crc_is_a_disconnected_probe ()
 
void test_beyond_the_range ()
 
void test_crc_catches_any_single_bit_error ()
 
void test_crc_of_a_known_rom_code ()
 
void test_crc_of_known_scratchpads ()
 
void test_crc_of_nothing_is_zero ()
 
void test_crc_of_the_power_on_scratchpad ()
 
void test_every_register_value_of_the_range ()
 
void test_fractions_of_a_degree ()
 
void test_good_crc_gives_the_temperature ()
 
void test_invalid_readings_are_not_sent ()
 
void test_just_inside_the_range ()
 
void test_negative ()
 
void test_other_readings_are_kept_whatever_the_jump ()
 
void test_positive ()
 
void test_power_on_scratchpad_reads_85 ()
 
void test_the_bounds_of_the_sensor_are_in_range ()
 
void test_the_invalid_values_cannot_be_temperatures ()
 
void test_valid_readings_are_sent ()
 
void test_zero ()
 

Detailed Description

The checks of a DS18B20 reading (ds18b20.h): CRC, conversion, range, power-on value.

The scratchpads are those of a DS18B20: temperature LSB and MSB, TH = 0x4B, TL = 0x46, configuration 0x7F (12 bits), 0xFF, 0x0C, 0x10, then the CRC. The CRC of a few of them is checked against known values first, so the other tests can build theirs with crc8().

Definition in file test_main.cpp.

Function Documentation

◆ main()

int main ( int ,
char **  )

Definition at line 317 of file test_main.cpp.

Here is the call graph for this function:

◆ setUp()

void setUp ( void )

Definition at line 44 of file test_main.cpp.

◆ tearDown()

void tearDown ( void )

Definition at line 45 of file test_main.cpp.

◆ test_85_after_a_big_jump_is_skipped()

void test_85_after_a_big_jump_is_skipped ( )

Definition at line 209 of file test_main.cpp.

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

◆ test_85_after_a_small_jump_is_kept()

void test_85_after_a_small_jump_is_kept ( )

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_85_after_an_invalid_reading_far_from_the_last_valid_one_is_skipped()

void test_85_after_an_invalid_reading_far_from_the_last_valid_one_is_skipped ( )

Definition at line 258 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_85_after_an_invalid_reading_is_skipped()

void test_85_after_an_invalid_reading_is_skipped ( )

Definition at line 225 of file test_main.cpp.

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

◆ test_a_first_reading_of_85_is_skipped()

void test_a_first_reading_of_85_is_skipped ( )

Definition at line 242 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_a_skipped_or_out_of_range_value_is_no_reference()

void test_a_skipped_or_out_of_range_value_is_no_reference ( )

Definition at line 268 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_a_skipped_power_on_value_is_not_sent()

void test_a_skipped_power_on_value_is_not_sent ( )

Definition at line 306 of file test_main.cpp.

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

◆ test_a_steady_85_after_an_invalid_reading_is_kept()

void test_a_steady_85_after_an_invalid_reading_is_kept ( )

Definition at line 248 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_all_ones_is_a_disconnected_probe()

void test_all_ones_is_a_disconnected_probe ( )

Definition at line 184 of file test_main.cpp.

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

◆ test_all_zeros_passes_the_crc()

void test_all_zeros_passes_the_crc ( )

Definition at line 192 of file test_main.cpp.

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

◆ test_bad_crc_is_a_disconnected_probe()

void test_bad_crc_is_a_disconnected_probe ( )

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_beyond_the_range()

void test_beyond_the_range ( )

Definition at line 174 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_crc_catches_any_single_bit_error()

void test_crc_catches_any_single_bit_error ( )

Definition at line 77 of file test_main.cpp.

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

◆ test_crc_of_a_known_rom_code()

void test_crc_of_a_known_rom_code ( )

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_crc_of_known_scratchpads()

void test_crc_of_known_scratchpads ( )

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_crc_of_nothing_is_zero()

void test_crc_of_nothing_is_zero ( )

Definition at line 71 of file test_main.cpp.

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

◆ test_crc_of_the_power_on_scratchpad()

void test_crc_of_the_power_on_scratchpad ( )

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_every_register_value_of_the_range()

void test_every_register_value_of_the_range ( )

Definition at line 140 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_fractions_of_a_degree()

void test_fractions_of_a_degree ( )

Definition at line 126 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_good_crc_gives_the_temperature()

void test_good_crc_gives_the_temperature ( )

Definition at line 91 of file test_main.cpp.

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

◆ test_invalid_readings_are_not_sent()

void test_invalid_readings_are_not_sent ( )

Definition at line 282 of file test_main.cpp.

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

◆ test_just_inside_the_range()

void test_just_inside_the_range ( )

Definition at line 157 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_negative()

void test_negative ( )

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_other_readings_are_kept_whatever_the_jump()

void test_other_readings_are_kept_whatever_the_jump ( )

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_positive()

void test_positive ( )

Definition at line 111 of file test_main.cpp.

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

◆ test_power_on_scratchpad_reads_85()

void test_power_on_scratchpad_reads_85 ( )

Definition at line 202 of file test_main.cpp.

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

◆ test_the_bounds_of_the_sensor_are_in_range()

void test_the_bounds_of_the_sensor_are_in_range ( )

Definition at line 163 of file test_main.cpp.

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

◆ test_the_invalid_values_cannot_be_temperatures()

void test_the_invalid_values_cannot_be_temperatures ( )

Definition at line 299 of file test_main.cpp.

Here is the caller graph for this function:

◆ test_valid_readings_are_sent()

void test_valid_readings_are_sent ( )

Definition at line 290 of file test_main.cpp.

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

◆ test_zero()

void test_zero ( )

Definition at line 105 of file test_main.cpp.

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