124{
125 {
126 {
128 std::string deadline_exception_at_start_str;
129 BOOST_CHECK_EXCEPTION(deadline_exception_at_start_str = json::to_pretty_string( v,
fc::time_point::min(), json::output_formatting::stringify_large_ints_and_doubles, json::max_length_limit),
130 fc::timeout_exception,
132 BOOST_CHECK_EQUAL(deadline_exception_at_start_str.empty(), true);
133 }
134 {
135 constexpr size_t max_len = 10;
137 std::string deadline_exception_at_start_str;
138 BOOST_CHECK_EQUAL(deadline_exception_at_start_str.empty(), true);
139 BOOST_CHECK_EXCEPTION(deadline_exception_at_start_str = json::to_pretty_string( v,
fc::time_point::maximum(), json::output_formatting::stringify_large_ints_and_doubles, max_len),
140 fc::assert_exception,
142 BOOST_CHECK_EQUAL(deadline_exception_at_start_str.empty(), true);
143 }
144 {
146 std::string length_exception_in_mid_str;
147 BOOST_CHECK_NO_THROW(length_exception_in_mid_str = json::to_pretty_string( v,
fc::time_point::maximum(), json::output_formatting::stringify_large_ints_and_doubles, json::max_length_limit));
149 }
150 }
151 {
154 {
155 std::string deadline_exception_at_start_str;
157 fc::timeout_exception,
159 BOOST_CHECK_EQUAL(deadline_exception_at_start_str.empty(), true);
160 }
161 {
162 std::string deadline_exception_in_mid_str;
164 fc::timeout_exception,
166 BOOST_CHECK_EQUAL(deadline_exception_in_mid_str.empty(), true);
167 }
168 {
169 std::string length_exception_in_mid_str;
171 fc::assert_exception,
173 BOOST_CHECK_EQUAL(length_exception_in_mid_str.empty(), true);
174 }
175 {
176 std::string no_exception_str;
179 }
180 }
181 {
185 BOOST_CHECK_EQUAL(std::to_string(id), id_ret_1);
186
187
188 std::string id_ret_2;
189 BOOST_REQUIRE_THROW(id_ret_2 = json::to_pretty_string(
id,
fc::time_point::maximum(), json::output_formatting::stringify_large_ints_and_doubles,
len), fc::assert_exception);
190 BOOST_CHECK_EQUAL(id_ret_2.empty(), true);
191
192
193 std::string id_ret_3;
195 BOOST_CHECK_EQUAL(id_ret_3.empty(), true);
196 }
197}
static constexpr time_point min()
static constexpr time_point maximum()
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
constexpr microseconds milliseconds(int64_t s)
const std::string repeat_chars(repeat_char_num, 'a')
unsigned __int64 uint64_t