mirror of
https://github.com/falk-werner/webfuse
synced 2024-10-27 20:34:10 +00:00
22 lines
522 B
C++
22 lines
522 B
C++
|
#include <gtest/gtest.h>
|
||
|
#include <cstring>
|
||
|
#include "webfuse/core/message.h"
|
||
|
|
||
|
TEST(wf_message, create)
|
||
|
{
|
||
|
json_t * value = json_object();
|
||
|
|
||
|
struct wf_message * message = wf_message_create(value);
|
||
|
ASSERT_NE(nullptr, message);
|
||
|
ASSERT_EQ(2, message->length);
|
||
|
ASSERT_TRUE(0 == strncmp("{}", message->data, 2));
|
||
|
|
||
|
wf_message_dispose(message);
|
||
|
json_decref(value);
|
||
|
}
|
||
|
|
||
|
TEST(wf_message, fail_to_create)
|
||
|
{
|
||
|
struct wf_message * message = wf_message_create(nullptr);
|
||
|
ASSERT_EQ(nullptr, message);
|
||
|
}
|