X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tst%2Fasynchirediscommanddispatcher_test.cpp;h=045e459d56f95f94f65f7da9208b2ed66994e792;hb=refs%2Fchanges%2F37%2F4137%2F1;hp=55e9ac7b96f7e96b8ef3c7240bd6068c31d516f3;hpb=ef2bf51d04aaf01fa0cabdcaf905b23423067662;p=ric-plt%2Fsdl.git diff --git a/tst/asynchirediscommanddispatcher_test.cpp b/tst/asynchirediscommanddispatcher_test.cpp index 55e9ac7..045e459 100644 --- a/tst/asynchirediscommanddispatcher_test.cpp +++ b/tst/asynchirediscommanddispatcher_test.cpp @@ -14,6 +14,11 @@ limitations under the License. */ +/* + * This source code is part of the near-RT RIC (RAN Intelligent Controller) + * platform project (RICP). +*/ + #include #include #include @@ -280,7 +285,8 @@ namespace false, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); } ~AsyncHiredisCommandDispatcherDisconnectedTest() @@ -305,7 +311,8 @@ namespace true, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); } ~AsyncHiredisCommandDispatcherWithPermanentCommandCallbacksTest() @@ -397,6 +404,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 +473,8 @@ TEST_F(AsyncHiredisCommandDispatcherDisconnectedTest, ContextErrorInConnectArmsR false, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); expectDisarmConnectionRetryTimer(); } @@ -457,7 +492,8 @@ TEST_F(AsyncHiredisCommandDispatcherBaseTest, NullRedisContextInConnectArmsRetry false, hiredisSystemMock, adapterMock, - logger)); + logger, + false)); } TEST_F(AsyncHiredisCommandDispatcherDisconnectedTest, FailedCommandListQueryArmsRetryTimer) @@ -947,3 +983,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); +}