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

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

Issue 10869063: Add attributions so printf like functions can have their arguments checked. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 years, 3 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 | « runtime/vm/message_handler.cc ('k') | runtime/vm/object.h » ('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 "vm/message_handler.h" 5 #include "vm/message_handler.h"
6 #include "vm/unit_test.h" 6 #include "vm/unit_test.h"
7 7
8 namespace dart { 8 namespace dart {
9 9
10 class MessageHandlerTestPeer { 10 class MessageHandlerTestPeer {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 void MessageNotify(Message::Priority priority) { 45 void MessageNotify(Message::Priority priority) {
46 notify_count_++; 46 notify_count_++;
47 } 47 }
48 48
49 bool HandleMessage(Message* message) { 49 bool HandleMessage(Message* message) {
50 // For testing purposes, keep a string with a list of the ports 50 // For testing purposes, keep a string with a list of the ports
51 // for all messages we receive. 51 // for all messages we receive.
52 intptr_t len = 52 intptr_t len =
53 OS::SNPrint(NULL, 0, "%s %d", port_buffer_, message->dest_port()) + 1; 53 OS::SNPrint(NULL, 0, "%s %"Pd64"",
54 port_buffer_,
55 message->dest_port()) + 1;
54 char* buffer = reinterpret_cast<char*>(malloc(len)); 56 char* buffer = reinterpret_cast<char*>(malloc(len));
55 OS::SNPrint(buffer, len, "%s %d", port_buffer_, message->dest_port()); 57 OS::SNPrint(buffer, len, "%s %"Pd64"",
58 port_buffer_,
59 message->dest_port());
56 free(port_buffer_); 60 free(port_buffer_);
57 port_buffer_ = buffer; 61 port_buffer_ = buffer;
58 delete message; 62 delete message;
59 message_count_++; 63 message_count_++;
60 return result_; 64 return result_;
61 } 65 }
62 66
63 67
64 bool Start() { 68 bool Start() {
65 intptr_t len = 69 intptr_t len =
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 OS::Sleep(10); 263 OS::Sleep(10);
260 sleep += 10; 264 sleep += 10;
261 } 265 }
262 EXPECT_STREQ(" start 100 1 2 3 4 5 6 7 8 9 10", handler.port_buffer()); 266 EXPECT_STREQ(" start 100 1 2 3 4 5 6 7 8 9 10", handler.port_buffer());
263 267
264 handler_peer.decrement_live_ports(); 268 handler_peer.decrement_live_ports();
265 EXPECT(!handler.HasLivePorts()); 269 EXPECT(!handler.HasLivePorts());
266 } 270 }
267 271
268 } // namespace dart 272 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/message_handler.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698