X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tst%2Fsyncstorageimpl_test.cpp;h=aea2346e12a1a4073c73cae023125b0763ed371b;hb=cc9244cd1baddc6f3ef96bbec5662239afc9f3c2;hp=4176852d29004b947bfc85f98f09c5826134ac01;hpb=ef2bf51d04aaf01fa0cabdcaf905b23423067662;p=ric-plt%2Fsdl.git diff --git a/tst/syncstorageimpl_test.cpp b/tst/syncstorageimpl_test.cpp index 4176852..aea2346 100644 --- a/tst/syncstorageimpl_test.cpp +++ b/tst/syncstorageimpl_test.cpp @@ -343,7 +343,7 @@ TEST_F(SyncStorageImplTest, SetIfNotExistsSuccessfully) expectSetIfNotExistsAsync("key1", { 0x0a, 0x0b, 0x0c }); expectPollWait(); expectModifyIfAck(std::error_code(), true); - EXPECT_EQ(true, syncStorage->setIfNotExists(ns, "key1", { 0x0a, 0x0b, 0x0c })); + EXPECT_TRUE(syncStorage->setIfNotExists(ns, "key1", { 0x0a, 0x0b, 0x0c })); } TEST_F(SyncStorageImplTest, SetIfNotExistsReturnsFalseIfKeyAlreadyExists) @@ -353,7 +353,7 @@ TEST_F(SyncStorageImplTest, SetIfNotExistsReturnsFalseIfKeyAlreadyExists) expectSetIfNotExistsAsync("key1", { 0x0a, 0x0b, 0x0c }); expectPollWait(); expectModifyIfAck(std::error_code(), false); - EXPECT_EQ(false, syncStorage->setIfNotExists(ns, "key1", { 0x0a, 0x0b, 0x0c })); + EXPECT_FALSE(syncStorage->setIfNotExists(ns, "key1", { 0x0a, 0x0b, 0x0c })); } TEST_F(SyncStorageImplTest, SetIfNotExistsCanThrowBackendError) @@ -414,7 +414,7 @@ TEST_F(SyncStorageImplTest, RemoveIfSuccessfully) expectRemoveIfAsync("key1", { 0x0a, 0x0b, 0x0c }); expectPollWait(); expectModifyIfAck(std::error_code(), true); - EXPECT_EQ(true, syncStorage->removeIf(ns, "key1", { 0x0a, 0x0b, 0x0c })); + EXPECT_TRUE(syncStorage->removeIf(ns, "key1", { 0x0a, 0x0b, 0x0c })); } TEST_F(SyncStorageImplTest, RemoveIfReturnsFalseIfKeyDoesnotMatch) @@ -424,7 +424,7 @@ TEST_F(SyncStorageImplTest, RemoveIfReturnsFalseIfKeyDoesnotMatch) expectRemoveIfAsync("key1", { 0x0a, 0x0b, 0x0c }); expectPollWait(); expectModifyIfAck(std::error_code(), false); - EXPECT_EQ(false, syncStorage->removeIf(ns, "key1", { 0x0a, 0x0b, 0x0c })); + EXPECT_FALSE(syncStorage->removeIf(ns, "key1", { 0x0a, 0x0b, 0x0c })); } TEST_F(SyncStorageImplTest, RemoveIfCanThrowBackendError) @@ -557,6 +557,10 @@ TEST_F(SyncStorageImplTest, AllDispatcherErrorCodesThrowCorrectException) expectModifyIfAck(aec, false); EXPECT_THROW(syncStorage->setIfNotExists(ns, "key1", { 0x0a, 0x0b, 0x0c }), BackendError); break; + case AsyncRedisCommandDispatcherErrorCode::WRITING_TO_SLAVE: + expectModifyIfAck(aec, false); + EXPECT_THROW(syncStorage->setIfNotExists(ns, "key1", { 0x0a, 0x0b, 0x0c }), BackendError); + break; default: FAIL() << "No mapping for AsyncRedisCommandDispatcherErrorCode value: " << aec; break;