62 std::string payload =
"oo";
66 payload[1] = char(0xe8);
67 BOOST_CHECK( close::extract_code(payload,ec) == close::status::normal );
72 payload[1] = char(0xec);
73 BOOST_CHECK( close::extract_code(payload,ec) == 1004 );
74 BOOST_CHECK( ec == error::reserved_close_code );
78 payload[1] = char(0xed);
79 BOOST_CHECK( close::extract_code(payload,ec) == close::status::no_status );
80 BOOST_CHECK( ec == error::invalid_close_code );
84 payload[1] = char(0xb8);
85 BOOST_CHECK( close::extract_code(payload,ec) == 3000 );
107 std::string payload =
"00Foo";
109 BOOST_CHECK( close::extract_reason(payload,ec) ==
"Foo" );
113 BOOST_CHECK( close::extract_reason(payload,ec).empty() );
117 BOOST_CHECK( close::extract_reason(payload,ec).empty() );
121 payload[2] = char(0xFF);
123 close::extract_reason(payload,ec);
124 BOOST_CHECK( ec == error::invalid_utf8 );