1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/test/util/test_llarp_util_encode.cpp
2019-04-26 00:21:19 +01:00

22 lines
425 B
C++

#include <gtest/gtest.h>
#include <util/aligned.hpp>
#include <util/encode.hpp>
struct Base32Test : public ::testing::Test
{
Base32Test()
{
}
};
TEST_F(Base32Test, Serialize)
{
llarp::AlignedBuffer< 32 > addr, otherAddr;
addr.Randomize();
char tmp[64] = {0};
std::string encoded = llarp::Base32Encode(addr, tmp);
ASSERT_TRUE(llarp::Base32Decode(tmp, otherAddr));
ASSERT_TRUE(otherAddr == addr);
}