atMETEO
An ATmega based weather station
Files | Functions
Unit tests

Unit tests for Sensors library. More...

Collaboration diagram for Unit tests:

Files

file  test_bitdecoder.cpp
 Unit tests for Bit Decoder.
 
file  test_demodulator.cpp
 Unit tests for Demodulator.
 
file  test_hidekidevice.cpp
 Unit tests for Sensors::HidekiDevice.
 
file  test_hidekisensor.cpp
 Unit tests for Sensors::HidekiSensor.
 
file  test_tgs2600.cpp
 Unit tests for Sensors::Tgs2600.
 
file  test_utils.cpp
 Unit tests for Utilities.
 
file  utils.h
 Testing utilities.
 

Functions

template<typename T >
std::string to_hex (T value)
 Converts the numeric value into its hex representation. More...
 
template<typename T >
std::string to_hex (T *data, uint16_t length)
 Converts the array of numeric values data into its hex representation. More...
 

Detailed Description

Unit tests for Sensors library.

The unit tests are intendet to be executed on the host for development, therefore the restrictions on the library do not apply and all C++ language features including STL can be used.

Function Documentation

◆ to_hex() [1/2]

template<typename T >
std::string to_hex ( value)

Converts the numeric value into its hex representation.

Template Parameters
TData type of the numeric value to operate on.
Parameters
valueNumeric value.
Returns
Hex representation of the value.

◆ to_hex() [2/2]

template<typename T >
std::string to_hex ( T *  data,
uint16_t  length 
)

Converts the array of numeric values data into its hex representation.

Template Parameters
TData type of the elements to operate on.
Parameters
dataArray of numeric values.
lengthLength of the array.
Returns
Hex representation of the numeric values in the array data.