16 #define BOOST_CHECK(expr) assert(expr) 17 #define BOOST_CHECK_EQUAL(v1, v2) assert((v1) == (v2)) 18 #define BOOST_CHECK_THROW(stmt, excMatch) { \ 21 assert(0 && "No exception caught"); \ 22 } catch (excMatch & e) { \ 24 assert(0 && "Wrong exception caught"); \ 27 #define BOOST_CHECK_NO_THROW(stmt) { \ 72 std::string vs(
"yawn");
77 const char *vcs =
"zappa";
134 std::vector<UniValue> vals = v5.getValues();
171 v.
setInt(int64_t{-1023LL});
175 v.
setInt(uint64_t{1023ULL});
208 std::string vStr(
"zippy");
211 const char *s =
"pippy";
214 std::vector<UniValue> vec;
263 std::string strKey, strVal;
272 obj.
pushKV(strKey, strVal);
275 const char* cVal =
"Smith";
279 obj.
pushKV(strKey, int64_t{25});
282 obj.
pushKV(strKey, uint64_t{3600});
285 obj.
pushKV(strKey,
int{12});
287 strKey =
"temperature";
288 obj.
pushKV(strKey,
double{90.012});
294 obj.
pushKV(strKey,
false);
297 obj2.
pushKV(
"cat1", 9000);
298 obj2.
pushKV(
"cat2", 12345);
333 std::map<std::string, UniValue::VType> objTypes;
367 obj.
pushKV(
"name",
"foo bar");
369 std::map<std::string,UniValue> kv;
377 "[1.10000000,{\"key1\":\"str\\u0000\",\"key2\":800,\"key3\":{\"name\":\"martian http://test.com\"}}]";
384 std::string strJson1(
json1);
397 std::string correctValue(
"str");
398 correctValue.push_back(
'\0');
422 int main(
int argc,
char* argv[])
void setStr(const std::string &val)
void push_back(UniValue val)
const std::vector< UniValue > & getValues() const
void univalue_readwrite()
void setNumStr(const std::string &val)
#define BOOST_CHECK_THROW(stmt, excMatch)
int main(int argc, char *argv[])
bool read(const char *raw, size_t len)
void pushKVs(UniValue obj)
const std::string & get_str() const
enum VType getType() const
const UniValue & get_array() const
const std::vector< std::string > & getKeys() const
const std::string & getValStr() const
static const char * json1
void getObjMap(std::map< std::string, UniValue > &kv) const
bool exists(const std::string &key) const
void univalue_constructor()
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
void push_backV(const std::vector< UniValue > &vec)
bool checkObject(const std::map< std::string, UniValue::VType > &memberTypes) const
#define BOOST_CHECK_EQUAL(v1, v2)
void univalue_typecheck()
void pushKV(std::string key, UniValue val)
const UniValue & get_obj() const
#define BOOST_CHECK_NO_THROW(stmt)
void univalue_push_throw()
void setFloat(double val)
void setInt(uint64_t val)
void __pushKV(std::string key, UniValue val)
#define BOOST_CHECK(expr)