micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
Loading...
Searching...
No Matches
Literals and wrappers

Literals and wrappers. More...

Classes

struct  micro_os_plus::micro_test_plus::to_t< T >
 Template for wrapping any other type. More...
 

Typedefs

using micro_os_plus::micro_test_plus::to_b = type_traits::value<bool>
 
using micro_os_plus::micro_test_plus::to_c = type_traits::value<char>
 
using micro_os_plus::micro_test_plus::to_d = type_traits::value<double>
 
using micro_os_plus::micro_test_plus::to_f = type_traits::value<float>
 
using micro_os_plus::micro_test_plus::to_i = type_traits::value<int>
 
using micro_os_plus::micro_test_plus::to_i16 = type_traits::value<std::int16_t>
 
using micro_os_plus::micro_test_plus::to_i32 = type_traits::value<std::int32_t>
 
using micro_os_plus::micro_test_plus::to_i64 = type_traits::value<std::int64_t>
 
using micro_os_plus::micro_test_plus::to_i8 = type_traits::value<std::int8_t>
 
using micro_os_plus::micro_test_plus::to_l = type_traits::value<long>
 
using micro_os_plus::micro_test_plus::to_ld = type_traits::value<long double>
 
using micro_os_plus::micro_test_plus::to_ll = type_traits::value<long long>
 
using micro_os_plus::micro_test_plus::to_s = type_traits::value<short>
 
using micro_os_plus::micro_test_plus::to_sc = type_traits::value<signed char>
 
using micro_os_plus::micro_test_plus::to_u = type_traits::value<unsigned>
 
using micro_os_plus::micro_test_plus::to_u16 = type_traits::value<std::uint16_t>
 
using micro_os_plus::micro_test_plus::to_u32 = type_traits::value<std::uint32_t>
 
using micro_os_plus::micro_test_plus::to_u64 = type_traits::value<std::uint64_t>
 
using micro_os_plus::micro_test_plus::to_u8 = type_traits::value<std::uint8_t>
 
using micro_os_plus::micro_test_plus::to_uc = type_traits::value<unsigned char>
 
using micro_os_plus::micro_test_plus::to_ul = type_traits::value<unsigned long>
 
using micro_os_plus::micro_test_plus::to_ull = type_traits::value<unsigned long long>
 
using micro_os_plus::micro_test_plus::to_us = type_traits::value<unsigned short>
 

Functions

constexpr auto micro_os_plus::micro_test_plus::literals::operator""_b (const char *name, decltype(sizeof("")) size)
 Operator to convert to bool.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_c ()
 Operator to convert to char.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_d ()
 Operator to convert to double.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_f ()
 Operator to convert to float.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i ()
 Operator to convert to int.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i16 ()
 Operator to convert to int16_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i32 ()
 Operator to convert to int32_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i64 ()
 Operator to convert to int64_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i8 ()
 Operator to convert to int8_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_l ()
 Operator to convert to long.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ld ()
 Operator to convert to long double.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ll ()
 Operator to convert to long long.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_s ()
 Operator to convert to short.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_sc ()
 Operator to convert to signed char.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u ()
 Operator to convert to unsigned.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u16 ()
 Operator to convert to uint16_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u32 ()
 Operator to convert to uint32_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u64 ()
 Operator to convert to uint64_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u8 ()
 Operator to convert to uint8_t.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_uc ()
 Operator to convert to unsigned char.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ul ()
 Operator to convert to unsigned long.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ull ()
 Operator to convert to unsigned long long.
 
template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_us ()
 Operator to convert to unsigned short.
 

Detailed Description

Literals and wrappers.

For converting constants to recognised typed operands, the framework defines several literal operators in the separate namespace literals.

Similarly, for dynamic values, there are wrappers that convert them to recognised types.

Examples
mt::expect (mt::to_i {answer} == 42_i);
mt::expect (mt::to_f {expression} == 42_f);
type_traits::value< int > _i
Definition literals.h:366
type_traits::value< float > _f
Definition literals.h:398

Typedef Documentation

◆ to_b

Since
3.2.0

Definition at line 430 of file literals.h.

◆ to_c

Since
3.2.0

Definition at line 432 of file literals.h.

◆ to_d

Since
3.2.0

Definition at line 472 of file literals.h.

◆ to_f

Since
3.2.0

Definition at line 470 of file literals.h.

◆ to_i

Since
3.2.0

Definition at line 438 of file literals.h.

◆ to_i16

Since
3.2.0

Definition at line 456 of file literals.h.

◆ to_i32

