mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-20 05:34:12 -04:00
tests/utils: Add tests for base64Encode
Test vectors according to RFC4648
This commit is contained in:
1 parent
bbc4afcf1b
commit
46a4b615c8
1 file changed
+10
@@ -144,3 +144,13 @@ TEST_CASE("join") {
|
||||
REQUIRE(join({"a", "b"}, ",") == "a,b");
|
||||
REQUIRE(join({"a", "b"}, "") == "ab");
|
||||
}
|
||||
|
||||
TEST_CASE("base64Encode") {
|
||||
REQUIRE(base64Encode("") == "");
|
||||
REQUIRE(base64Encode("f") == "Zg==");
|
||||
REQUIRE(base64Encode("fo") == "Zm8=");
|
||||
REQUIRE(base64Encode("foo") == "Zm9v");
|
||||
REQUIRE(base64Encode("foob") == "Zm9vYg==");
|
||||
REQUIRE(base64Encode("fooba") == "Zm9vYmE=");
|
||||
REQUIRE(base64Encode("foobar") == "Zm9vYmFy");
|
||||
}
|
||||
Reference in new issue
Block a user