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

Unified Diff: mojo/edk/system/channel_endpoint_id_unittest.cc

Issue 647553004: Mojo: Make room for remotely-allocated channel endpoint IDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@channel_endpoint_id_tests
Patch Set: bah 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/channel_endpoint_id.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel_endpoint_id_unittest.cc
diff --git a/mojo/edk/system/channel_endpoint_id_unittest.cc b/mojo/edk/system/channel_endpoint_id_unittest.cc
index 787f5b5c1f044acdce92caf28e55baeda8fa2061..11b17c12f10a789995a27db6b96d3bd4c94e05d9 100644
--- a/mojo/edk/system/channel_endpoint_id_unittest.cc
+++ b/mojo/edk/system/channel_endpoint_id_unittest.cc
@@ -30,6 +30,9 @@ TEST(ChannelEndpointIdTest, Basic) {
EXPECT_FALSE(invalid.is_valid());
EXPECT_TRUE(bootstrap.is_valid());
+ EXPECT_FALSE(invalid.is_remotely_allocated());
+ EXPECT_FALSE(bootstrap.is_remotely_allocated());
+
// Test assignment.
ChannelEndpointId copy;
copy = bootstrap;
@@ -86,14 +89,17 @@ TEST(LocalChannelEndpointIdGeneratorTest, Basic) {
// it needs to be friended.
TEST(LocalChannelEndpointIdGeneratorTest, WrapAround) {
LocalChannelEndpointIdGenerator gen;
- gen.next_channel_endpoint_id_.value_ = static_cast<uint32_t>(-1);
+ gen.next_channel_endpoint_id_.value_ =
+ ChannelEndpointId::kRemotelyAllocatedFlag - 1;
ChannelEndpointId id = gen.GetNext();
EXPECT_TRUE(id.is_valid());
- EXPECT_EQ(static_cast<uint32_t>(-1), id.value());
+ EXPECT_FALSE(id.is_remotely_allocated());
+ EXPECT_EQ(ChannelEndpointId::kRemotelyAllocatedFlag - 1, id.value());
id = gen.GetNext();
EXPECT_TRUE(id.is_valid());
+ EXPECT_FALSE(id.is_remotely_allocated());
EXPECT_EQ(1u, id.value());
}
« no previous file with comments | « mojo/edk/system/channel_endpoint_id.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698