blob: 0f4075678e94a631db9245b0fa91dfaa31022573 [file] [log] [blame]
#include "utility.h"
#include "gmock/gmock.h"
TEST(Utility, Base64DecodeAuthString)
{
std::string authString("dXNlcm40bWU6cGFzc3cwcmQ=");
std::string result;
EXPECT_TRUE(crow::utility::base64Decode(authString, result));
EXPECT_EQ(result, "usern4me:passw0rd");
}
TEST(Utility, Base64DecodeNonAscii)
{
std::string junkString("\xff\xee\xdd\xcc\x01\x11\x22\x33");
std::string result;
EXPECT_FALSE(crow::utility::base64Decode(junkString, result));
}