Lolly 1.4.28
Loading...
Searching...
No Matches
Functions
base64_test.cpp File Reference
#include "a_lolly_test.hpp"
#include "lolly/data/base64.hpp"
Include dependency graph for base64_test.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("encode base64")
 
 TEST_CASE ("decode base64")
 

Detailed Description

Unitests for base64

Author
charonxin
Date
2023

Definition in file base64_test.cpp.

Function Documentation

◆ TEST_CASE() [1/2]

TEST_CASE ( "encode base64" )

Definition at line 13 of file base64_test.cpp.

13 {
14 CHECK_EQ (encode_base64 ("") == "", true);
15 CHECK_EQ (encode_base64 ("f") == "Zg==", true);
16 CHECK_EQ (encode_base64 ("fo") == "Zm8=", true);
17 CHECK_EQ (encode_base64 ("foo") == "Zm9v", true);
18 CHECK_EQ (encode_base64 ("foob") == "Zm9vYg==", true);
19 CHECK_EQ (encode_base64 ("fooba") == "Zm9vYmE=", true);
20 CHECK_EQ (encode_base64 ("foobar") == "Zm9vYmFy", true);
21 CHECK_EQ (decode_base64 ("Zg==") == "f", true);
22 CHECK_EQ (decode_base64 ("Zm8=") == "fo", true);
23 CHECK_EQ (decode_base64 ("Zm9v") == "foo", true);
24 CHECK_EQ (decode_base64 ("Zm9vYg==") == "foob", true);
25 CHECK_EQ (decode_base64 ("Zm9vYmE=") == "fooba", true);
26 CHECK_EQ (decode_base64 ("Zm9vYmFy") == "foobar", true);
27}
The list class represents a linked list.
Definition list.hpp:48

◆ TEST_CASE() [2/2]

TEST_CASE ( "decode base64" )

Definition at line 29 of file base64_test.cpp.

29 {
30 CHECK_EQ (decode_base64 ("") == "", true);
31 CHECK_EQ (decode_base64 ("Zg==") == "f", true);
32 CHECK_EQ (decode_base64 ("Zm8=") == "fo", true);
33 CHECK_EQ (decode_base64 ("Zm9v") == "foo", true);
34 CHECK_EQ (decode_base64 ("Zm9vYg==") == "foob", true);
35 CHECK_EQ (decode_base64 ("Zm9vYmE=") == "fooba", true);
36 CHECK_EQ (decode_base64 ("Zm9vYmFy") == "foobar", true);
37}