diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2015-05-08 17:30:22 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2015-05-08 17:30:22 -0700 |
commit | ccc0fd0dbbcebb43f4d85d7df1439e1fc7993bf8 (patch) | |
tree | da3cbc97eed1eb70af5e0f3a687ff37ad239d119 /tests/json | |
parent | bd7ea8c6f1854aa37b7792c6f23334ffc0fd94ff (diff) | |
parent | 838009ba2b8ea1e99061c66e0fbd9cb53a96ec20 (diff) |
Merge pull request #18 from haberman/google-internal
Sync from Google-internal development.
Diffstat (limited to 'tests/json')
-rw-r--r-- | tests/json/test_json.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/json/test_json.cc b/tests/json/test_json.cc index 828e603..cb60bad 100644 --- a/tests/json/test_json.cc +++ b/tests/json/test_json.cc @@ -292,14 +292,14 @@ void test_json_roundtrip_message(const char* json_src, const upb::Handlers* serialize_handlers, int seam) { upb::Status st; - upb::json::Parser parser(&st); - upb::json::Printer printer(serialize_handlers); + upb::Environment env; + env.ReportErrorsTo(&st); StringSink data_sink; + upb::json::Printer* printer = + upb::json::Printer::Create(&env, serialize_handlers, data_sink.Sink()); + upb::json::Parser* parser = upb::json::Parser::Create(&env, printer->input()); - parser.ResetOutput(printer.input()); - printer.ResetOutput(data_sink.Sink()); - - upb::BytesSink* input = parser.input(); + upb::BytesSink* input = parser->input(); void *sub; size_t len = strlen(json_src); size_t ofs = 0; |