| 63 | } |
| 64 | |
| 65 | void |
| 66 | testOptions() |
| 67 | { |
| 68 | { |
| 69 | std::seed_seq ss{42}; |
| 70 | seed_prng(ss); |
| 71 | } |
| 72 | |
| 73 | stream<test::stream> ws{ioc_}; |
| 74 | ws.auto_fragment(true); |
| 75 | ws.write_buffer_bytes(2048); |
| 76 | ws.binary(false); |
| 77 | ws.read_message_max(1 * 1024 * 1024); |
| 78 | try |
| 79 | { |
| 80 | ws.write_buffer_bytes(7); |
| 81 | fail(); |
| 82 | } |
| 83 | catch(std::exception const&) |
| 84 | { |
| 85 | pass(); |
| 86 | } |
| 87 | |
| 88 | ws.secure_prng(true); |
| 89 | ws.secure_prng(false); |
| 90 | |
| 91 | auto const bad = |
| 92 | [&](permessage_deflate const& pmd) |
| 93 | { |
| 94 | stream<test::stream> ws{ioc_}; |
| 95 | try |
| 96 | { |
| 97 | ws.set_option(pmd); |
| 98 | fail("", __FILE__, __LINE__); |
| 99 | } |
| 100 | catch(std::exception const&) |
| 101 | { |
| 102 | pass(); |
| 103 | } |
| 104 | }; |
| 105 | |
| 106 | { |
| 107 | permessage_deflate pmd; |
| 108 | pmd.server_max_window_bits = 16; |
| 109 | bad(pmd); |
| 110 | } |
| 111 | |
| 112 | { |
| 113 | permessage_deflate pmd; |
| 114 | pmd.server_max_window_bits = 8; |
| 115 | bad(pmd); |
| 116 | } |
| 117 | |
| 118 | { |
| 119 | permessage_deflate pmd; |
| 120 | pmd.client_max_window_bits = 16; |
| 121 | bad(pmd); |
| 122 | } |
nothing calls this directly
no test coverage detected