60 {
61 lib::error_code ec;
62 std::string payload = "oo";
63
64
65 payload[0] = 0x03;
66 payload[1] = char(0xe8);
67 BOOST_CHECK( close::extract_code(payload,ec) == close::status::normal );
68 BOOST_CHECK( !ec );
69
70
71 payload[0] = 0x03;
72 payload[1] = char(0xec);
73 BOOST_CHECK( close::extract_code(payload,ec) == 1004 );
74 BOOST_CHECK( ec == error::reserved_close_code );
75
76
77 payload[0] = 0x03;
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 );
81
82
83 payload[0] = 0x0b;
84 payload[1] = char(0xb8);
85 BOOST_CHECK( close::extract_code(payload,ec) == 3000 );
86 BOOST_CHECK( !ec );
87}