Commit 23e3c11d authored by Niels Möller's avatar Niels Möller
Browse files

(test_main): Fixed overlap test to not

change the base64 before decoding. Updated to new base64
conventions.

Rev: src/nettle/testsuite/base64-test.c:1.4
parent da0c74b6
......@@ -32,16 +32,19 @@ test_main(void)
/* Test overlapping areas */
uint8_t buffer[] = "Helloxxxx";
struct base64_decode_ctx ctx;
unsigned dst_length;
ASSERT(BASE64_ENCODE_RAW_LENGTH(5) == 8);
base64_encode_raw(buffer, 5, buffer);
ASSERT(MEMEQ(9, buffer, "SGVsbG8=x"));
buffer[6] = '=';
base64_decode_init(&ctx);
ASSERT(4 == base64_decode_update(&ctx, buffer, 8, buffer));
ASSERT(MEMEQ(9, buffer, "HellbG==x"));
}
dst_length = 8;
ASSERT(base64_decode_update(&ctx, &dst_length, buffer, 8, buffer));
ASSERT(dst_length == 5);
ASSERT(MEMEQ(9, buffer, "HelloG8=x"));
}
SUCCESS();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment