blob: a81adf51988f3bff8649c35d0b69a48127d4bd26 [file] [log] [blame]
Ed Tanous04e438c2020-10-03 08:06:26 -07001#include "utility.hpp"
Jonathan Doman5beaf842020-08-14 11:23:33 -07002
3#include "gmock/gmock.h"
4
5TEST(Utility, Base64DecodeAuthString)
6{
7 std::string authString("dXNlcm40bWU6cGFzc3cwcmQ=");
8 std::string result;
9 EXPECT_TRUE(crow::utility::base64Decode(authString, result));
10 EXPECT_EQ(result, "usern4me:passw0rd");
11}
12
13TEST(Utility, Base64DecodeNonAscii)
14{
15 std::string junkString("\xff\xee\xdd\xcc\x01\x11\x22\x33");
16 std::string result;
17 EXPECT_FALSE(crow::utility::base64Decode(junkString, result));
18}