1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/test/webfuse_provider/util/test_message.cc

22 lines
538 B
C++
Raw Normal View History

#include <gtest/gtest.h>
#include <cstring>
2020-06-16 21:39:45 +00:00
#include "webfuse_provider/impl/message.h"
TEST(wfp_message, create)
{
json_t * value = json_object();
struct wfp_message * message = wfp_message_create(value);
ASSERT_NE(nullptr, message);
ASSERT_EQ(2, message->length);
ASSERT_TRUE(0 == strncmp("{}", message->data, 2));
wfp_message_dispose(message);
json_decref(value);
}
TEST(wfp_message, fail_to_create)
{
struct wfp_message * message = wfp_message_create(nullptr);
ASSERT_EQ(nullptr, message);
}