| 123456789101112131415161718192021222324 |
- #include "base64.h"
- #ifdef TEST_WITH_CTEST
- int test_base64(int argc, char* argv[])
- {
- return 0;
- }
- #else
- #include <gtest/gtest.h>
- TEST(LibToolkitTest, Base64Test)
- {
- char sz_encode[128] = { '\0' };
- char sz_decode[128] = { '\0' };
- char sz_plain[] = "hellohellohello";
- EXPECT_TRUE(base64_encode(sz_encode, sz_plain, strlen(sz_plain)) > 0);
- EXPECT_TRUE(base64_decode(sz_decode, sz_encode) > 0);
- EXPECT_STREQ(sz_decode, sz_plain);
- }
- #endif
|