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

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

Issue 821193003: Fix out-of-bounds access in JSONStream test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/json.h" 6 #include "platform/json.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
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 const char* option_keys[] = {"dog", "cat"}; 395 const char* option_keys[] = {"dog", "cat"};
396 const char* option_values[] = {"apple", "banana"}; 396 const char* option_values[] = {"apple", "banana"};
397 397
398 JSONStream js; 398 JSONStream js;
399 EXPECT(js.num_arguments() == 0); 399 EXPECT(js.num_arguments() == 0);
400 js.SetArguments(&arguments[0], 3); 400 js.SetArguments(&arguments[0], 3);
401 EXPECT(js.num_arguments() == 3); 401 EXPECT(js.num_arguments() == 3);
402 EXPECT_STREQ("a", js.command()); 402 EXPECT_STREQ("a", js.command());
403 403
404 EXPECT(js.num_options() == 0); 404 EXPECT(js.num_options() == 0);
405 js.SetOptions(&option_keys[0], &option_values[0], 3); 405 js.SetOptions(&option_keys[0], &option_values[0], 2);
406 EXPECT(js.num_options() == 3); 406 EXPECT(js.num_options() == 2);
407 EXPECT(!js.HasOption("lizard")); 407 EXPECT(!js.HasOption("lizard"));
408 EXPECT(js.HasOption("dog")); 408 EXPECT(js.HasOption("dog"));
409 EXPECT(js.HasOption("cat")); 409 EXPECT(js.HasOption("cat"));
410 EXPECT(js.OptionIs("cat", "banana")); 410 EXPECT(js.OptionIs("cat", "banana"));
411 EXPECT(!js.OptionIs("dog", "banana")); 411 EXPECT(!js.OptionIs("dog", "banana"));
412 } 412 }
413 413
414 } // namespace dart 414 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698