15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2011 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Unit test to make sure that the serialization of synchronous IPC messages 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// works. This ensures that the macros and templates were defined correctly. 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Doesn't test the IPC channel mechanism. 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string.h> 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h" 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message.h" 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_utils.h" 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/logging.h" 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "testing/gtest/include/gtest/gtest.h" 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_IMPL 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_sync_message_unittest.h" 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace { 212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)static IPC::Message* g_reply; 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class TestMessageReceiver { 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public: 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_0_1(bool* out1) { 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = false; 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_0_2(bool* out1, int* out2) { 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = true; 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 2; 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_0_3(bool* out1, int* out2, std::string* out3) { 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = false; 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 3; 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out3 = "0_3"; 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_1_1(int in1, bool* out1) { 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(1, in1); 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = true; 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_1_2(bool in1, bool* out1, int* out2) { 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!in1); 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = true; 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 12; 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_1_3(int in1, std::string* out1, int* out2, bool* out3) { 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(3, in1); 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = "1_3"; 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 13; 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out3 = false; 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_2_1(int in1, bool in2, bool* out1) { 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(1, in1); 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!in2); 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = true; 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_2_2(bool in1, int in2, bool* out1, int* out2) { 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!in1); 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(2, in2); 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = true; 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 22; 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_2_3(int in1, bool in2, std::string* out1, int* out2, bool* out3) { 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(3, in1); 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(in2); 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = "2_3"; 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 23; 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out3 = false; 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_3_1(int in1, bool in2, std::string in3, bool* out1) { 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(1, in1); 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!in2); 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("3_1", in3); 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = true; 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_3_2(std::string in1, bool in2, int in3, bool* out1, int* out2) { 895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("3_2", in1); 905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!in2); 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(2, in3); 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = true; 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 32; 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_3_3(int in1, std::string in2, bool in3, std::string* out1, int* out2, 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool* out3) { 985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(3, in1); 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("3_3", in2); 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(in3); 1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = "3_3"; 1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = 33; 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out3 = false; 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void On_3_4(bool in1, int in2, std::string in3, int* out1, bool* out2, 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::string* out3, bool* out4) { 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(in1); 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(3, in2); 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("3_4", in3); 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out1 = 34; 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out2 = true; 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out3 = "3_4"; 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *out4 = false; 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool Send(IPC::Message* message) { 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // gets the reply message, stash in global 1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(g_reply == NULL); 1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) g_reply = message; 1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return true; 1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool OnMessageReceived(const IPC::Message& msg) { 1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_BEGIN_MESSAGE_MAP(TestMessageReceiver, msg) 1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_0_1, On_0_1) 1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_0_2, On_0_2) 1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_0_3, On_0_3) 1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_1_1, On_1_1) 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_1_2, On_1_2) 1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_1_3, On_1_3) 1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_2_1, On_2_1) 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_2_2, On_2_2) 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_2_3, On_2_3) 1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_3_1, On_3_1) 1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_3_2, On_3_2) 1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_3_3, On_3_3) 1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_C_3_4, On_3_4) 1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_0_1, On_0_1) 1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_0_2, On_0_2) 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_0_3, On_0_3) 1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_1_1, On_1_1) 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_1_2, On_1_2) 1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_1_3, On_1_3) 1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_2_1, On_2_1) 1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_2_2, On_2_2) 1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_2_3, On_2_3) 1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_3_1, On_3_1) 1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_3_2, On_3_2) 1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_3_3, On_3_3) 1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_MESSAGE_HANDLER(Msg_R_3_4, On_3_4) 1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC_END_MESSAGE_MAP() 1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return true; 1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)void Send(IPC::SyncMessage* msg) { 1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static TestMessageReceiver receiver; 1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC::MessageReplyDeserializer* reply_serializer = msg->GetReplyDeserializer(); 1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(reply_serializer != NULL); 1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // "send" the message 1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) receiver.OnMessageReceived(*msg); 1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) delete msg; 1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // get the reply message from the global, and deserialize the output 1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // parameters into the output pointers. 1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(g_reply != NULL); 1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool result = reply_serializer->SerializeOutputParameters(*g_reply); 1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(result); 1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) delete g_reply; 1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) g_reply = NULL; 1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) delete reply_serializer; 1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)TEST(IPCSyncMessageTest, Main) { 1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool bool1 = true; 1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int int1 = 0; 1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::string string1; 1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_0_1(&bool1)); 1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_0_2(&bool1, &int1)); 1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(2, int1); 1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_0_3(&bool1, &int1, &string1)); 1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(3, int1); 1935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("0_3", string1); 1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_1_1(1, &bool1)); 1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_1_2(false, &bool1, &int1)); 2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(12, int1); 2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = true; 2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_1_3(3, &string1, &int1, &bool1)); 2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("1_3", string1); 2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(13, int1); 2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_2_1(1, false, &bool1)); 2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_2_2(false, 2, &bool1, &int1)); 2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(22, int1); 2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = true; 2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_2_3(3, true, &string1, &int1, &bool1)); 2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("2_3", string1); 2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(23, int1); 2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_3_1(1, false, "3_1", &bool1)); 2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_3_2("3_2", false, 2, &bool1, &int1)); 2315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(32, int1); 2335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = true; 2355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_3_3(3, "3_3", true, &string1, &int1, &bool1)); 2365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("3_3", string1); 2375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(33, int1); 2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool bool2 = true; 2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_C_3_4(true, 3, "3_4", &int1, &bool1, &string1, &bool2)); 2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(34, int1); 2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("3_4", string1); 2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool2); 2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Routed messages, just a copy of the above but with extra routing paramater 2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_0_1(0, &bool1)); 2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_0_2(0, &bool1, &int1)); 2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(2, int1); 2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_0_3(0, &bool1, &int1, &string1)); 2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(3, int1); 2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("0_3", string1); 2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_1_1(0, 1, &bool1)); 2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_1_2(0, false, &bool1, &int1)); 2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(12, int1); 2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = true; 2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_1_3(0, 3, &string1, &int1, &bool1)); 2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("1_3", string1); 2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(13, int1); 2745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_2_1(0, 1, false, &bool1)); 2785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_2_2(0, false, 2, &bool1, &int1)); 2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(22, int1); 2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = true; 2865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_2_3(0, 3, true, &string1, &int1, &bool1)); 2875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("2_3", string1); 2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(23, int1); 2905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_3_1(0, 1, false, "3_1", &bool1)); 2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = false; 2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_3_2(0, "3_2", false, 2, &bool1, &int1)); 2975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(bool1); 2985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(32, int1); 2995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool1 = true; 3015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) Send(new Msg_R_3_3(0, 3, "3_3", true, &string1, &int1, &bool1)); 3025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ("3_3", string1); 3035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK_EQ(33, int1); 3045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DCHECK(!bool1); 3055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 3062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} // namespace 308