From d643172a8573e7e75f325bec2125de8071bfd0fc Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Thu, 1 Sep 2011 00:46:33 +0000 Subject: Reduce number of unnamed-type-template-args violations (mostly when passing values to DCHECK(), ASSERT_EQ(), etc.), generally by naming previously-anonymous enums. We've decided not to eliminate the warning entirely because doing so is only possible with tons of ugly static_cast<>()s in Mac code. BUG=92247 TEST=Compiles Review URL: http://codereview.chromium.org/7605019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99086 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/ipc_channel_posix_unittest.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'ipc/ipc_channel_posix_unittest.cc') diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc index 9d9c70a..6f37ae6 100644 --- a/ipc/ipc_channel_posix_unittest.cc +++ b/ipc/ipc_channel_posix_unittest.cc @@ -23,9 +23,7 @@ namespace { -enum { - QUIT_MESSAGE = 47 -}; +static const uint32 kQuitMessage = 47; class IPCChannelPosixTestListener : public IPC::Channel::Listener { public: @@ -44,7 +42,7 @@ class IPCChannelPosixTestListener : public IPC::Channel::Listener { virtual ~IPCChannelPosixTestListener() {} virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { - EXPECT_EQ(message.type(), QUIT_MESSAGE); + EXPECT_EQ(message.type(), kQuitMessage); status_ = MESSAGE_RECEIVED; QuitRunLoop(); return true; @@ -88,7 +86,7 @@ class IPCChannelPosixTestListener : public IPC::Channel::Listener { // The current status of the listener. STATUS status_; // If |quit_only_on_message_| then the listener will only break out of - // the run loop when the QUIT_MESSAGE is received. + // the run loop when kQuitMessage is received. bool quit_only_on_message_; }; @@ -144,7 +142,7 @@ void IPCChannelPosixTest::SetUpSocket(IPC::ChannelHandle *handle, if (mode == IPC::Channel::MODE_NAMED_SERVER) { // Only one server at a time. Cleanup garbage if it exists. unlink(name.c_str()); - // Make sure the path we need exists. + // Make sure the path we need exists. FilePath path(name); FilePath dir_path = path.DirName(); ASSERT_TRUE(file_util::CreateDirectory(dir_path)); @@ -229,8 +227,8 @@ TEST_F(IPCChannelPosixTest, AdvancedConnected) { SpinRunLoop(TestTimeouts::action_max_timeout_ms()); ASSERT_EQ(IPCChannelPosixTestListener::CONNECTED, listener.status()); ASSERT_TRUE(channel.HasAcceptedConnection()); - IPC::Message* message = new IPC::Message(0, // routing_id - QUIT_MESSAGE, // message type + IPC::Message* message = new IPC::Message(0, // routing_id + kQuitMessage, // message type IPC::Message::PRIORITY_NORMAL); channel.Send(message); SpinRunLoop(TestTimeouts::action_timeout_ms()); @@ -268,8 +266,8 @@ TEST_F(IPCChannelPosixTest, ResetState) { SpinRunLoop(TestTimeouts::action_max_timeout_ms()); ASSERT_EQ(IPCChannelPosixTestListener::CONNECTED, listener.status()); ASSERT_TRUE(channel.HasAcceptedConnection()); - IPC::Message* message = new IPC::Message(0, // routing_id - QUIT_MESSAGE, // message type + IPC::Message* message = new IPC::Message(0, // routing_id + kQuitMessage, // message type IPC::Message::PRIORITY_NORMAL); channel.Send(message); SpinRunLoop(TestTimeouts::action_timeout_ms()); @@ -327,8 +325,8 @@ TEST_F(IPCChannelPosixTest, MultiConnection) { EXPECT_EQ(exit_code, 0); ASSERT_EQ(IPCChannelPosixTestListener::DENIED, listener.status()); ASSERT_TRUE(channel.HasAcceptedConnection()); - IPC::Message* message = new IPC::Message(0, // routing_id - QUIT_MESSAGE, // message type + IPC::Message* message = new IPC::Message(0, // routing_id + kQuitMessage, // message type IPC::Message::PRIORITY_NORMAL); channel.Send(message); SpinRunLoop(TestTimeouts::action_timeout_ms()); -- cgit v1.1