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:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user