test_load \
test_simple \
test_number \
- test_object
+ test_object \
+ test_cpp
test_array_SOURCES = test_array.c util.h
test_copy_SOURCES = test_copy.c util.h
test_simple_SOURCES = test_simple.c util.h
test_number_SOURCES = test_number.c util.h
test_object_SOURCES = test_object.c util.h
+test_cpp_SOURCES = test_cpp.cpp
AM_CPPFLAGS = -I$(top_srcdir)/src
AM_CFLAGS = -Wall -Werror
#define ASSERT_TRUE(p, m) ASSERT_OP(p, true, ==, m)
#define ASSERT_FALSE(p, m) ASSERT_OP(p, true, !=, m)
-int json_cpp_tests() {
- json::Value e1(json::load_file("test.json"));
+int main() {
+ json::Value e1(json::load_file("suites/api/test.json"));
json::Value e2(e1);
json::Value e3;
json::Value e4(json::load_string("{\"foo\": true, \"bar\": \"test\"}"));
char* out_cstr = e12.save_string(0);
std::string out(out_cstr);
free(out_cstr);
- ASSERT_EQ(out, "{\"bar\": 3,\"foo\": \"test\"}\n", "object did not serialize as expected");
+ ASSERT_EQ(out, "{\"bar\": 3, \"foo\": \"test\"}", "object did not serialize as expected");
std::istringstream instr(out);
instr >> e12;
std::ostringstream outstr;
outstr << e12;
- ASSERT_EQ(instr.str(), "{\"bar\": 3,\"foo\": \"test\"}\n", "object did not serialize as expected");
+ ASSERT_EQ(instr.str(), "{\"bar\": 3, \"foo\": \"test\"}", "object did not serialize as expected");
const json::Value e13(e12);
ASSERT_EQ(e13["bar"].as_integer(), 3, "e13.bar has incorrect value after copy");