ChimeraTK-DeviceAccess 03.26.00
Loading...
Searching...
No Matches
testRawConverter.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "Exception.h"
#include "RawConverter.h"
#include <sstream>
+ Include dependency graph for testRawConverter.cpp:

Go to the source code of this file.

Classes

class  FixedPointConverter< RawType >
 

Namespaces

namespace  ChimeraTK
 

Macros

#define BOOST_TEST_DYN_LINK
 
#define BOOST_TEST_MODULE   FixedPointConverterTest
 
#define HEX_TO_DOUBLE(INPUT)   static_cast<double>(INPUT)
 
#define SIGNED_HEX_TO_DOUBLE(INPUT)   static_cast<double>(static_cast<int32_t>(INPUT))
 
#define SIGNED_HEX_TO_INT64(INPUT)   static_cast<int64_t>(static_cast<int32_t>(INPUT))
 
#define CHECK_SIGNED_FIXED_POINT_NO_FRACTIONAL
 
#define DEF_TYPENAME(name)
 

Typedefs

using DEPRECATED_FIXEDPOINT_DEFAULT = int32_t
 

Functions

template<typename T >
const char * typeName (void)
 
template<typename T >
void checkToCookedOverflowNeg (FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &converter, uint32_t input)
 
template<typename T >
void checkToCookedOverflowPos (FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &converter, uint32_t input)
 
template<typename T >
void checkToCooked (FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &converter, uint32_t input, T expectedValue, const std::string &msg=std::string(""))
 
template<typename T >
void checkToRaw (FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &converter, T input, uint32_t expectedValue, const std::string &msg=std::string(""))
 
 BOOST_AUTO_TEST_CASE (testInt32)
 
 BOOST_AUTO_TEST_CASE (testUInt32)
 
 BOOST_AUTO_TEST_CASE (testInt16)
 
 BOOST_AUTO_TEST_CASE (testUInt16)
 
 BOOST_AUTO_TEST_CASE (testInt8)
 
 BOOST_AUTO_TEST_CASE (testUInt8)
 
 BOOST_AUTO_TEST_CASE (testInt32_fractionMinus12)
 
 BOOST_AUTO_TEST_CASE (testUInt32_fractionMinus12)
 
 BOOST_AUTO_TEST_CASE (testInt32_fractionMinus1)
 
 BOOST_AUTO_TEST_CASE (testUInt32_fractionMinus1)
 
 BOOST_AUTO_TEST_CASE (testInt16_fractionMinus1)
 
 BOOST_AUTO_TEST_CASE (testUInt16_fractionMinus1)
 
 BOOST_AUTO_TEST_CASE (testInt32_fraction1)
 
 BOOST_AUTO_TEST_CASE (testUInt32_fraction1)
 
 BOOST_AUTO_TEST_CASE (testInt32_fraction7)
 
 BOOST_AUTO_TEST_CASE (testUInt32_fraction7)
 
 BOOST_AUTO_TEST_CASE (testInt32_fraction31)
 
 BOOST_AUTO_TEST_CASE (testUInt32_fraction31)
 
 BOOST_AUTO_TEST_CASE (testInt32_fraction32)
 
 BOOST_AUTO_TEST_CASE (testUInt32_fraction32)
 
 BOOST_AUTO_TEST_CASE (testInt18_fractionMinus12)
 
 BOOST_AUTO_TEST_CASE (testUInt18_fractionMinus12)
 
 BOOST_AUTO_TEST_CASE (testInt18_fraction0)
 
 BOOST_AUTO_TEST_CASE (testUInt18_fraction0)
 
 BOOST_AUTO_TEST_CASE (testInt18_fraction7)
 
 BOOST_AUTO_TEST_CASE (testUInt18_fraction7)
 
 BOOST_AUTO_TEST_CASE (testInt18_fraction17)
 
 BOOST_AUTO_TEST_CASE (testUInt18_fraction17)
 
 BOOST_AUTO_TEST_CASE (testInt18_fraction18)
 
 BOOST_AUTO_TEST_CASE (testUInt18_fraction18)
 
 BOOST_AUTO_TEST_CASE (testInt32ToInt32)
 
 BOOST_AUTO_TEST_CASE (testInt32ToInt16)
 
 BOOST_AUTO_TEST_CASE (testInt18ToInt32)
 
 BOOST_AUTO_TEST_CASE (testIntSignedToUnsigned)
 
 BOOST_AUTO_TEST_CASE (testInt17SignedToInt16Unsigned)
 
 BOOST_AUTO_TEST_CASE (testBoolean0)
 
 BOOST_AUTO_TEST_CASE (testVoid)
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 4 of file testRawConverter.cpp.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   FixedPointConverterTest

