| 6 | using namespace Star; |
| 7 | |
| 8 | TEST(EncodeTest, Base64) { |
| 9 | char const* data = |
| 10 | "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust " |
| 11 | "of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, " |
| 12 | "exceeds the short vehemence of any carnal pleasure."; |
| 13 | ByteArray testSource = ByteArray(data, strlen(data)); |
| 14 | String testEncoded = |
| 15 | "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhl" |
| 16 | "ciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29u" |
| 17 | "dGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55" |
| 18 | "IGNhcm5hbCBwbGVhc3VyZS4="; |
| 19 | |
| 20 | String encoded = base64Encode(testSource); |
| 21 | ByteArray decoded = base64Decode(encoded); |
| 22 | |
| 23 | EXPECT_EQ(encoded, testEncoded); |
| 24 | EXPECT_EQ(decoded, testSource); |
| 25 | } |
| 26 | |
| 27 | TEST(EncodeTest, SHA256) { |
| 28 | char const* data = |
nothing calls this directly
no test coverage detected