17#define BOOST_CHECK(expr) assert(expr)
18#define BOOST_CHECK_EQUAL(v1, v2) assert((v1) == (v2))
19#define BOOST_CHECK_THROW(stmt, excMatch) { \
22 assert(0 && "No exception caught"); \
23 } catch (excMatch&) { \
25 assert(0 && "Wrong exception caught"); \
28#define BOOST_CHECK_NO_THROW(stmt) { \
73 std::string vs(
"yawn");
78 const char *vcs =
"zappa";
135 std::vector<UniValue> vals = v5.
getValues();
165 std::string_view sv{
"ab\0c", 4};
180 v.
setInt(int64_t{-1023LL});
184 v.
setInt(uint64_t{1023ULL});
217 std::string vStr(
"zippy");
220 const char *
s =
"pippy";
223 std::vector<UniValue> vec;
272 std::string strKey, strVal;
281 obj.
pushKV(strKey, strVal);
284 const char* cVal =
"Smith";
288 obj.
pushKV(strKey, int64_t{25});
291 obj.
pushKV(strKey, uint64_t{3600});
294 obj.
pushKV(strKey,
int{12});
296 strKey =
"temperature";
297 obj.
pushKV(strKey,
double{90.012});
303 obj.
pushKV(strKey,
false);
306 obj2.
pushKV(
"cat1", 9000);
307 obj2.
pushKV(
"cat2", 12345);
342 std::map<std::string, UniValue::VType> objTypes;
376 obj.
pushKV(
"name",
"foo bar");
378 std::map<std::string,UniValue> kv;
386"[1.10000000,{\"key1\":\"str\\u0000\",\"key2\":800,\"key3\":{\"name\":\"martian http://test.com\"}}]";
393 std::string strJson1(
json1);
406 std::string correctValue(
"str");
407 correctValue.push_back(
'\0');
458int 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()