Definition at line 5 of file testRawConverter.cpp.

◆ CHECK_SIGNED_FIXED_POINT_NO_FRACTIONAL

#define CHECK_SIGNED_FIXED_POINT_NO_FRACTIONAL
Value:
checkToFixedPoint(converter, 0.25, 0); \
checkToFixedPoint(converter, -0.25, 0); \
checkToFixedPoint(converter, 0.75, 1); \
checkToFixedPoint(converter, -0.75, -1); \
checkToFixedPoint(converter, 3.25, 3); \
checkToFixedPoint(converter, -3.25, -3); \
checkToFixedPoint(converter, 5.75, 6); \
checkToFixedPoint(converter, -5.75, -6);

Definition at line 28 of file testRawConverter.cpp.

◆ DEF_TYPENAME

#define DEF_TYPENAME (   name)
Value:
template<> \
inline const char* typeName<name>(void) { \
return #name; \
}

Definition at line 52 of file testRawConverter.cpp.

◆ HEX_TO_DOUBLE

#define HEX_TO_DOUBLE (   INPUT)    static_cast<double>(INPUT)

Definition at line 24 of file testRawConverter.cpp.

◆ SIGNED_HEX_TO_DOUBLE

#define SIGNED_HEX_TO_DOUBLE (   INPUT)    static_cast<double>(static_cast<int32_t>(INPUT))

Definition at line 25 of file testRawConverter.cpp.

◆ SIGNED_HEX_TO_INT64

#define SIGNED_HEX_TO_INT64 (   INPUT)    static_cast<int64_t>(static_cast<int32_t>(INPUT))

Definition at line 26 of file testRawConverter.cpp.

Typedef Documentation

◆ DEPRECATED_FIXEDPOINT_DEFAULT

Definition at line 70 of file testRawConverter.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/37]

BOOST_AUTO_TEST_CASE ( testBoolean0  )

Definition at line 1671 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/37]

BOOST_AUTO_TEST_CASE ( testInt16  )

Definition at line 272 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/37]

BOOST_AUTO_TEST_CASE ( testInt16_fractionMinus1  )

Definition at line 611 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [4/37]

BOOST_AUTO_TEST_CASE ( testInt17SignedToInt16Unsigned  )

Definition at line 1563 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/37]

BOOST_AUTO_TEST_CASE ( testInt18_fraction0  )

Definition at line 1172 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [6/37]

BOOST_AUTO_TEST_CASE ( testInt18_fraction17  )

Definition at line 1316 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [7/37]

BOOST_AUTO_TEST_CASE ( testInt18_fraction18  )

Definition at line 1360 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [8/37]

BOOST_AUTO_TEST_CASE ( testInt18_fraction7  )

Definition at line 1247 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [9/37]

BOOST_AUTO_TEST_CASE ( testInt18_fractionMinus12  )

Definition at line 1104 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [10/37]

BOOST_AUTO_TEST_CASE ( testInt18ToInt32  )

Definition at line 1514 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [11/37]

BOOST_AUTO_TEST_CASE ( testInt32  )

Definition at line 175 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [12/37]

BOOST_AUTO_TEST_CASE ( testInt32_fraction1  )

Definition at line 685 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [13/37]

BOOST_AUTO_TEST_CASE ( testInt32_fraction31  )

