Go to the source code of this file.
◆ GENERATE_TEST_NAME
#define GENERATE_TEST_NAME |
( |
|
group, |
|
|
|
message |
|
) |
| (astring(group) + " test group: " + message) |
◆ TEST [1/4]
◆ TEST [2/4]
◆ TEST [3/4]
◆ TEST [4/4]
◆ TRY_ON
#define TRY_ON |
( |
|
type, |
|
|
|
value, |
|
|
|
group |
|
) |
| |
Value: { \
byte_array temp_array; \
attach(temp_array, type(value)); \
type output; \
\
ASSERT_TRUE(
detach(temp_array, output), \
ASSERT_TRUE(output == type(value), \
ASSERT_FALSE(temp_array.length(), \
}
bool detach(byte_array &packed_form, astring &to_detach)
Unpacks a character string "to_attach" from "packed_form".
#define GENERATE_TEST_NAME(group, message)
Definition at line 36 of file test_packing.cpp.
◆ TRY_ON_F
#define TRY_ON_F |
( |
|
type, |
|
|
|
value, |
|
|
|
group |
|
) |
| |
Value: { \
byte_array temp_array; \
attach(temp_array, type(value)); \
type output; \
\
ASSERT_TRUE(
detach(temp_array, output), \
\
\
int exponent_1, exponent_2; \
double mantissa_1 = frexp(output, &exponent_1); \
double mantissa_2 = frexp(output, &exponent_2); \
ASSERT_FALSE( (mantissa_1 != mantissa_2) || (exponent_1 != exponent_2), \
ASSERT_FALSE(temp_array.length(), \
}
Definition at line 62 of file test_packing.cpp.
◆ TRY_ON_OBSCURE
#define TRY_ON_OBSCURE |
( |
|
type, |
|
|
|
value, |
|
|
|
group |
|
) |
| |
Value: { \
byte_array temp_array; \
obscure_attach(temp_array, type(value)); \
type output; \
\
ASSERT_TRUE(output == type(value), \
ASSERT_FALSE(temp_array.length(), \
}
bool obscure_detach(byte_array &packed_form, un_int &to_detach)
shifts the number back and checks validity, false returned if corrupted.
Definition at line 49 of file test_packing.cpp.
◆ HOOPLE_MAIN()
HOOPLE_MAIN |
( |
test_object_packing |
| ) |
|