Use less c++
As a design, it would be better if we didn't need to have a dependency
on c++ in a c library. Moving things to C will reduce both
dependencies and compile times.
Reduced dependencies makes the library itself easier to use in
more environments.
libmctp Is a library that doesn't take a dependency on gtest for its
tests
libpldm Is an example that does take a dependency on gtest.
Change-Id: If1dc638f87b75b28181a0baf67f5a18d389cff81
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/tests/base64_test.cpp b/tests/base64_test.cpp
index 6040c00..058de81 100644
--- a/tests/base64_test.cpp
+++ b/tests/base64_test.cpp
@@ -9,15 +9,15 @@
std::array<uint8_t, 1> data = { 'f' };
char *encoded = base64_encode(data.data(), data.size(), &encoded_len);
EXPECT_EQ(encoded_len, 4);
- ASSERT_EQ(std::string_view(encoded, encoded_len), "Zg==");
+ ASSERT_TRUE(memcmp(encoded, "Zg==", encoded_len) == 0);
free(encoded);
}
TEST(Base64Decode, Good)
{
int32_t decoded_len = 0;
- std::string_view data{ "Zg==" };
- UINT8 *decoded = base64_decode(data.data(), data.size(), &decoded_len);
+ const char *data{ "Zg==" };
+ UINT8 *decoded = base64_decode(data, strlen(data), &decoded_len);
EXPECT_EQ(decoded_len, 1);
ASSERT_EQ(decoded[0], 'f');
free(decoded);