MCPcopy Create free account
hub / github.com/boostorg/json / testString

Method testString

test/limits.cpp:156–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154 }
155
156 void
157 testString()
158 {
159 // strings
160 {
161 {
162 string s;
163 BOOST_TEST_THROWS_WITH_LOCATION(
164 (s.resize(s.max_size() + 1)) );
165 }
166
167 {
168 string s;
169 s.resize(100);
170 BOOST_TEST_THROWS_WITH_LOCATION(
171 (s.append(s.max_size() - 1, '*')) );
172 }
173
174 {
175 string s;
176 s.resize(s.max_size() - 5);
177 BOOST_TEST_THROWS_WITH_LOCATION(
178 (s.replace(0, 1, s.subview(0, 10))) );
179 }
180
181 {
182 string s;
183 s.resize(s.max_size() - 5);
184 BOOST_TEST_THROWS_WITH_LOCATION(
185 (s.replace(0, 1, 10, 'a')) );
186 }
187
188 {
189 string s;
190 s.resize(s.max_size() - 5);
191 BOOST_TEST_THROWS_WITH_LOCATION(
192 (s.insert(0, s.subview(0, 10))) );
193 }
194
195 #if 0
196 {
197 // VFALCO tsan doesn't like this
198 string s;
199 try
200 {
201 s.resize(s.max_size() - 1);
202 }
203 catch(std::exception const&)
204 {
205 }
206 }
207 #endif
208 }
209
210 // string in parser
211 {
212 stream_parser p;
213 std::string const big(

Callers

nothing calls this directly

Calls 5

resizeMethod · 0.80
subviewMethod · 0.80
max_sizeMethod · 0.45
appendMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected