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

Unified Diff: util/mach/mach_message_server_test.cc

Issue 1405273002: Mach port scopers should use get() instead of type conversion operators (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: More is_valid() Created 5 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 | « util/mach/mach_extensions_test.cc ('k') | util/mach/mach_message_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_message_server_test.cc
diff --git a/util/mach/mach_message_server_test.cc b/util/mach/mach_message_server_test.cc
index 6878cf95da96d819abdf5ab38cee576b9ed76fd9..daa64a93dc90bef0f945250d68460df624234c4e 100644
--- a/util/mach/mach_message_server_test.cc
+++ b/util/mach/mach_message_server_test.cc
@@ -467,8 +467,8 @@ class TestMachMessageServer : public MachMessageServer::Interface,
// carried in the request message to the server. By the time the server
// looks at the right, it will have become a dead name.
local_receive_port_owner.reset(NewMachPort(MACH_PORT_RIGHT_RECEIVE));
- ASSERT_NE(kMachPortNull, local_receive_port_owner);
- request.header.msgh_local_port = local_receive_port_owner;
+ ASSERT_TRUE(local_receive_port_owner.is_valid());
+ request.header.msgh_local_port = local_receive_port_owner.get();
break;
}
}
@@ -479,8 +479,8 @@ class TestMachMessageServer : public MachMessageServer::Interface,
// properly handles ownership of resources received in complex messages.
request.body.msgh_descriptor_count = 1;
child_complex_message_port_.reset(NewMachPort(MACH_PORT_RIGHT_RECEIVE));
- ASSERT_NE(kMachPortNull, child_complex_message_port_);
- request.port_descriptor.name = child_complex_message_port_;
+ ASSERT_TRUE(child_complex_message_port_.is_valid());
+ request.port_descriptor.name = child_complex_message_port_.get();
request.port_descriptor.disposition = MACH_MSG_TYPE_MAKE_SEND;
request.port_descriptor.type = MACH_MSG_PORT_DESCRIPTOR;
} else {
« no previous file with comments | « util/mach/mach_extensions_test.cc ('k') | util/mach/mach_message_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698