From b5753e3fae346ede4d1bc193e3c3b8b484267945 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 20 Mar 2021 00:08:20 +0100 Subject: [PATCH] Add some more base64 decoding tests --- test/default/codecs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/default/codecs.c b/test/default/codecs.c index 726c96bc..3c98d739 100644 --- a/test/default/codecs.c +++ b/test/default/codecs.c @@ -200,6 +200,12 @@ main(void) assert(sodium_base642bin(buf1, sizeof buf1, "O", (size_t) 1U, NULL, NULL, NULL, sodium_base64_VARIANT_ORIGINAL_NO_PADDING) == -1); + assert(sodium_base642bin(buf1, sizeof buf1, "", (size_t) 0U, NULL, NULL, NULL, + sodium_base64_VARIANT_ORIGINAL) == 0); + assert(sodium_base642bin(buf1, sizeof buf1, "A", (size_t) 1U, NULL, NULL, NULL, + sodium_base64_VARIANT_ORIGINAL) == -1); + assert(sodium_base642bin(buf1, sizeof buf1, "AA", (size_t) 2U, NULL, NULL, NULL, + sodium_base64_VARIANT_ORIGINAL) == -1); assert(sodium_base642bin(buf1, sizeof buf1, "kaw", (size_t) 3U, NULL, NULL, NULL, sodium_base64_VARIANT_ORIGINAL) == -1); assert(sodium_base642bin(buf1, sizeof buf1, "kQ*", (size_t) 3U, "@", NULL, NULL,