17#define BOOST_CHECK(expr) assert(expr)
18#define BOOST_CHECK_EQUAL(v1, v2) assert((v1) == (v2))
19#define BOOST_CHECK_THROW(stmt, excMatch) \
23 assert(0 && "No exception caught"); \
24 } catch (excMatch & e) { \
26 assert(0 && "Wrong exception caught"); \
29#define BOOST_CHECK_NO_THROW(stmt) \
74 std::string vs(
"yawn");
79 const char *vcs =
"zappa";
134 std::vector<UniValue> vals = v5.
getValues();
163 std::string_view sv{
"ab\0c", 4};
178 v.
setInt(int64_t{-1023LL});
182 v.
setInt(uint64_t{1023ULL});
215 std::string vStr(
"zippy");
218 const char *s =
"pippy";
221 std::vector<UniValue> vec;
269 std::string strKey, strVal;
280 obj.
pushKV(strKey, strVal);
283 const char *cVal =
"Smith";
287 obj.
pushKV(strKey, int64_t{25});
290 obj.
pushKV(strKey, uint64_t{3600});
293 obj.
pushKV(strKey,
int{12});
295 strKey =
"temperature";
296 obj.
pushKV(strKey,
double{90.012});
302 obj.
pushKV(strKey,
false);
305 obj2.
pushKV(
"cat1", 9000);
306 obj2.
pushKV(
"cat2", 12345);
341 std::map<std::string, UniValue::VType> objTypes;
375 obj.
pushKV(
"name",
"foo bar");
377 std::map<std::string, UniValue> kv;
383static const char *
json1 =
"[1.10000000,{\"key1\":\"str\\u0000\",\"key2\":800,"
384 "\"key3\":{\"name\":\"martian http://test.com\"}}]";
390 std::string strJson1(
json1);
403 std::string correctValue(
"str");
404 correctValue.push_back(
'\0');
456int main(
int argc,
char *argv[]) {
void push_back(UniValue val)
const std::string & get_str() const
bool checkObject(const std::map< std::string, UniValue::VType > &memberTypes) const
enum VType getType() const
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
const std::string & getValStr() const
const UniValue & get_obj() const
const std::vector< UniValue > & getValues() const
void pushKVs(UniValue obj)
const std::vector< std::string > & getKeys() const
void setInt(uint64_t val)
void pushKVEnd(std::string key, UniValue val)
bool read(std::string_view raw)
const UniValue & get_array() const
bool exists(const std::string &key) const
void setFloat(double val)
void setStr(std::string str)
void pushKV(std::string key, UniValue val)
void setNumStr(std::string str)
void getObjMap(std::map< std::string, UniValue > &kv) const
void push_backV(const std::vector< UniValue > &vec)
int main(int argc, char *argv[])
#define BOOST_CHECK_THROW(stmt, excMatch)
static const char * json1
void univalue_readwrite()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK_NO_THROW(stmt)
void univalue_typecheck()
#define BOOST_CHECK(expr)
void univalue_constructor()
void univalue_push_throw()