#include <rw_driver.h>
#include <rw/_defs.h>
#include <type_traits>
#include <rw_printf.h>
#include <stdlib.h>
#include <stddef.h>
Go to the source code of this file.
|
| #define | TEST(Size, Align) |
| |
| #define | TEST(Size) |
| |
| #define | TEST(Len, T1) aligned_union_tester<Len,T1>::test(__LINE__,#T1) |
| |
| #define | TEST(Len, T1, T2) aligned_union_tester<Len,T1,T2>::test(__LINE__,#T1,#T2) |
| |
| #define | TEST(Len, T1, T2, T3, T4, T5) aligned_union_tester<Len,T1,T2,T3,T4,T5>::test(__LINE__,#T1,#T2,#T3,#T4,#T5) |
| |
| #define | TEST(Trait, TypeT, TypeU) |
| |
| #define | TEST(Cond, Expect) test_enable_if(__LINE__, #Cond, Cond, Expect) |
| |
| #define | TEST(Cond, Expect) test_enable_if(__LINE__, #Cond, Cond, Expect) |
| |
| #define | TEST(Trait, Select, TypeT, TypeU, TypeV) |
| |
|
| template<class T > |
| int | enabled_if_char (typename std::enable_if< is_char< T >::val >::type *=0) |
| |
| template<class T > |
| int | enabled_if_char (typename std::enable_if<!is_char< T >::val >::type *=0) |
| |
| int | _cond_if_char (void *) |
| |
| int | _cond_if_char (long *) |
| |
| template<class T > |
| int | cond_if_char () |
| |
| void | test_trait (int line, bool select, const char *trait, const char *typeT, const char *typeU, bool success) |
| |
| void | test_trait (int line, const char *trait, const char *typeT, const char *typeU, bool success) |
| |
| void | test_enable_if (int line, const char *typeT, int got, int exp) |
| |
| void | test_aligned_storage (int line, size_t exp_sz, size_t got_sz, size_t exp_al, size_t got_al) |
| |
| size_t | max8 (size_t a1, size_t a2, size_t a3, size_t a4, size_t a5, size_t a6, size_t a7, size_t a8) |
| |
| int | main (int argc, char *argv[]) |
| |
◆ TEST [1/9]
| #define TEST |
( |
|
Cond, |
|
|
|
Expect |
|
) |
| test_enable_if(__LINE__, #Cond, Cond, Expect) |
◆ TEST [2/9]
| #define TEST |
( |
|
Cond, |
|
|
|
Expect |
|
) |
| test_enable_if(__LINE__, #Cond, Cond, Expect) |
◆ TEST [3/9]
◆ TEST [4/9]
◆ TEST [5/9]
| #define TEST |
( |
|
Len, |
|
|
|
T1, |
|
|
|
T2, |
|
|
|
T3, |
|
|
|
T4, |
|
|
|
T5 |
|
) |
| aligned_union_tester<Len,T1,T2,T3,T4,T5>::test(__LINE__,#T1,#T2,#T3,#T4,#T5) |
◆ TEST [6/9]
Value: { \
typedef std::aligned_storage<Size>::type storage_t; \
test_aligned_storage(__LINE__, \
Size,
sizeof (storage_t), 0, \
std::alignment_of<storage_t>::value); \
} typedef void __dummy
◆ TEST [7/9]
| #define TEST |
( |
|
Size, |
|
|
|
Align |
|
) |
| |
Value: { \
typedef std::aligned_storage<Size, Align>::type storage_t; \
test_aligned_storage(__LINE__, \
Size,
sizeof (storage_t), Align, \
std::alignment_of<storage_t>::value); \
} typedef void __dummy
◆ TEST [8/9]
| #define TEST |
( |
|
Trait, |
|
|
|
Select, |
|
|
|
TypeT, |
|
|
|
TypeU, |
|
|
|
TypeV |
|
) |
| |
Value: test_trait(__LINE__, Select, #Trait, #TypeT, #TypeU, \
std::is_same<Trait<Select,TypeT,TypeU>::type, TypeV>
::value)
◆ TEST [9/9]
| #define TEST |
( |
|
Trait, |
|
|
|
TypeT, |
|
|
|
TypeU |
|
) |
| |
Value:
std::is_same<Trait<TypeT>::type, TypeU>
::value)
◆ enum_t
◆ _cond_if_char() [1/2]
| int _cond_if_char |
( |
long * |
| ) |
|
◆ _cond_if_char() [2/2]
| int _cond_if_char |
( |
void * |
| ) |
|
◆ cond_if_char()
◆ enabled_if_char() [1/2]
| int enabled_if_char |
( |
typename std::enable_if< is_char< T >::val >::type * |
= 0 | ) |
|
◆ enabled_if_char() [2/2]
| int enabled_if_char |
( |
typename std::enable_if<!is_char< T >::val >::type * |
= 0 | ) |
|
◆ main()
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
◆ max8()
| size_t max8 |
( |
size_t |
a1, |
|
|
size_t |
a2, |
|
|
size_t |
a3, |
|
|
size_t |
a4, |
|
|
size_t |
a5, |
|
|
size_t |
a6, |
|
|
size_t |
a7, |
|
|
size_t |
a8 |
|
) |
| |
◆ test_aligned_storage()
| void test_aligned_storage |
( |
int |
line, |
|
|
size_t |
exp_sz, |
|
|
size_t |
got_sz, |
|
|
size_t |
exp_al, |
|
|
size_t |
got_al |
|
) |
| |
◆ test_enable_if()
| void test_enable_if |
( |
int |
line, |
|
|
const char * |
typeT, |
|
|
int |
got, |
|
|
int |
exp |
|
) |
| |
◆ test_trait() [1/2]
| void test_trait |
( |
int |
line, |
|
|
bool |
select, |
|
|
const char * |
trait, |
|
|
const char * |
typeT, |
|
|
const char * |
typeU, |
|
|
bool |
success |
|
) |
| |
◆ test_trait() [2/2]
| void test_trait |
( |
int |
line, |
|
|
const char * |
trait, |
|
|
const char * |
typeT, |
|
|
const char * |
typeU, |
|
|
bool |
success |
|
) |
| |