Since
3.2.0

Definition at line 458 of file literals.h.

◆ to_i64

Since
3.2.0

Definition at line 460 of file literals.h.

◆ to_i8

Since
3.2.0

Definition at line 454 of file literals.h.

◆ to_l

Since
3.2.0

Definition at line 440 of file literals.h.

◆ to_ld

Since
3.2.0

Definition at line 474 of file literals.h.

◆ to_ll

Since
3.2.0

Definition at line 442 of file literals.h.

◆ to_s

Since
3.2.0

Definition at line 436 of file literals.h.

◆ to_sc

Since
3.2.0

Definition at line 434 of file literals.h.

◆ to_u

Since
3.2.0

Definition at line 444 of file literals.h.

◆ to_u16

Since
3.2.0

Definition at line 464 of file literals.h.

◆ to_u32

Since
3.2.0

Definition at line 466 of file literals.h.

◆ to_u64

Since
3.2.0

Definition at line 468 of file literals.h.

◆ to_u8

Since
3.2.0

Definition at line 462 of file literals.h.

◆ to_uc

Since
3.2.0

Definition at line 446 of file literals.h.

◆ to_ul

Since
3.2.0

Definition at line 450 of file literals.h.

◆ to_ull

Since
3.2.0

Definition at line 452 of file literals.h.

◆ to_us

Since
3.2.0

Definition at line 448 of file literals.h.

Function Documentation

◆ operator""_b()

constexpr auto micro_os_plus::micro_test_plus::literals::operator""_b ( const char * name,
decltype(sizeof("")) size )
constexpr

Operator to convert to bool.

Definition at line 320 of file literals.h.

◆ operator""_c()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_c ( )
constexpr

Operator to convert to char.

Definition at line 79 of file literals.h.

◆ operator""_d()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_d ( )
constexpr

Operator to convert to double.

Definition at line 293 of file literals.h.

◆ operator""_f()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_f ( )
constexpr

Operator to convert to float.

Definition at line 279 of file literals.h.

◆ operator""_i()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i ( )
constexpr

Operator to convert to int.

Definition at line 57 of file literals.h.

◆ operator""_i16()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i16 ( )
constexpr

Operator to convert to int16_t.

Definition at line 195 of file literals.h.

◆ operator""_i32()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i32 ( )
constexpr

Operator to convert to int32_t.

Definition at line 207 of file literals.h.

◆ operator""_i64()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i64 ( )
constexpr

Operator to convert to int64_t.

Definition at line 219 of file literals.h.

◆ operator""_i8()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_i8 ( )
constexpr

Operator to convert to int8_t.

Definition at line 183 of file literals.h.

◆ operator""_l()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_l ( )
constexpr

Operator to convert to long.

Definition at line 102 of file literals.h.

◆ operator""_ld()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ld ( )
constexpr

Operator to convert to long double.

Definition at line 307 of file literals.h.

◆ operator""_ll()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ll ( )
constexpr

Operator to convert to long long.

Definition at line 113 of file literals.h.

◆ operator""_s()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_s ( )
constexpr

Operator to convert to short.

Definition at line 68 of file literals.h.

◆ operator""_sc()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_sc ( )
constexpr

Operator to convert to signed char.

Definition at line 90 of file literals.h.

◆ operator""_u()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u ( )
constexpr

Operator to convert to unsigned.

Definition at line 124 of file literals.h.

◆ operator""_u16()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u16 ( )
constexpr

Operator to convert to uint16_t.

Definition at line 243 of file literals.h.

◆ operator""_u32()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u32 ( )
constexpr

Operator to convert to uint32_t.

Definition at line 255 of file literals.h.

◆ operator""_u64()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u64 ( )
constexpr

Operator to convert to uint64_t.

Definition at line 267 of file literals.h.

◆ operator""_u8()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_u8 ( )
constexpr

Operator to convert to uint8_t.

Definition at line 231 of file literals.h.

◆ operator""_uc()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_uc ( )
constexpr

Operator to convert to unsigned char.

Definition at line 135 of file literals.h.

◆ operator""_ul()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ul ( )
constexpr

Operator to convert to unsigned long.

Definition at line 159 of file literals.h.

◆ operator""_ull()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_ull ( )
constexpr

Operator to convert to unsigned long long.

Definition at line 171 of file literals.h.

◆ operator""_us()

template<char... Cs>
constexpr auto micro_os_plus::micro_test_plus::literals::operator""_us ( )
constexpr

Operator to convert to unsigned short.

Definition at line 147 of file literals.h.