Unit Test#

Coverage: 98.3% (58 of 59 items OK)

[MISSING] GoogleTest Test ClientConnectionTest:Constructed

Traces to:

  • unknown tracing target req MessagePassingComponent.REQ_MP_COMP_001


Source: score/message_passing/client_connection_test.cpp:333

[OK] GoogleTest Test ClientConnectionTest:ConstructedStopDoesNothing
[OK] GoogleTest Test ClientConnectionTest:TryingToConnectOnceStoppingWhileConnecting
[OK] GoogleTest Test ClientConnectionTest:TryingToSyncConnectOnceStoppingWhileConnecting
[OK] GoogleTest Test ClientConnectionTest:TryingToConnectOnceStoppingOnHardError
[OK] GoogleTest Test ClientConnectionTest:TryingToSyncConnectOnceStoppingOnHardError
[OK] GoogleTest Test ClientConnectionTest:TryingToConnectMultipleTimesStoppingOnPermissionError
[OK] GoogleTest Test ClientConnectionTest:TryingToSyncConnectMultipleTimesStoppingOnPermissionError
[OK] GoogleTest Test ClientConnectionTest:TryingToConnectMultipleTimesFinallyConnectingAndImplicitlyStopping
[OK] GoogleTest Test ClientConnectionTest:SuccessfullyConnectingAtFirstAttemptThenExplicitlyStopping
[OK] GoogleTest Test ClientConnectionTest:SuccessfullyConnectingAtFirstAttemptWithDelayThenExplicitlyStopping
[OK] GoogleTest Test ClientConnectionTest:SuccessfullySyncConnectingAtFirstAttemptThenExplicitlyStopping
[OK] GoogleTest Test ClientConnectionTest:SuccessfullyConnectingAtFirstAttemptThenExplicitlyStoppingAsIfFromCallback
[OK] GoogleTest Test ClientConnectionTest:SuccessfullySyncConnectingAtFirstAttemptThenExplicitlyStoppingAsIfFromCallback
[OK] GoogleTest Test ClientConnectionTest:SuccessfullyConnectingAtFirstAttemptThenFirstReadDisconnected
Given:

client connection established successfully

When:

protocol receive returns EPIPE

Then:

connection stops with reason kClosedByPeer


Derived from:


Source: score/message_passing/client_connection_test.cpp:575

[OK] GoogleTest Test ClientConnectionTest:SuccessfullyConnectingAtFirstAttemptThenSpuriousReadGetsIgnored
Given:

client connection established successfully

When:

protocol receive returns EAGAIN (spurious wake-up)

Then:

connection remains in kReady state


Derived from:


Source: score/message_passing/client_connection_test.cpp:593

[OK] GoogleTest Test ClientConnectionTest:NotConnectedSendNotReady
Given:

client connection not yet connected

When:

Send, SendWaitReply, or SendWithCallback is called

Then:

each call returns EINVAL


Derived from:


Source: score/message_passing/client_connection_test.cpp:609

[OK] GoogleTest Test ClientConnectionTest:ConnectedRestartdDoesNothing
[OK] GoogleTest Test ClientConnectionTest:SendTooLarge
Verifies:

MessagePassing.SendBufferArgumentValidation, MessagePassing.BE_MessageTooBig

Given:

client connection established with max_send_size = kMaxSendSize

When:

any send variant is called with a buffer larger than kMaxSendSize

Then:

each call returns EMSGSIZE


Source: score/message_passing/client_connection_test.cpp:644

[OK] GoogleTest Test ClientConnectionTest:SendIsDirectWithOurDefaultConfig
[OK] GoogleTest Test ClientConnectionTest:SendIsDirectWithFullyOrderedAndEmptyQueue
[OK] GoogleTest Test ClientConnectionTest:GivenTrulyAsyncWhenSendIsCalledItIsQueued
Given:

truly-async client connection with send queue capacity of 2

When:

three Send calls are made before the queue is flushed

Then:

first two succeed, third returns ENOBUFS


Derived from:


Source: score/message_passing/client_connection_test.cpp:701

[OK] GoogleTest Test ClientConnectionTest:SendIsNotQueuedIfTrulyAsyncButNoSlots
Given:

truly-async client connection with send queue capacity of 0

When:

Send is called

Then:

call returns ENOBUFS


Derived from:


Source: score/message_passing/client_connection_test.cpp:738

[OK] GoogleTest Test ClientConnectionTest:SendWaitReplyFailsWhenCalledInCallback
Given:

client connection established and a callback is executing on the callback thread

When:

SendWaitReply is called from within the callback

Then:

call returns EAGAIN


Derived from:


Source: score/message_passing/client_connection_test.cpp:758

[OK] GoogleTest Test ClientConnectionTest:SendWaitReplyFailsWhenCannotSendMessageDirectly
Given:

client connection established

When:

SendWaitReply is called but SendProtocolMessage returns EPIPE

Then:

SendWaitReply returns EPIPE


Derived from:


Source: score/message_passing/client_connection_test.cpp:780

[OK] GoogleTest Test ClientConnectionTest:SendWaitReplyFailsDirectlyButUnblocksQueue
Given:

truly-async client connection with a message already queued

When:

SendWaitReply fails immediately with EPIPE

Then:

queued send is unblocked and dispatched via the next queue command


Derived from:


Source: score/message_passing/client_connection_test.cpp:803

[OK] GoogleTest Test ClientConnectionTest:SendWaitReplyFailsWhenCannotQueueMessage
Given:

