iPXE
|
Base64 tests. More...
Go to the source code of this file.
Data Structures | |
struct | base64_test |
A Base64 test. More... | |
Macros | |
#define | DATA(...) { __VA_ARGS__ } |
Define inline data. More... | |
#define | BASE64(name, DATA, ENCODED) |
Define a base64 test. More... | |
#define | base64_encode_ok(test) base64_encode_okx ( test, __FILE__, __LINE__ ) |
#define | base64_decode_ok(test) base64_decode_okx ( test, __FILE__, __LINE__ ) |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
BASE64 (empty_test, DATA(), "") | |
Empty data test. More... | |
BASE64 (hw_test, DATA( 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'), "SGVsbG8gd29ybGQ=") | |
"Hello world" test More... | |
BASE64 (random_test, DATA(0x36, 0x03, 0x84, 0xdc, 0x4e, 0x03, 0x46, 0xa0, 0xb5, 0x2d, 0x03, 0x6e, 0xd0, 0x56, 0xed, 0xa0, 0x37, 0x02, 0xac, 0xc6, 0x65, 0xd1), "NgOE3E4DRqC1LQNu0FbtoDcCrMZl0Q==") | |
Random data test. More... | |
static void | base64_encode_okx (struct base64_test *test, const char *file, unsigned int line) |
Report a base64 encoding test result. More... | |
static void | base64_decode_okx (struct base64_test *test, const char *file, unsigned int line) |
Report a base64 decoding test result. More... | |
static void | base64_test_exec (void) |
Perform Base64 self-tests. More... | |
Variables | |
struct self_test base64_test | __self_test |
Base64 self-test. More... | |
#define DATA | ( | ... | ) | { __VA_ARGS__ } |
Define inline data.
Definition at line 53 of file base64_test.c.
Define a base64 test.
Definition at line 56 of file base64_test.c.
#define base64_encode_ok | ( | test | ) | base64_encode_okx ( test, __FILE__, __LINE__ ) |
Definition at line 97 of file base64_test.c.
#define base64_decode_ok | ( | test | ) | base64_decode_okx ( test, __FILE__, __LINE__ ) |
Definition at line 118 of file base64_test.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
BASE64 | ( | empty_test | , |
DATA() | , | ||
"" | |||
) |
Empty data test.
BASE64 | ( | random_test | , |
DATA(0x36, 0x03, 0x84, 0xdc, 0x4e, 0x03, 0x46, 0xa0, 0xb5, 0x2d, 0x03, 0x6e, 0xd0, 0x56, 0xed, 0xa0, 0x37, 0x02, 0xac, 0xc6, 0x65, 0xd1) | |||
) |
Random data test.
|
static |
Report a base64 encoding test result.
test | Base64 test |
file | Test code file |
line | Test code line |
Definition at line 86 of file base64_test.c.
References base64_encode(), base64_encoded_len(), len, okx, strcmp(), strlen(), and test.
|
static |
Report a base64 decoding test result.
test | Base64 test |
file | Test code file |
line | Test code line |
Definition at line 106 of file base64_test.c.
References base64_decode(), base64_decoded_max_len(), len, memcmp(), okx, and test.
|
static |
Perform Base64 self-tests.
Definition at line 124 of file base64_test.c.
References base64_decode_ok, and base64_encode_ok.
struct self_test base64_test __self_test |
Base64 self-test.
Definition at line 137 of file base64_test.c.