Definition at line 856 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [14/37]

BOOST_AUTO_TEST_CASE ( testInt32_fraction32  )

Definition at line 945 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [15/37]

BOOST_AUTO_TEST_CASE ( testInt32_fraction7  )

Definition at line 771 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [16/37]

BOOST_AUTO_TEST_CASE ( testInt32_fractionMinus1  )

Definition at line 537 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [17/37]

BOOST_AUTO_TEST_CASE ( testInt32_fractionMinus12  )

Definition at line 451 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [18/37]

BOOST_AUTO_TEST_CASE ( testInt32ToInt16  )

Definition at line 1489 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [19/37]

BOOST_AUTO_TEST_CASE ( testInt32ToInt32  )

Definition at line 1467 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [20/37]

BOOST_AUTO_TEST_CASE ( testInt8  )

Definition at line 362 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [21/37]

BOOST_AUTO_TEST_CASE ( testIntSignedToUnsigned  )

Definition at line 1541 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [22/37]

BOOST_AUTO_TEST_CASE ( testUInt16  )

Definition at line 318 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [23/37]

BOOST_AUTO_TEST_CASE ( testUInt16_fractionMinus1  )

Definition at line 652 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [24/37]

BOOST_AUTO_TEST_CASE ( testUInt18_fraction0  )

Definition at line 1213 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [25/37]

BOOST_AUTO_TEST_CASE ( testUInt18_fraction17  )

Definition at line 1338 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [26/37]

BOOST_AUTO_TEST_CASE ( testUInt18_fraction18  )

Definition at line 1387 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [27/37]

BOOST_AUTO_TEST_CASE ( testUInt18_fraction7  )

Definition at line 1279 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [28/37]

BOOST_AUTO_TEST_CASE ( testUInt18_fractionMinus12  )

Definition at line 1137 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [29/37]

BOOST_AUTO_TEST_CASE ( testUInt32  )

Definition at line 224 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [30/37]

BOOST_AUTO_TEST_CASE ( testUInt32_fraction1  )

Definition at line 730 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [31/37]

BOOST_AUTO_TEST_CASE ( testUInt32_fraction31  )

Definition at line 900 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [32/37]

BOOST_AUTO_TEST_CASE ( testUInt32_fraction32  )

Definition at line 986 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [33/37]

BOOST_AUTO_TEST_CASE ( testUInt32_fraction7  )

Definition at line 819 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [34/37]

BOOST_AUTO_TEST_CASE ( testUInt32_fractionMinus1  )

Definition at line 578 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [35/37]

BOOST_AUTO_TEST_CASE ( testUInt32_fractionMinus12  )

Definition at line 495 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [36/37]

BOOST_AUTO_TEST_CASE ( testUInt8  )

Definition at line 407 of file testRawConverter.cpp.

◆ BOOST_AUTO_TEST_CASE() [37/37]

BOOST_AUTO_TEST_CASE ( testVoid  )

Definition at line 1678 of file testRawConverter.cpp.

◆ checkToCooked()

template<typename T >
void checkToCooked ( FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &  converter,
uint32_t  input,
expectedValue,
const std::string &  msg = std::string("") 
)

Definition at line 117 of file testRawConverter.cpp.

◆ checkToCookedOverflowNeg()

template<typename T >
void checkToCookedOverflowNeg ( FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &  converter,
uint32_t  input 
)

Definition at line 107 of file testRawConverter.cpp.

◆ checkToCookedOverflowPos()

template<typename T >
void checkToCookedOverflowPos ( FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &  converter,
uint32_t  input 
)

Definition at line 112 of file testRawConverter.cpp.

◆ checkToRaw()

template<typename T >
void checkToRaw ( FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > const &  converter,
input,
uint32_t  expectedValue,
const std::string &  msg = std::string("") 
)

Definition at line 137 of file testRawConverter.cpp.

◆ typeName()

template<typename T >
const char * typeName ( void  )
inline

Definition at line 49 of file testRawConverter.cpp.