Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
json_test_util Namespace Reference

Functions

const std::string repeat_chars (repeat_char_num, 'a')
 

Variables

constexpr size_t exception_limit_size = 250
 
const json::yield_function_t yield_deadline_exception_at_start
 
const json::yield_function_t yield_deadline_exception_in_mid
 
const json::yield_function_t yield_length_exception
 
const json::yield_function_t yield_no_limitation
 
const auto time_except_verf_func
 
const auto length_limit_except_verf_func
 
constexpr size_t repeat_char_num = 512
 
const string escape_input_str
 

Function Documentation

◆ repeat_chars()

const std::string json_test_util::repeat_chars ( repeat_char_num ,
'a'  )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ escape_input_str

const string json_test_util::escape_input_str
Initial value:
= "\\b\\f\\n\\r\\t-\\-\\\\-\\x0\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\x0f"
"\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f-" + repeat_chars
const std::string repeat_chars(repeat_char_num, 'a')

Definition at line 42 of file test_json.cpp.

◆ exception_limit_size

size_t json_test_util::exception_limit_size = 250
constexpr

Definition at line 12 of file test_json.cpp.

◆ length_limit_except_verf_func

const auto json_test_util::length_limit_except_verf_func
Initial value:
= [](const fc::assert_exception& ex) -> bool {
return (static_cast<int>(ex.code_value) == static_cast<int>(fc::exception_code::assert_exception_code));
}
@ assert_exception_code
Definition exception.hpp:30

Definition at line 36 of file test_json.cpp.

36 {
37 return (static_cast<int>(ex.code_value) == static_cast<int>(fc::exception_code::assert_exception_code));
38 };

◆ repeat_char_num

size_t json_test_util::repeat_char_num = 512
constexpr

Definition at line 40 of file test_json.cpp.

◆ time_except_verf_func

const auto json_test_util::time_except_verf_func
Initial value:
= [](const fc::timeout_exception& ex) -> bool {
return (static_cast<int>(ex.code_value) == static_cast<int>(fc::exception_code::timeout_exception_code));
}
@ timeout_exception_code
timeout exceptions
Definition exception.hpp:22

Definition at line 32 of file test_json.cpp.

32 {
33 return (static_cast<int>(ex.code_value) == static_cast<int>(fc::exception_code::timeout_exception_code));
34 };

◆ yield_deadline_exception_at_start

const json::yield_function_t json_test_util::yield_deadline_exception_at_start
Initial value:
= [](size_t s) {
}
static time_point now()
Definition time.cpp:14
#define FC_CHECK_DEADLINE(DEADLINE,...)
constexpr microseconds milliseconds(int64_t s)
Definition time.hpp:33
char * s

Definition at line 14 of file test_json.cpp.

◆ yield_deadline_exception_in_mid

const json::yield_function_t json_test_util::yield_deadline_exception_in_mid
Initial value:
= [](size_t s) {
if (s >= exception_limit_size) {
throw fc::timeout_exception(fc::exception_code::timeout_exception_code, "timeout_exception", "execution timed out" );
}
}

Definition at line 18 of file test_json.cpp.

18 {
19 if (s >= exception_limit_size) {
20 throw fc::timeout_exception(fc::exception_code::timeout_exception_code, "timeout_exception", "execution timed out" );
21 }
22 };

◆ yield_length_exception

const json::yield_function_t json_test_util::yield_length_exception
Initial value:
= [](size_t s) {
FC_ASSERT( s <= exception_limit_size );
}
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.

Definition at line 24 of file test_json.cpp.

24 {
25 FC_ASSERT( s <= exception_limit_size );
26 };

◆ yield_no_limitation

const json::yield_function_t json_test_util::yield_no_limitation
Initial value:
= [](size_t s) {
}

Definition at line 28 of file test_json.cpp.

28 {
29 // no limitation
30 };