1 //===-- GDBRemoteCommunicationClientTest.cpp --------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #include <future>
10 
11 #include "GDBRemoteTestUtils.h"
12 
13 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h"
14 #include "lldb/lldb-enumerations.h"
15 #include "lldb/Core/ModuleSpec.h"
16 #include "lldb/Core/StructuredData.h"
17 #include "lldb/Core/TraceOptions.h"
18 #include "lldb/Target/MemoryRegionInfo.h"
19 #include "lldb/Utility/DataBuffer.h"
20 
21 #include "llvm/ADT/ArrayRef.h"
22 
23 using namespace lldb_private::process_gdb_remote;
24 using namespace lldb_private;
25 using namespace lldb;
26 using namespace llvm;
27 
28 namespace {
29 
30 typedef GDBRemoteCommunication::PacketResult PacketResult;
31 
32 struct TestClient : public GDBRemoteCommunicationClient {
33   TestClient() { m_send_acks = false; }
34 };
35 
36 void Handle_QThreadSuffixSupported(MockServer &server, bool supported) {
37   StringExtractorGDBRemote request;
38   ASSERT_EQ(PacketResult::Success, server.GetPacket(request));
39   ASSERT_EQ("QThreadSuffixSupported", request.GetStringRef());
40   if (supported)
41     ASSERT_EQ(PacketResult::Success, server.SendOKResponse());
42   else
43     ASSERT_EQ(PacketResult::Success, server.SendUnimplementedResponse(nullptr));
44 }
45 
46 void HandlePacket(MockServer &server, StringRef expected, StringRef response) {
47   StringExtractorGDBRemote request;
48   ASSERT_EQ(PacketResult::Success, server.GetPacket(request));
49   ASSERT_EQ(expected, request.GetStringRef());
50   ASSERT_EQ(PacketResult::Success, server.SendPacket(response));
51 }
52 
53 uint8_t all_registers[] = {'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
54                            'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O'};
55 std::string all_registers_hex = "404142434445464748494a4b4c4d4e4f";
56 uint8_t one_register[] = {'A', 'B', 'C', 'D'};
57 std::string one_register_hex = "41424344";
58 
59 } // end anonymous namespace
60 
61 class GDBRemoteCommunicationClientTest : public GDBRemoteTest {};
62 
63 TEST_F(GDBRemoteCommunicationClientTest, WriteRegister) {
64   TestClient client;
65   MockServer server;
66   Connect(client, server);
67   if (HasFailure())
68     return;
69 
70   const lldb::tid_t tid = 0x47;
71   const uint32_t reg_num = 4;
72   std::future<bool> write_result = std::async(std::launch::async, [&] {
73     return client.WriteRegister(tid, reg_num, one_register);
74   });
75 
76   Handle_QThreadSuffixSupported(server, true);
77 
78   HandlePacket(server, "P4=" + one_register_hex + ";thread:0047;", "OK");
79   ASSERT_TRUE(write_result.get());
80 
81   write_result = std::async(std::launch::async, [&] {
82     return client.WriteAllRegisters(tid, all_registers);
83   });
84 
85   HandlePacket(server, "G" + all_registers_hex + ";thread:0047;", "OK");
86   ASSERT_TRUE(write_result.get());
87 }
88 
89 TEST_F(GDBRemoteCommunicationClientTest, WriteRegisterNoSuffix) {
90   TestClient client;
91   MockServer server;
92   Connect(client, server);
93   if (HasFailure())
94     return;
95 
96   const lldb::tid_t tid = 0x47;
97   const uint32_t reg_num = 4;
98   std::future<bool> write_result = std::async(std::launch::async, [&] {
99     return client.WriteRegister(tid, reg_num, one_register);
100   });
101 
102   Handle_QThreadSuffixSupported(server, false);
103   HandlePacket(server, "Hg47", "OK");
104   HandlePacket(server, "P4=" + one_register_hex, "OK");
105   ASSERT_TRUE(write_result.get());
106 
107   write_result = std::async(std::launch::async, [&] {
108     return client.WriteAllRegisters(tid, all_registers);
109   });
110 
111   HandlePacket(server, "G" + all_registers_hex, "OK");
112   ASSERT_TRUE(write_result.get());
113 }
114 
115 TEST_F(GDBRemoteCommunicationClientTest, ReadRegister) {
116   TestClient client;
117   MockServer server;
118   Connect(client, server);
119   if (HasFailure())
120     return;
121 
122   const lldb::tid_t tid = 0x47;
123   const uint32_t reg_num = 4;
124   std::future<bool> async_result = std::async(
125       std::launch::async, [&] { return client.GetpPacketSupported(tid); });
126   Handle_QThreadSuffixSupported(server, true);
127   HandlePacket(server, "p0;thread:0047;", one_register_hex);
128   ASSERT_TRUE(async_result.get());
129 
130   std::future<DataBufferSP> read_result = std::async(
131       std::launch::async, [&] { return client.ReadRegister(tid, reg_num); });
132   HandlePacket(server, "p4;thread:0047;", "41424344");
133   auto buffer_sp = read_result.get();
134   ASSERT_TRUE(bool(buffer_sp));
135   ASSERT_EQ(0,
136             memcmp(buffer_sp->GetBytes(), one_register, sizeof one_register));
137 
138   read_result = std::async(std::launch::async,
139                            [&] { return client.ReadAllRegisters(tid); });
140   HandlePacket(server, "g;thread:0047;", all_registers_hex);
141   buffer_sp = read_result.get();
142   ASSERT_TRUE(bool(buffer_sp));
143   ASSERT_EQ(0,
144             memcmp(buffer_sp->GetBytes(), all_registers, sizeof all_registers));
145 }
146 
147 TEST_F(GDBRemoteCommunicationClientTest, SaveRestoreRegistersNoSuffix) {
148   TestClient client;
149   MockServer server;
150   Connect(client, server);
151   if (HasFailure())
152     return;
153 
154   const lldb::tid_t tid = 0x47;
155   uint32_t save_id;
156   std::future<bool> async_result = std::async(std::launch::async, [&] {
157     return client.SaveRegisterState(tid, save_id);
158   });
159   Handle_QThreadSuffixSupported(server, false);
160   HandlePacket(server, "Hg47", "OK");
161   HandlePacket(server, "QSaveRegisterState", "1");
162   ASSERT_TRUE(async_result.get());
163   EXPECT_EQ(1u, save_id);
164 
165   async_result = std::async(std::launch::async, [&] {
166     return client.RestoreRegisterState(tid, save_id);
167   });
168   HandlePacket(server, "QRestoreRegisterState:1", "OK");
169   ASSERT_TRUE(async_result.get());
170 }
171 
172 TEST_F(GDBRemoteCommunicationClientTest, SyncThreadState) {
173   TestClient client;
174   MockServer server;
175   Connect(client, server);
176   if (HasFailure())
177     return;
178 
179   const lldb::tid_t tid = 0x47;
180   std::future<bool> async_result = std::async(
181       std::launch::async, [&] { return client.SyncThreadState(tid); });
182   HandlePacket(server, "qSyncThreadStateSupported", "OK");
183   HandlePacket(server, "QSyncThreadState:0047;", "OK");
184   ASSERT_TRUE(async_result.get());
185 }
186 
187 TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) {
188   TestClient client;
189   MockServer server;
190   Connect(client, server);
191   if (HasFailure())
192     return;
193 
194   llvm::Triple triple("i386-pc-linux");
195 
196   FileSpec file_specs[] = {
197       FileSpec("/foo/bar.so", false, FileSpec::ePathSyntaxPosix),
198       FileSpec("/foo/baz.so", false, FileSpec::ePathSyntaxPosix),
199 
200       // This is a bit dodgy but we currently depend on GetModulesInfo not
201       // performing denormalization. It can go away once the users
202       // (DynamicLoaderPOSIXDYLD, at least) correctly set the path syntax for
203       // the FileSpecs they create.
204       FileSpec("/foo/baw.so", false, FileSpec::ePathSyntaxWindows),
205   };
206   std::future<llvm::Optional<std::vector<ModuleSpec>>> async_result =
207       std::async(std::launch::async,
208                  [&] { return client.GetModulesInfo(file_specs, triple); });
209   HandlePacket(
210       server, "jModulesInfo:["
211               R"({"file":"/foo/bar.so","triple":"i386-pc-linux"},)"
212               R"({"file":"/foo/baz.so","triple":"i386-pc-linux"},)"
213               R"({"file":"/foo/baw.so","triple":"i386-pc-linux"}])",
214       R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)"
215       R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}]])");
216 
217   auto result = async_result.get();
218   ASSERT_TRUE(result.hasValue());
219   ASSERT_EQ(1u, result->size());
220   EXPECT_EQ("/foo/bar.so", result.getValue()[0].GetFileSpec().GetPath());
221   EXPECT_EQ(triple, result.getValue()[0].GetArchitecture().GetTriple());
222   EXPECT_EQ(UUID("@ABCDEFGHIJKLMNO", 16), result.getValue()[0].GetUUID());
223   EXPECT_EQ(0u, result.getValue()[0].GetObjectOffset());
224   EXPECT_EQ(1234u, result.getValue()[0].GetObjectSize());
225 }
226 
227 TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfoInvalidResponse) {
228   TestClient client;
229   MockServer server;
230   Connect(client, server);
231   if (HasFailure())
232     return;
233 
234   llvm::Triple triple("i386-pc-linux");
235   FileSpec file_spec("/foo/bar.so", false, FileSpec::ePathSyntaxPosix);
236 
237   const char *invalid_responses[] = {
238       "OK", "E47", "[]",
239       // no UUID
240       R"([{"triple":"i386-pc-linux",)"
241       R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}])",
242       // no triple
243       R"([{"uuid":"404142434445464748494a4b4c4d4e4f",)"
244       R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}])",
245       // no file_path
246       R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)"
247       R"("file_offset":0,"file_size":1234}])",
248       // no file_offset
249       R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)"
250       R"("file_path":"/foo/bar.so","file_size":1234}])",
251       // no file_size
252       R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)"
253       R"("file_path":"/foo/bar.so","file_offset":0}])",
254   };
255 
256   for (const char *response : invalid_responses) {
257     std::future<llvm::Optional<std::vector<ModuleSpec>>> async_result =
258         std::async(std::launch::async,
259                    [&] { return client.GetModulesInfo(file_spec, triple); });
260     HandlePacket(
261         server,
262         R"(jModulesInfo:[{"file":"/foo/bar.so","triple":"i386-pc-linux"}])",
263         response);
264 
265     ASSERT_FALSE(async_result.get().hasValue()) << "response was: " << response;
266   }
267 }
268 
269 TEST_F(GDBRemoteCommunicationClientTest, TestPacketSpeedJSON) {
270   TestClient client;
271   MockServer server;
272   Connect(client, server);
273   if (HasFailure())
274     return;
275 
276   std::thread server_thread([&server] {
277     for (;;) {
278       StringExtractorGDBRemote request;
279       PacketResult result = server.GetPacket(request);
280       if (result == PacketResult::ErrorDisconnected)
281         return;
282       ASSERT_EQ(PacketResult::Success, result);
283       StringRef ref = request.GetStringRef();
284       ASSERT_TRUE(ref.consume_front("qSpeedTest:response_size:"));
285       int size;
286       ASSERT_FALSE(ref.consumeInteger(10, size)) << "ref: " << ref;
287       std::string response(size, 'X');
288       ASSERT_EQ(PacketResult::Success, server.SendPacket(response));
289     }
290   });
291 
292   StreamString ss;
293   client.TestPacketSpeed(10, 32, 32, 4096, true, ss);
294   client.Disconnect();
295   server_thread.join();
296 
297   GTEST_LOG_(INFO) << "Formatted output: " << ss.GetData();
298   auto object_sp = StructuredData::ParseJSON(ss.GetString());
299   ASSERT_TRUE(bool(object_sp));
300   auto dict_sp = object_sp->GetAsDictionary();
301   ASSERT_TRUE(bool(dict_sp));
302 
303   object_sp = dict_sp->GetValueForKey("packet_speeds");
304   ASSERT_TRUE(bool(object_sp));
305   dict_sp = object_sp->GetAsDictionary();
306   ASSERT_TRUE(bool(dict_sp));
307 
308   int num_packets;
309   ASSERT_TRUE(dict_sp->GetValueForKeyAsInteger("num_packets", num_packets))
310       << ss.GetString();
311   ASSERT_EQ(10, num_packets);
312 }
313 
314 TEST_F(GDBRemoteCommunicationClientTest, SendSignalsToIgnore) {
315   TestClient client;
316   MockServer server;
317   Connect(client, server);
318   if (HasFailure())
319     return;
320 
321   std::future<Status> result = std::async(std::launch::async, [&] {
322     return client.SendSignalsToIgnore({2, 3, 5, 7, 0xB, 0xD, 0x11});
323   });
324 
325   HandlePacket(server, "QPassSignals:02;03;05;07;0b;0d;11", "OK");
326   EXPECT_TRUE(result.get().Success());
327 
328   result = std::async(std::launch::async, [&] {
329     return client.SendSignalsToIgnore(std::vector<int32_t>());
330   });
331 
332   HandlePacket(server, "QPassSignals:", "OK");
333   EXPECT_TRUE(result.get().Success());
334 }
335 
336 TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfo) {
337   TestClient client;
338   MockServer server;
339   Connect(client, server);
340   if (HasFailure())
341     return;
342 
343   const lldb::addr_t addr = 0xa000;
344   MemoryRegionInfo region_info;
345   std::future<Status> result = std::async(std::launch::async, [&] {
346     return client.GetMemoryRegionInfo(addr, region_info);
347   });
348 
349   // name is: /foo/bar.so
350   HandlePacket(server,
351       "qMemoryRegionInfo:a000",
352       "start:a000;size:2000;permissions:rx;name:2f666f6f2f6261722e736f;");
353   EXPECT_TRUE(result.get().Success());
354 
355 }
356 
357 TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfoInvalidResponse) {
358   TestClient client;
359   MockServer server;
360   Connect(client, server);
361   if (HasFailure())
362     return;
363 
364   const lldb::addr_t addr = 0x4000;
365   MemoryRegionInfo region_info;
366   std::future<Status> result = std::async(std::launch::async, [&] {
367     return client.GetMemoryRegionInfo(addr, region_info);
368   });
369 
370   HandlePacket(server, "qMemoryRegionInfo:4000", "start:4000;size:0000;");
371   EXPECT_FALSE(result.get().Success());
372 }
373 
374 TEST_F(GDBRemoteCommunicationClientTest, SendStartTracePacket) {
375   TestClient client;
376   MockServer server;
377   Connect(client, server);
378   if (HasFailure())
379     return;
380 
381   TraceOptions options;
382   Status error;
383 
384   options.setType(lldb::TraceType::eTraceTypeProcessorTrace);
385   options.setMetaDataBufferSize(8192);
386   options.setTraceBufferSize(8192);
387   options.setThreadID(0x23);
388 
389   StructuredData::DictionarySP custom_params =
390       std::make_shared<StructuredData::Dictionary>();
391   custom_params->AddStringItem("tracetech", "intel-pt");
392   custom_params->AddIntegerItem("psb", 0x01);
393 
394   options.setTraceParams(custom_params);
395 
396   std::future<lldb::user_id_t> result = std::async(std::launch::async, [&] {
397     return client.SendStartTracePacket(options, error);
398   });
399 
400   // Since the line is exceeding 80 characters.
401   std::string expected_packet1 =
402       R"(jTraceStart:{"buffersize" : 8192,"metabuffersize" : 8192,"params" :)";
403   std::string expected_packet2 =
404       R"( {"psb" : 1,"tracetech" : "intel-pt"},"threadid" : 35,"type" : 1})";
405   HandlePacket(server, (expected_packet1 + expected_packet2), "1");
406   ASSERT_TRUE(error.Success());
407   ASSERT_EQ(result.get(), 1u);
408 
409   error.Clear();
410   result = std::async(std::launch::async, [&] {
411     return client.SendStartTracePacket(options, error);
412   });
413 
414   HandlePacket(server, (expected_packet1 + expected_packet2), "E23");
415   ASSERT_EQ(result.get(), LLDB_INVALID_UID);
416   ASSERT_FALSE(error.Success());
417 }
418 
419 TEST_F(GDBRemoteCommunicationClientTest, SendStopTracePacket) {
420   TestClient client;
421   MockServer server;
422   Connect(client, server);
423   if (HasFailure())
424     return;
425 
426   lldb::tid_t thread_id = 0x23;
427   lldb::user_id_t trace_id = 3;
428 
429   std::future<Status> result = std::async(std::launch::async, [&] {
430     return client.SendStopTracePacket(trace_id, thread_id);
431   });
432 
433   const char *expected_packet =
434       R"(jTraceStop:{"threadid" : 35,"traceid" : 3})";
435   HandlePacket(server, expected_packet, "OK");
436   ASSERT_TRUE(result.get().Success());
437 
438   result = std::async(std::launch::async, [&] {
439     return client.SendStopTracePacket(trace_id, thread_id);
440   });
441 
442   HandlePacket(server, expected_packet, "E23");
443   ASSERT_FALSE(result.get().Success());
444 }
445 
446 TEST_F(GDBRemoteCommunicationClientTest, SendGetDataPacket) {
447   TestClient client;
448   MockServer server;
449   Connect(client, server);
450   if (HasFailure())
451     return;
452 
453   lldb::tid_t thread_id = 0x23;
454   lldb::user_id_t trace_id = 3;
455 
456   uint8_t buf[32] = {};
457   llvm::MutableArrayRef<uint8_t> buffer(buf, 32);
458   size_t offset = 0;
459 
460   std::future<Status> result = std::async(std::launch::async, [&] {
461     return client.SendGetDataPacket(trace_id, thread_id, buffer, offset);
462   });
463 
464   std::string expected_packet1 =
465       R"(jTraceBufferRead:{"buffersize" : 32,"offset" : 0,"threadid" : 35,)";
466   std::string expected_packet2 = R"("traceid" : 3})";
467   HandlePacket(server, expected_packet1+expected_packet2, "123456");
468   ASSERT_TRUE(result.get().Success());
469   ASSERT_EQ(buffer.size(), 3u);
470   ASSERT_EQ(buf[0], 0x12);
471   ASSERT_EQ(buf[1], 0x34);
472   ASSERT_EQ(buf[2], 0x56);
473 
474   llvm::MutableArrayRef<uint8_t> buffer2(buf, 32);
475   result = std::async(std::launch::async, [&] {
476     return client.SendGetDataPacket(trace_id, thread_id, buffer2, offset);
477   });
478 
479   HandlePacket(server, expected_packet1+expected_packet2, "E23");
480   ASSERT_FALSE(result.get().Success());
481   ASSERT_EQ(buffer2.size(), 0u);
482 }
483 
484 TEST_F(GDBRemoteCommunicationClientTest, SendGetMetaDataPacket) {
485   TestClient client;
486   MockServer server;
487   Connect(client, server);
488   if (HasFailure())
489     return;
490 
491   lldb::tid_t thread_id = 0x23;
492   lldb::user_id_t trace_id = 3;
493 
494   uint8_t buf[32] = {};
495   llvm::MutableArrayRef<uint8_t> buffer(buf, 32);
496   size_t offset = 0;
497 
498   std::future<Status> result = std::async(std::launch::async, [&] {
499     return client.SendGetMetaDataPacket(trace_id, thread_id, buffer, offset);
500   });
501 
502   std::string expected_packet1 =
503       R"(jTraceMetaRead:{"buffersize" : 32,"offset" : 0,"threadid" : 35,)";
504   std::string expected_packet2 = R"("traceid" : 3})";
505   HandlePacket(server, expected_packet1+expected_packet2, "123456");
506   ASSERT_TRUE(result.get().Success());
507   ASSERT_EQ(buffer.size(), 3u);
508   ASSERT_EQ(buf[0], 0x12);
509   ASSERT_EQ(buf[1], 0x34);
510   ASSERT_EQ(buf[2], 0x56);
511 
512   llvm::MutableArrayRef<uint8_t> buffer2(buf, 32);
513   result = std::async(std::launch::async, [&] {
514     return client.SendGetMetaDataPacket(trace_id, thread_id, buffer2, offset);
515   });
516 
517   HandlePacket(server, expected_packet1+expected_packet2, "E23");
518   ASSERT_FALSE(result.get().Success());
519   ASSERT_EQ(buffer2.size(), 0u);
520 }
521 
522 TEST_F(GDBRemoteCommunicationClientTest, SendGetTraceConfigPacket) {
523   TestClient client;
524   MockServer server;
525   Connect(client, server);
526   if (HasFailure())
527     return;
528 
529   lldb::tid_t thread_id = 0x23;
530   lldb::user_id_t trace_id = 3;
531   TraceOptions options;
532   options.setThreadID(thread_id);
533 
534   std::future<Status> result = std::async(std::launch::async, [&] {
535     return client.SendGetTraceConfigPacket(trace_id, options);
536   });
537 
538   const char *expected_packet =
539       R"(jTraceConfigRead:{"threadid" : 35,"traceid" : 3})";
540   std::string response1 =
541       R"({"buffersize" : 8192,"params" : {"psb" : 1,"tracetech" : "intel-pt"})";
542   std::string response2 =
543       R"(],"metabuffersize" : 8192,"threadid" : 35,"type" : 1}])";
544   HandlePacket(server, expected_packet, response1+response2);
545   ASSERT_TRUE(result.get().Success());
546   ASSERT_EQ(options.getTraceBufferSize(), 8192u);
547   ASSERT_EQ(options.getMetaDataBufferSize(), 8192u);
548   ASSERT_EQ(options.getType(), 1);
549 
550   auto custom_params = options.getTraceParams();
551 
552   uint64_t psb_value;
553   llvm::StringRef trace_tech_value;
554 
555   ASSERT_TRUE(custom_params);
556   ASSERT_EQ(custom_params->GetType(), eStructuredDataTypeDictionary);
557   ASSERT_TRUE(custom_params->GetValueForKeyAsInteger("psb", psb_value));
558   ASSERT_EQ(psb_value, 1u);
559   ASSERT_TRUE(
560       custom_params->GetValueForKeyAsString("tracetech", trace_tech_value));
561   ASSERT_STREQ(trace_tech_value.data(), "intel-pt");
562 
563   // Checking error response.
564   std::future<Status> result2 = std::async(std::launch::async, [&] {
565     return client.SendGetTraceConfigPacket(trace_id, options);
566   });
567 
568   HandlePacket(server, expected_packet, "E23");
569   ASSERT_FALSE(result2.get().Success());
570 
571   // Wrong JSON as response.
572   std::future<Status> result3 = std::async(std::launch::async, [&] {
573     return client.SendGetTraceConfigPacket(trace_id, options);
574   });
575 
576   std::string incorrect_json1 =
577       R"("buffersize" : 8192,"params" : {"psb" : 1,"tracetech" : "intel-pt"})";
578   std::string incorrect_json2 =
579       R"(],"metabuffersize" : 8192,"threadid" : 35,"type" : 1}])";
580   HandlePacket(server, expected_packet, incorrect_json1+incorrect_json2);
581   ASSERT_FALSE(result3.get().Success());
582 
583   // Wrong JSON as custom_params.
584   std::future<Status> result4 = std::async(std::launch::async, [&] {
585     return client.SendGetTraceConfigPacket(trace_id, options);
586   });
587 
588   std::string incorrect_custom_params1 =
589       R"({"buffersize" : 8192,"params" : "psb" : 1,"tracetech" : "intel-pt"})";
590   std::string incorrect_custom_params2 =
591       R"(],"metabuffersize" : 8192,"threadid" : 35,"type" : 1}])";
592   HandlePacket(server, expected_packet, incorrect_custom_params1+
593       incorrect_custom_params2);
594   ASSERT_FALSE(result4.get().Success());
595 }
596