summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 00:46:33 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 00:46:33 +0000
commitd643172a8573e7e75f325bec2125de8071bfd0fc (patch)
tree16d43bab4652624b87e1e7acfbecb63310a6e736 /ipc
parentf5e7e8e162433ab6e8223c8b3da4feb64abddc33 (diff)
downloadchromium_src-d643172a8573e7e75f325bec2125de8071bfd0fc.zip
chromium_src-d643172a8573e7e75f325bec2125de8071bfd0fc.tar.gz
chromium_src-d643172a8573e7e75f325bec2125de8071bfd0fc.tar.bz2
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
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_channel_posix_unittest.cc22
1 files changed, 10 insertions, 12 deletions
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());