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

storage_ptr is a shared pointer

This commit is contained in:
Vinnie Falco
2019-09-28 04:55:47 -07:00
parent 77bed50797
commit 27fba5aaf2
13 changed files with 109 additions and 374 deletions

View File

@@ -10,17 +10,47 @@
// Test that header file is self-contained.
#include <boost/json/string.hpp>
#include <boost/config.hpp>
#include <boost/beast/_experimental/unit_test/suite.hpp>
#include "test_storage.hpp"
namespace boost {
namespace json {
class string_test : public beast::unit_test::suite
{
public:
void
testExceptions()
{
string s1 = "Hello, world!";
auto sp =
std::make_shared<fail_storage>();
string s2;
while(sp->fail < 200)
{
try
{
auto s = string(
string::allocator_type{sp});
//obj.emplace("a", 2);
//obj = obj0;
//obj1 = obj;
break;
}
catch(std::bad_alloc const&)
{
}
}
}
void
run() override
{
#if !defined(BOOST_MSVC) || _ITERATOR_DEBUG_LEVEL == 0
testExceptions();
#endif
pass();
}
};