mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
25 lines
449 B
C++
25 lines
449 B
C++
#include <gtest/gtest.h>
|
|
#include <llarp/api/messages.hpp>
|
|
|
|
class APITest : public ::testing::Test
|
|
{
|
|
public:
|
|
llarp_crypto crypto;
|
|
std::string apiPassword = "password";
|
|
APITest()
|
|
{
|
|
llarp_crypto_libsodium_init(&crypto);
|
|
}
|
|
|
|
~APITest()
|
|
{
|
|
}
|
|
};
|
|
|
|
TEST_F(APITest, TestMessageWellFormed)
|
|
{
|
|
llarp::api::AckMessage msg;
|
|
msg.seqno = 1;
|
|
msg.CalculateHash(&crypto, apiPassword);
|
|
ASSERT_TRUE(msg.IsWellFormed(&crypto, apiPassword));
|
|
}; |