truly-async client connection with one send queue slot already occupied

When:

SendWaitReply is called

Then:

call returns ENOBUFS


Derived from:


Source: score/message_passing/client_connection_test.cpp:836

[OK] GoogleTest Test ClientConnectionTest:SendWaitReplyFailsWhenQueuedMessageCancels
Given:

truly-async client connection with a SendWaitReply blocked waiting for a reply

When:

connection is stopped before the server sends the reply

Then:

SendWaitReply returns EPIPE


Derived from:


Source: score/message_passing/client_connection_test.cpp:867

[OK] GoogleTest Test ClientConnectionTest:SendWaitReplyFailsWhenReceiveTooLong
Verifies:

MessagePassing.SendBufferArgumentValidation, MessagePassing.BE_MessageTooBig

Given:

client connection established with max_reply_size = kMaxReplySize

When:

server sends a reply larger than kMaxReplySize

Then:

SendWaitReply returns EMSGSIZE


Source: score/message_passing/client_connection_test.cpp:908

[OK] GoogleTest Test ClientConnectionTest:SendWithCallbackFailsWhenCannotSendMessageDirectly
Given:

client connection established

When:

SendWithCallback is called but SendProtocolMessage returns EPIPE

Then:

SendWithCallback returns EPIPE


Derived from:


Source: score/message_passing/client_connection_test.cpp:935

[OK] GoogleTest Test ClientConnectionTest:SendWithCallbackFailsWhenCannotQueueMessage
Given:

client connection with no async reply slots and no send queue slots

When:

SendWithCallback is called a second time while the first reply is still pending

Then:

second call returns ENOBUFS


Derived from:


Source: score/message_passing/client_connection_test.cpp:957

[OK] GoogleTest Test ClientConnectionTest:SendWithCallbackFailsWhenCannotQueueMessageTrulyAsync
Given:

truly-async client connection with no async reply slots and no send queue slots

When:

SendWithCallback is called

Then:

call immediately returns ENOBUFS


Derived from:


Source: score/message_passing/client_connection_test.cpp:986

[OK] GoogleTest Test ClientConnectionTest:SendWithCallbackReportsFailureWhenQueuedSendFailsTrulyAsync
Given:

truly-async client connection with one async reply slot and a send queued for dispatch

When:

the queued send dispatches but SendProtocolMessage returns EPIPE

Then:

the reply callback is invoked with EPIPE


Derived from:


Source: score/message_passing/client_connection_test.cpp:1008

[OK] GoogleTest Test ClientConnectionTest:SendWithCallbackStillHasItsSlotBusyWhenQueuedSendHappensTrulyAsync
Given:

truly-async client connection with one async reply slot busy with a pending SendWithCallback

When:

queued send dispatches and a second SendWithCallback is attempted concurrently

Then:

second SendWithCallback returns ENOBUFS preventing concurrent slot reuse


Derived from:


Source: score/message_passing/client_connection_test.cpp:1040

[OK] GoogleTest Test ClientConnectionTest:QueuedSendsCancelIfConnectionClosed
Given:

truly-async client connection with queued sends and a SendWaitReply pending reply

When:

connection is stopped before any reply is received

Then:

all pending callbacks and SendWaitReply receive EPIPE


Derived from:


Source: score/message_passing/client_connection_test.cpp:1080

[OK] GoogleTest Test ClientConnectionTest:ConnectedStopsIfReceivesIoError
Given:

client connection established

When:

protocol receive returns EIO

Then:

connection stops with reason kIoError


Derived from:


Source: score/message_passing/client_connection_test.cpp:1127

[OK] GoogleTest Test ClientConnectionTest:ConnectedStopsIfReceivesInvalidCode
Given:

client connection established

When:

protocol receive returns an unrecognised message code

Then:

connection stops with reason kIoError


Derived from:


Source: score/message_passing/client_connection_test.cpp:1145

[OK] GoogleTest Test ClientConnectionTest:ConnectedStopsIfReceivesReplyWithoutSend
Given:

client connection established with no pending SendWaitReply

When:

a REPLY message arrives unexpectedly

Then:

connection stops with reason kIoError


Derived from:


Source: score/message_passing/client_connection_test.cpp:1163

[OK] GoogleTest Test ClientConnectionTest:ConnectedContinuesIfReceivesNotifyWithoutCallback
[OK] GoogleTest Test ClientConnectionTest:ConnectedReceivesNotifyInCallback
[OK] GoogleTest Test ClientConnectionTest:ConnectedContinuesIfReceivesPingWithoutCallback
[OK] GoogleTest Test ClientConnectionTest:ConnectedReceivesPingInCallback
[OK] GoogleTest Test UnixDomainServerTest:NonRunningServers
[OK] GoogleTest Test UnixDomainServerTest:RunningServersWithNoConnections
[OK] GoogleTest Test UnixDomainServerTest:RunningServersWithSameId
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingFirst/0
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingFirst/1
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingLater/0
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingLater/1
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingLaterClientDeleted/0
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingLaterClientDeleted/1
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingLaterClientRestarting/0
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:RefusingServerStartingLaterClientRestarting/1
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:EchoServerStartingLaterForcedStop/0
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:EchoServerStartingLaterForcedStop/1
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:EchoServerSetup/0
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:EchoServerSetup/1
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:EchoServerClientRestart/0
[OK] GoogleTest Test UnixDomain/ServerToClientTestFixtureUnix:EchoServerClientRestart/1