Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(998)

Unified Diff: runtime/vm/json_test.cc

Issue 19870006: Support stacktrace and objecthistogram service commands (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/json_test.cc
diff --git a/runtime/vm/json_test.cc b/runtime/vm/json_test.cc
index 8f3e40eb5cea58815318f6e136a9eef2b05e1511..39a8eeebe097c93a222835def8af3b1dab5e1ed3 100644
--- a/runtime/vm/json_test.cc
+++ b/runtime/vm/json_test.cc
@@ -141,7 +141,7 @@ TEST_CASE(JSON_JSONStream_Primitives) {
EXPECT_STREQ("false", tb.buf());
js.Clear();
- js.PrintValue((intptr_t)4);
+ js.PrintValue(static_cast<intptr_t>(4));
EXPECT_STREQ("4", tb.buf());
js.Clear();
@@ -219,6 +219,26 @@ TEST_CASE(JSON_JSONStream_ArrayArray) {
}
+TEST_CASE(JSON_JSONStream_Printf) {
+ TextBuffer tb(256);
+ JSONStream js(&tb);
+ js.OpenArray();
+ js.PrintfValue("%d %s", 2, "hello");
+ js.CloseArray();
+ EXPECT_STREQ("[\"2 hello\"]", tb.buf());
+}
+
+
+TEST_CASE(JSON_JSONStream_ObjectPrintf) {
+ TextBuffer tb(256);
+ JSONStream js(&tb);
+ js.OpenObject();
+ js.PrintfProperty("key", "%d %s", 2, "hello");
+ js.CloseObject();
+ EXPECT_STREQ("{\"key\":\"2 hello\"}", tb.buf());
+}
+
+
TEST_CASE(JSON_JSONStream_DartObject) {
TextBuffer tb(256);
JSONStream js(&tb);

Powered by Google App Engine
This is Rietveld 408576698