It appears to be an order problem. DemoPrivateProtobuf is leaking state into TestClientInput which comes soon after it:
[----------] 4 tests from DemoPrivateProtobuf
[ RUN ] DemoPrivateProtobuf.client_calls_server
[ OK ] DemoPrivateProtobuf.client_calls_server (469 ms)
[ RUN ] DemoPrivateProtobuf.wrapping_message_processor
[ OK ] DemoPrivateProtobuf.wrapping_message_processor (53 ms)
[ RUN ] DemoPrivateProtobuf.server_receives_function_call
[ OK ] DemoPrivateProtobuf.server_receives_function_call (108 ms)
[ RUN ] DemoPrivateProtobuf.client_receives_result
[ OK ] DemoPrivateProtobuf.client_receives_result (58 ms)
[----------] 4 tests from DemoPrivateProtobuf (688 ms total)
...
[----------] 9 tests from TestClientInput
[ RUN ] TestClientInput.clients_receive_key_input
==28645==
==28645== HEAP SUMMARY:
==28645== in use at exit: 19,006 bytes in 279 blocks
==28645== total heap usage: 47,756 allocs, 47,477 frees, 3,006,909 bytes allocated
==28645==
==28645== 3,442 (1,008 direct, 2,434 indirect) bytes in 1 blocks are definitely lost in loss record 246 of 246
==28645== at 0x4C2A980: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28645== by 0x5649B3F: mir_default_connect(char const*, char const*, void (*)(MirConnection*, void*), void*) (mir_client_library.cpp:104)
==28645== by 0x5648A94: mir_connect (mir_client_library.cpp:146)
==28645== by 0x56493C5: mir_connect_sync (mir_client_library.cpp:172)
==28645== by 0x61C80B: DemoPrivateProtobuf_client_calls_server_Test::TestBody() (test_protobuf.cpp:186)
...
[ FAILED ] TestClientInput.clients_receive_key_input (4229 ms)
It appears to be an order problem. DemoPrivateProtobuf is leaking state into TestClientInput which comes soon after it:
[----------] 4 tests from DemoPrivateProtobuf obuf.client_ calls_server obuf.client_ calls_server (469 ms) obuf.wrapping_ message_ processor obuf.wrapping_ message_ processor (53 ms) obuf.server_ receives_ function_ call obuf.server_ receives_ function_ call (108 ms) obuf.client_ receives_ result obuf.client_ receives_ result (58 ms)
[ RUN ] DemoPrivateProt
[ OK ] DemoPrivateProt
[ RUN ] DemoPrivateProt
[ OK ] DemoPrivateProt
[ RUN ] DemoPrivateProt
[ OK ] DemoPrivateProt
[ RUN ] DemoPrivateProt
[ OK ] DemoPrivateProt
[----------] 4 tests from DemoPrivateProtobuf (688 ms total)
...
[----------] 9 tests from TestClientInput .clients_ receive_ key_input valgrind/ vgpreload_ memcheck- amd64-linux. so) connect( char const*, char const*, void (*)(MirConnection*, void*), void*) (mir_client_ library. cpp:104) library. cpp:146) library. cpp:172) obuf_client_ calls_server_ Test::TestBody( ) (test_protobuf. cpp:186) .clients_ receive_ key_input (4229 ms)
[ RUN ] TestClientInput
==28645==
==28645== HEAP SUMMARY:
==28645== in use at exit: 19,006 bytes in 279 blocks
==28645== total heap usage: 47,756 allocs, 47,477 frees, 3,006,909 bytes allocated
==28645==
==28645== 3,442 (1,008 direct, 2,434 indirect) bytes in 1 blocks are definitely lost in loss record 246 of 246
==28645== at 0x4C2A980: operator new(unsigned long) (in /usr/lib/
==28645== by 0x5649B3F: mir_default_
==28645== by 0x5648A94: mir_connect (mir_client_
==28645== by 0x56493C5: mir_connect_sync (mir_client_
==28645== by 0x61C80B: DemoPrivateProt
...
[ FAILED ] TestClientInput