mirror of
https://github.com/boostorg/json.git
synced 2026-01-19 16:22:20 +00:00
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
//
|
|
// Copyright (c) 2018-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
|
|
//
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
//
|
|
// Official repository: https://github.com/vinniefalco/BeastLounge
|
|
//
|
|
|
|
// 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 = make_storage<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(test_failure const&)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
void
|
|
run() override
|
|
{
|
|
#if !defined(BOOST_MSVC) || _ITERATOR_DEBUG_LEVEL == 0
|
|
testExceptions();
|
|
#endif
|
|
pass();
|
|
}
|
|
};
|
|
|
|
BEAST_DEFINE_TESTSUITE(boost,json,string);
|
|
|
|
} // json
|
|
} // boost
|