jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Namespaces | Functions | Variables
test_basictypeconv.cpp File Reference
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <jau/test/catch2_ext.hpp>
#include <jau/basic_types.hpp>
#include <endian.h>
Include dependency graph for test_basictypeconv.cpp:

Go to the source code of this file.

Namespaces

namespace  test_impl
 Test private impl namespace.
 

Functions

template<typename Value_type >
static bool compare_values (const Value_type a, const Value_type b)
 
template<typename Value_type >
static Value_type compose (const uint8_t lowest_value, const jau::endian_t le_or_be)
 
template<typename Value_type >
static Value_type compose (const uint8_t lowest_value, const jau::lb_endian_t le_or_be)
 
static uint16_t compose (const uint8_t n1, const uint8_t n2)
 
static uint32_t compose (const uint8_t n1, const uint8_t n2, const uint8_t n3, const uint8_t n4)
 
static uint64_t compose (const uint8_t n1, const uint8_t n2, const uint8_t n3, const uint8_t n4, const uint8_t n5, const uint8_t n6, const uint8_t n7, const uint8_t n8)
 
constexpr bool isLittleEndian2 () noexcept
 Just demonstrating usage of our type-traits in a convenient API manner w/o requiring to add the dummy template type. More...
 
template<class Dummy_type >
constexpr bool test_impl::isLittleEndian2_impl (std::enable_if_t< jau::has_endian_little_v< Dummy_type >, bool >=true) noexcept
 
template<class Dummy_type >
constexpr bool test_impl::isLittleEndian2_impl (std::enable_if_t<!jau::has_endian_little_v< Dummy_type >, bool >=true) noexcept
 
template<typename Value_type >
static void print (const Value_type a)
 
template<typename Value_type >
static void test_byteorder (const Value_type v_cpu, const Value_type v_le, const Value_type v_be)
 
 TEST_CASE ("Endianess Test 00", "[endian]")
 
 TEST_CASE ("HexString from and to byte vector conversion - Test 04", "[hexstring]")
 
 TEST_CASE ("Integer Get/Put in CPU Byte Order Test 02", "[byteorder][get][put]")
 
 TEST_CASE ("Integer Get/Put in explicit Byte Order Test 03", "[byteorder][get][put]")
 
 TEST_CASE ("Integer Type Byte Order Test 01", "[byteorder][bswap]")
 
 TEST_CASE ("Integer Type Test Test 05", "[integer][type]")
 
template<typename Value_type >
static void test_value_cpu (const Value_type v1, const Value_type v2, const Value_type v3)
 
template<typename Value_type >
static void test_value_littlebig (const Value_type v_cpu, const Value_type v_le, const Value_type v_be)
 

Variables

static constexpr bool VERBOSE = false
 

Function Documentation

◆ isLittleEndian2()

constexpr bool isLittleEndian2 ( )
constexprnoexcept

Just demonstrating usage of our type-traits in a convenient API manner w/o requiring to add the dummy template type.

Examples
test_basictypeconv.cpp.

Definition at line 62 of file test_basictypeconv.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [1/6]

TEST_CASE ( "Endianess Test 00"  ,
""  [endian] 
)
Examples
test_basictypeconv.cpp.

Definition at line 67 of file test_basictypeconv.cpp.

◆ print()

template<typename Value_type >
static void print ( const Value_type  a)
static
Examples
test_basictypeconv.cpp, and test_functional.hpp.

Definition at line 94 of file test_basictypeconv.cpp.

Here is the caller graph for this function:

◆ compare_values()

template<typename Value_type >
static bool compare_values ( const Value_type  a,
const Value_type  b 
)
static
Examples
test_basictypeconv.cpp.

Definition at line 102 of file test_basictypeconv.cpp.

Here is the caller graph for this function:

◆ test_byteorder()

template<typename Value_type >
static void test_byteorder ( const Value_type  v_cpu,
const Value_type  v_le,
const Value_type  v_be 
)
static
Examples
test_basictypeconv.cpp.

Definition at line 116 of file test_basictypeconv.cpp.

Here is the caller graph for this function:

◆ compose() [1/5]

static uint16_t compose ( const uint8_t  n1,
const uint8_t  n2 
)
static
Examples
test_basictypeconv.cpp.

Definition at line 152 of file test_basictypeconv.cpp.

Here is the caller graph for this function:

◆ compose() [2/5]

static uint32_t compose ( const uint8_t  n1,
const uint8_t  n2,
const uint8_t  n3,
const uint8_t  n4 
)
static

Definition at line 159 of file test_basictypeconv.cpp.

◆ compose() [3/5]

static uint64_t compose ( const uint8_t  n1,
const uint8_t  n2,
const uint8_t  n3,
const uint8_t  n4,
const uint8_t  n5,
const uint8_t  n6,
const uint8_t  n7,
const uint8_t  n8 
)
static

Definition at line 168 of file test_basictypeconv.cpp.

◆ compose() [4/5]

template<typename Value_type >
static Value_type compose ( const uint8_t  lowest_value,
const jau::lb_endian_t  le_or_be 
)
static

Definition at line 184 of file test_basictypeconv.cpp.

◆ compose() [5/5]

template<typename Value_type >
static Value_type compose ( const uint8_t  lowest_value,
const jau::endian_t  le_or_be 
)
static

Definition at line 200 of file test_basictypeconv.cpp.

◆ TEST_CASE() [2/6]

TEST_CASE ( "Integer Type Byte Order Test 01"  ,
""  [byteorder][bswap] 
)

Definition at line 204 of file test_basictypeconv.cpp.

◆ test_value_cpu()

template<typename Value_type >
static void test_value_cpu ( const Value_type  v1,
const Value_type  v2,
const Value_type  v3 
)
static
Examples
test_basictypeconv.cpp.

Definition at line 244 of file test_basictypeconv.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [3/6]

TEST_CASE ( "Integer Get/Put in CPU Byte Order Test 02"  ,
""  [byteorder][get][put] 
)

Definition at line 257 of file test_basictypeconv.cpp.

◆ test_value_littlebig()

template<typename Value_type >
static void test_value_littlebig ( const Value_type  v_cpu,
const Value_type  v_le,
const Value_type  v_be 
)
static
Examples
test_basictypeconv.cpp.

Definition at line 295 of file test_basictypeconv.cpp.

Here is the caller graph for this function:

◆ TEST_CASE() [4/6]

TEST_CASE ( "Integer Get/Put in explicit Byte Order Test 03"  ,
""  [byteorder][get][put] 
)

Definition at line 319 of file test_basictypeconv.cpp.

◆ TEST_CASE() [5/6]

TEST_CASE ( "HexString from and to byte vector conversion - Test 04"  ,
""  [hexstring] 
)

Definition at line 358 of file test_basictypeconv.cpp.

◆ TEST_CASE() [6/6]

TEST_CASE ( "Integer Type Test Test 05"  ,
""  [integer][type] 
)

Definition at line 382 of file test_basictypeconv.cpp.

Variable Documentation

◆ VERBOSE

constexpr bool VERBOSE = false
inlinestaticconstexpr
Examples
test_basictypeconv.cpp.

Definition at line 39 of file test_basictypeconv.cpp.