static char* test_encode_to_base64() { mu_assert("Encoding 3 bytes", assert_base64_encode("Man", 3, "TWFu")); mu_assert("Encoding with padding '='", assert_base64_encode("any carnal pleasure.", 20, "YW55IGNhcm5hbCBwbGVhc3VyZS4=")); mu_assert("Encoding with padding '=='", assert_base64_encode("any carnal pleasure", 19, "YW55IGNhcm5hbCBwbGVhc3VyZQ==")); mu_assert("Encoding without padding", assert_base64_encode("any carnal pleasur", 18, "YW55IGNhcm5hbCBwbGVhc3Vy")); return 0; }
static char* base64_encode_encodes_with_padding() { mu_assert( "Encoding with padding '='", assert_base64_encode( "any carnal pleasure.", "YW55IGNhcm5hbCBwbGVhc3VyZS4=")); mu_assert( "Encoding with padding '=='", assert_base64_encode( "any carnal pleasure", "YW55IGNhcm5hbCBwbGVhc3VyZQ==")); return 0; }
static char* base64_encode_encodes_without_padding() { mu_assert( "Encoding without padding", assert_base64_encode( "any carnal pleasur", "YW55IGNhcm5hbCBwbGVhc3Vy")); return 0; }