X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tst%2Fasynchirediscommanddispatcher_test.cpp;h=05f42e9f1f7c2418080fb45972832273d57f5a43;hb=8324d029ce006509ddbc605446d05987c17e0368;hp=55e9ac7b96f7e96b8ef3c7240bd6068c31d516f3;hpb=ef2bf51d04aaf01fa0cabdcaf905b23423067662;p=ric-plt%2Fsdl.git diff --git a/tst/asynchirediscommanddispatcher_test.cpp b/tst/asynchirediscommanddispatcher_test.cpp index 55e9ac7..05f42e9 100644 --- a/tst/asynchirediscommanddispatcher_test.cpp +++ b/tst/asynchirediscommanddispatcher_test.cpp @@ -280,7 +280,8 @@ namespace false, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); } ~AsyncHiredisCommandDispatcherDisconnectedTest() @@ -305,7 +306,8 @@ namespace true, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); } ~AsyncHiredisCommandDispatcherWithPermanentCommandCallbacksTest() @@ -397,6 +399,33 @@ namespace }; using AsyncHiredisCommandDispatcherDeathTest = AsyncHiredisCommandDispatcherConnectedTest; + + class AsyncHiredisCommandDispatcherForSentinelTest: public AsyncHiredisCommandDispatcherBaseTest + { + public: + AsyncHiredisCommandDispatcherForSentinelTest() + { + InSequence dummy; + expectationsUntilConnect(); + expectAdapterAttach(); + expectRedisAsyncSetConnectCallback(); + expectRedisAsyncSetDisconnectCallback(); + dispatcher.reset(new AsyncHiredisCommandDispatcher(engineMock, + "host", + htons(6379U), + contentsBuilderMock, + true, + hiredisSystemMock, + adapterMock, + logger, + true)); + } + + ~AsyncHiredisCommandDispatcherForSentinelTest() + { + expectRedisAsyncFree(); + } + }; } TEST_F(AsyncHiredisCommandDispatcherDisconnectedTest, IsNotCopyable) @@ -439,7 +468,8 @@ TEST_F(AsyncHiredisCommandDispatcherDisconnectedTest, ContextErrorInConnectArmsR false, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); expectDisarmConnectionRetryTimer(); } @@ -457,7 +487,8 @@ TEST_F(AsyncHiredisCommandDispatcherBaseTest, NullRedisContextInConnectArmsRetry false, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); } TEST_F(AsyncHiredisCommandDispatcherDisconnectedTest, FailedCommandListQueryArmsRetryTimer) @@ -947,3 +978,10 @@ TEST_F(AsyncHiredisCommandDispatcherDeathTest, TooManyRepliesAborts) savedCb(&ac, &redisReplyBuilder.buildNilReply(), savedPd); EXPECT_EXIT(savedCb(&ac, &redisReplyBuilder.buildNilReply(), savedPd), KilledBySignal(SIGABRT), ""); } + +TEST_F(AsyncHiredisCommandDispatcherForSentinelTest, CommandListInquiryIsNotSent) +{ + EXPECT_CALL(hiredisSystemMock, redisAsyncCommandArgv(_, _, _, _, _, _)) + .Times(0); + connected(&ac, 0); +}