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

Side by Side Diff: runtime/vm/json_test.cc

Issue 1660063002: Remove many features when building product mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "platform/text_buffer.h" 6 #include "platform/text_buffer.h"
7 #include "vm/json_stream.h" 7 #include "vm/json_stream.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 #ifndef PRODUCT
13 14
14 TEST_CASE(JSON_TextBuffer) { 15 TEST_CASE(JSON_TextBuffer) {
15 TextBuffer w(5); // Small enough to make buffer grow at least once. 16 TextBuffer w(5); // Small enough to make buffer grow at least once.
16 w.Printf("{ \"%s\" : %d", "length", 175); 17 w.Printf("{ \"%s\" : %d", "length", 175);
17 EXPECT_STREQ("{ \"length\" : 175", w.buf()); 18 EXPECT_STREQ("{ \"length\" : 175", w.buf());
18 w.Printf(", \"%s\" : \"%s\" }", "command", "stopIt"); 19 w.Printf(", \"%s\" : \"%s\" }", "command", "stopIt");
19 EXPECT_STREQ("{ \"length\" : 175, \"command\" : \"stopIt\" }", w.buf()); 20 EXPECT_STREQ("{ \"length\" : 175, \"command\" : \"stopIt\" }", w.buf());
20 } 21 }
21 22
22 23
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 EXPECT(js.num_params() == 0); 308 EXPECT(js.num_params() == 0);
308 js.SetParams(&param_keys[0], &param_values[0], 2); 309 js.SetParams(&param_keys[0], &param_values[0], 2);
309 EXPECT(js.num_params() == 2); 310 EXPECT(js.num_params() == 2);
310 EXPECT(!js.HasParam("lizard")); 311 EXPECT(!js.HasParam("lizard"));
311 EXPECT(js.HasParam("dog")); 312 EXPECT(js.HasParam("dog"));
312 EXPECT(js.HasParam("cat")); 313 EXPECT(js.HasParam("cat"));
313 EXPECT(js.ParamIs("cat", "banana")); 314 EXPECT(js.ParamIs("cat", "banana"));
314 EXPECT(!js.ParamIs("dog", "banana")); 315 EXPECT(!js.ParamIs("dog", "banana"));
315 } 316 }
316 317
318 #endif // !PRODUCT
319
317 } // namespace dart 320 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698