mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-07 15:20:31 +00:00
25 lines
671 B
C++
25 lines
671 B
C++
#include <gtest/gtest.h>
|
|
#include <service/address.hpp>
|
|
|
|
struct ServiceAddressTest : public ::testing::Test
|
|
{
|
|
const std::string snode =
|
|
"8zfiwpgonsu5zpddpxwdurxyb19x6r96xy4qbikff99jwsziws9y.snode";
|
|
const std::string loki =
|
|
"7okic5x5do3uh3usttnqz9ek3uuoemdrwzto1hciwim9f947or6y.loki";
|
|
};
|
|
|
|
TEST_F(ServiceAddressTest, TestParseSNodeNotLoki)
|
|
{
|
|
llarp::service::Address addr;
|
|
ASSERT_TRUE(addr.FromString(snode, ".snode"));
|
|
ASSERT_FALSE(addr.FromString(snode, ".loki"));
|
|
}
|
|
|
|
TEST_F(ServiceAddressTest, TestParseLokiNotSNode)
|
|
{
|
|
llarp::service::Address addr;
|
|
ASSERT_FALSE(addr.FromString(loki, ".snode"));
|
|
ASSERT_TRUE(addr.FromString(loki, ".loki"));
|
|
}
|