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

Side by Side Diff: mojo/edk/system/message_in_transit_test_utils.cc

Issue 1649633002: Remove files that are no longer used in the Port EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « mojo/edk/system/message_in_transit_test_utils.h ('k') | mojo/edk/system/raw_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/edk/system/message_in_transit_test_utils.h"
6
7 #include <stdint.h>
8
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace mojo {
12 namespace edk {
13 namespace test {
14
15 scoped_ptr<MessageInTransit> MakeTestMessage(unsigned id) {
16 return make_scoped_ptr(
17 new MessageInTransit(MessageInTransit::Type::MESSAGE,
18 static_cast<uint32_t>(sizeof(id)), &id));
19 }
20
21 void VerifyTestMessage(const MessageInTransit* message, unsigned id) {
22 ASSERT_TRUE(message);
23 EXPECT_EQ(MessageInTransit::Type::MESSAGE, message->type());
24 EXPECT_EQ(sizeof(id), message->num_bytes());
25 EXPECT_EQ(id, *static_cast<const unsigned*>(message->bytes()));
26 }
27
28 bool IsTestMessage(MessageInTransit* message, unsigned* id) {
29 if (message->type() != MessageInTransit::Type::MESSAGE ||
30 message->num_bytes() != sizeof(*id))
31 return false;
32
33 *id = *static_cast<const unsigned*>(message->bytes());
34 return true;
35 }
36
37 } // namespace test
38 } // namespace edk
39 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_in_transit_test_utils.h ('k') | mojo/edk/system/raw_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698