59 + static void heap_deleter(unsigned char* b) { if (b != nullptr) delete[] b; }
It is safe to call delete[] with nullptr (and doing so avoids the test here as well as in the library)
~~~~
345 +struct LargeMessages : mir_test_framework::InProcessServer 346 +{ 347 + LargeMessagesServerConfiguration large_messages_server_config; 348 + 349 + mir::DefaultServerConfiguration& server_config() override 350 + { 351 + return large_messages_server_config; 352 + } 353 +}; 354 355 +struct ConnectionContext 356 +{ 357 + mt::WaitObject connected; 358 + MirConnection* connection{nullptr}; 359 +}; 360 + 361 +void connection_callback(MirConnection* connection, void* context) 362 +{ 363 + auto connection_context = static_cast<ConnectionContext*>(context); 364 + connection_context->connection = connection; 365 + connection_context->connected.notify_ready(); 366 +}
You could avoid this (and some related code in the test body) by:
using LargeMessages = mir_test_framework::BasicClientServerFixture<LargeMessagesServerConfiguration>;
« Back to merge proposal
59 + static void heap_deleter( unsigned char* b) { if (b != nullptr) delete[] b; }
It is safe to call delete[] with nullptr (and doing so avoids the test here as well as in the library)
~~~~
345 +struct LargeMessages : mir_test_ framework: :InProcessServe r rverConfigurati on large_messages_ server_ config; verConfiguratio n& server_config() override server_ config; nullptr} ; callback( MirConnection* connection, void* context) cast<Connection Context* >(context) ; context- >connection = connection; context- >connected. notify_ ready() ;
346 +{
347 + LargeMessagesSe
348 +
349 + mir::DefaultSer
350 + {
351 + return large_messages_
352 + }
353 +};
354
355 +struct ConnectionContext
356 +{
357 + mt::WaitObject connected;
358 + MirConnection* connection{
359 +};
360 +
361 +void connection_
362 +{
363 + auto connection_context = static_
364 + connection_
365 + connection_
366 +}
You could avoid this (and some related code in the test body) by:
using LargeMessages = mir_test_ framework: :BasicClientSer verFixture< LargeMessagesSe rverConfigurati on>;