Commit 729941e4 authored by Kenton Varda's avatar Kenton Varda

Fix uninitialized byte arrays in encoding-test.

Initializer lists are temporaries. The code apparently works in debug mode but fails when optimized.
parent 139b3cfb
......@@ -507,16 +507,16 @@ KJ_TEST("base64 url encoding") {
{
// Replaces plusses.
ArrayPtr<const byte> data = { 0b11111011, 0b11101111, 0b10111110 };
const byte data[] = { 0b11111011, 0b11101111, 0b10111110 };
auto encoded = encodeBase64Url(data);
KJ_EXPECT(encoded == "----", encoded, encoded.size());
KJ_EXPECT(encoded == "----", encoded, encoded.size(), data);
}
{
// Replaces slashes.
ArrayPtr<const byte> data = { 0b11111111, 0b11111111, 0b11111111 };
const byte data[] = { 0b11111111, 0b11111111, 0b11111111 };
auto encoded = encodeBase64Url(data);
KJ_EXPECT(encoded == "____", encoded, encoded.size());
KJ_EXPECT(encoded == "____", encoded, encoded.size(), data);
}
}
......
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