iPXE
|
Base16 tests. More...
Go to the source code of this file.
Data Structures | |
struct | base16_test |
A Base16 test. More... | |
Macros | |
#define | DATA(...) { __VA_ARGS__ } |
Define inline data. More... | |
#define | BASE16(name, DATA, ENCODED) |
Define a base16 test. More... | |
#define | base16_encode_ok(test) base16_encode_okx ( test, __FILE__, __LINE__ ) |
#define | base16_decode_ok(test) base16_decode_okx ( test, __FILE__, __LINE__ ) |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
BASE16 (empty_test, DATA(), "") | |
Empty data test. More... | |
BASE16 (hw_test, DATA( 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'), "48656c6c6f20776f726c64") | |
"Hello world" test More... | |
BASE16 (random_test, DATA(0x8b, 0x1a, 0xa2, 0x6c, 0xa9, 0x38, 0x43, 0xb8, 0x81, 0xf8, 0x30, 0x44, 0xb2, 0x32, 0x6e, 0x82, 0xfe, 0x0f, 0x84, 0x91), "8b1aa26ca93843b881f83044b2326e82fe0f8491") | |
Random data test. More... | |
static void | base16_encode_okx (struct base16_test *test, const char *file, unsigned int line) |
Report a base16 encoding test result. More... | |
static void | base16_decode_okx (struct base16_test *test, const char *file, unsigned int line) |
Report a base16 decoding test result. More... | |
static void | base16_test_exec (void) |
Perform Base16 self-tests. More... | |
Variables | |
struct self_test base16_test | __self_test |
Base16 self-test. More... | |
Base16 tests.
Definition in file base16_test.c.
#define DATA | ( | ... | ) | { __VA_ARGS__ } |
Define inline data.
Definition at line 51 of file base16_test.c.
Define a base16 test.
Definition at line 54 of file base16_test.c.
#define base16_encode_ok | ( | test | ) | base16_encode_okx ( test, __FILE__, __LINE__ ) |
Definition at line 94 of file base16_test.c.
#define base16_decode_ok | ( | test | ) | base16_decode_okx ( test, __FILE__, __LINE__ ) |
Definition at line 115 of file base16_test.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
BASE16 | ( | empty_test | , |
DATA() | , | ||
"" | |||
) |
Empty data test.
BASE16 | ( | hw_test | , |
DATA('H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd') | , | ||
"48656c6c6f20776f726c64" | |||
) |
"Hello world" test
BASE16 | ( | random_test | , |
DATA(0x8b, 0x1a, 0xa2, 0x6c, 0xa9, 0x38, 0x43, 0xb8, 0x81, 0xf8, 0x30, 0x44, 0xb2, 0x32, 0x6e, 0x82, 0xfe, 0x0f, 0x84, 0x91) | , | ||
"8b1aa26ca93843b881f83044b2326e82fe0f8491" | |||
) |
Random data test.
|
static |
Report a base16 encoding test result.
test | Base16 test |
file | Test code file |
line | Test code line |
Definition at line 83 of file base16_test.c.
References base16_encoded_len(), len, okx, strcmp(), strlen(), and test.
|
static |
Report a base16 decoding test result.
test | Base16 test |
file | Test code file |
line | Test code line |
Definition at line 103 of file base16_test.c.
References base16_decoded_max_len(), len, memcmp(), okx, and test.
|
static |
Perform Base16 self-tests.
Definition at line 121 of file base16_test.c.
References base16_decode_ok, and base16_encode_ok.
struct self_test base16_test __self_test |
Base16 self-test.
Definition at line 134 of file base16_test.c.