Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
message.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <string>
#include <websocketpp/message_buffer/message.hpp>
Include dependency graph for message.cpp:

Go to the source code of this file.

Classes

struct  stub< con_msg_manager >
 

Macros

#define BOOST_TEST_MODULE   message
 

Functions

 BOOST_AUTO_TEST_CASE (basic_size_check)
 
 BOOST_AUTO_TEST_CASE (recycle)
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   message

Definition at line 28 of file message.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( basic_size_check )

Definition at line 51 of file message.cpp.

51 {
53 typedef stub<message_type> stub_type;
54
55 stub_type::ptr s(new stub_type());
56 message_type::ptr msg(new message_type(s,websocketpp::frame::opcode::TEXT,500));
57
58 BOOST_CHECK(msg->get_payload().capacity() >= 500);
59}
Represents a buffer for a single WebSocket message.
Definition pool.hpp:101
Definition alloc.cpp:37
char * s

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( recycle )

Definition at line 61 of file message.cpp.

61 {
63 typedef stub<message_type> stub_type;
64
65 stub_type::ptr s(new stub_type());
66 message_type::ptr msg(new message_type(s,websocketpp::frame::opcode::TEXT,500));
67
68 BOOST_CHECK(s->recycled == false);
69 BOOST_CHECK(msg->recycle() == false);
70 BOOST_CHECK(s->recycled == true);
71}