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

Side by Side Diff: mojo/public/cpp/bindings/tests/connector_unittest.cc

Issue 613053002: Mojo: NULL -> nullptr in mojo/public/cpp/bindings and also for the bindings generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "mojo/public/cpp/bindings/lib/connector.h" 8 #include "mojo/public/cpp/bindings/lib/connector.h"
9 #include "mojo/public/cpp/bindings/lib/message_builder.h" 9 #include "mojo/public/cpp/bindings/lib/message_builder.h"
10 #include "mojo/public/cpp/bindings/lib/message_queue.h" 10 #include "mojo/public/cpp/bindings/lib/message_queue.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 internal::Connector* connector_; 75 internal::Connector* connector_;
76 int number_of_calls_; 76 int number_of_calls_;
77 }; 77 };
78 78
79 class ConnectorTest : public testing::Test { 79 class ConnectorTest : public testing::Test {
80 public: 80 public:
81 ConnectorTest() { 81 ConnectorTest() {
82 } 82 }
83 83
84 virtual void SetUp() override { 84 virtual void SetUp() override {
85 CreateMessagePipe(NULL, &handle0_, &handle1_); 85 CreateMessagePipe(nullptr, &handle0_, &handle1_);
86 } 86 }
87 87
88 virtual void TearDown() override {} 88 virtual void TearDown() override {}
89 89
90 void AllocMessage(const char* text, Message* message) { 90 void AllocMessage(const char* text, Message* message) {
91 size_t payload_size = strlen(text) + 1; // Plus null terminator. 91 size_t payload_size = strlen(text) + 1; // Plus null terminator.
92 internal::MessageBuilder builder(1, payload_size); 92 internal::MessageBuilder builder(1, payload_size);
93 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size); 93 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size);
94 builder.Finish(message); 94 builder.Finish(message);
95 } 95 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 std::string(kText[i]), 393 std::string(kText[i]),
394 std::string(reinterpret_cast<const char*>(message_received.payload()))); 394 std::string(reinterpret_cast<const char*>(message_received.payload())));
395 } 395 }
396 396
397 ASSERT_EQ(2, accumulator.number_of_calls()); 397 ASSERT_EQ(2, accumulator.number_of_calls());
398 } 398 }
399 399
400 } // namespace 400 } // namespace
401 } // namespace test 401 } // namespace test
402 } // namespace mojo 402 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/buffer_unittest.cc ('k') | mojo/public/cpp/bindings/tests/handle_passing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698