2
0
mirror of https://github.com/boostorg/json.git synced 2026-01-19 04:12:14 +00:00

limits tests

This commit is contained in:
Vinnie Falco
2019-11-11 20:40:31 -08:00
parent 68f3df0403
commit 9da2877b28
24 changed files with 403 additions and 337 deletions

View File

@@ -2632,44 +2632,6 @@ public:
BEAST_EXPECT(ss.str() == s);
}
void
testImpl()
{
// exceed max size
#ifndef BOOST_JSON_NO_MAX_STRING_SIZE
{
{
string s;
BEAST_THROWS(
(s.resize(s.max_size() + 1)),
std::length_error);
}
{
string s;
s.resize(100);
BEAST_THROWS(
(s.append(s.max_size() - 1, '*')),
std::length_error);
}
#if 0
{
// VFALCO tsan doesn't like this
string s;
try
{
s.resize(s.max_size() - 1);
}
catch(std::exception const&)
{
}
}
#endif
}
#endif
}
void
run() override
{
@@ -2702,8 +2664,6 @@ public:
testFindNotLastOf(); //
testNonMembers();
testImpl();
}
};