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
kReadystate
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, orSendWithCallbackis 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
Sendcalls 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:
Sendis 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:
SendWaitReplyis 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:
SendWaitReplyis called butSendProtocolMessagereturnsEPIPE- Then:
SendWaitReplyreturnsEPIPE
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:
SendWaitReplyfails immediately withEPIPE- 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:
SendWaitReplyis 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
SendWaitReplyblocked waiting for a reply- When:
connection is stopped before the server sends the reply
- Then:
SendWaitReplyreturnsEPIPE
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:
SendWaitReplyreturnsEMSGSIZE
Source: score/message_passing/client_connection_test.cpp:908
[OK] GoogleTest Test ClientConnectionTest:SendWithCallbackFailsWhenCannotSendMessageDirectly
- Given:
client connection established
- When:
SendWithCallbackis called butSendProtocolMessagereturnsEPIPE- Then:
SendWithCallbackreturnsEPIPE
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:
SendWithCallbackis 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:
SendWithCallbackis 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
SendProtocolMessagereturnsEPIPE- 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
SendWithCallbackis attempted concurrently- Then:
second
SendWithCallbackreturnsENOBUFSpreventing 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
SendWaitReplypending reply- When:
connection is stopped before any reply is received
- Then:
all pending callbacks and
SendWaitReplyreceiveEPIPE
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
REPLYmessage arrives unexpectedly- Then:
connection stops with reason
kIoError
Derived from:
Source: score/message_passing/client_connection_test.cpp:1163