diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp index f4a3a62ee..f6e13b84b 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_commandprocessorfactory.t.cpp @@ -54,7 +54,8 @@ static void test1_breathingTest() fileManager, bsl::cout, bmqtst::TestHelperUtil::allocator()); - ASSERT(dynamic_cast(cmdProcessor.get()) != 0); + BMQTST_ASSERT(dynamic_cast(cmdProcessor.get()) != + 0); } // ============================================================================ diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp index 437b27297..7bfe25df4 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp @@ -965,8 +965,8 @@ static void test12_printMessagesDetailsTest() for (size_t i = 0; i < confirmedGUIDS.size(); i++) { // Check Message type size_t foundIdx = resultString.find(messageRecordCaption, startIdx); - ASSERT_D(messageRecordCaption, (foundIdx != bsl::string::npos)); - ASSERT_D(messageRecordCaption, (foundIdx >= startIdx)); + BMQTST_ASSERT_D(messageRecordCaption, (foundIdx != bsl::string::npos)); + BMQTST_ASSERT_D(messageRecordCaption, (foundIdx >= startIdx)); startIdx = foundIdx + bsl::strlen(messageRecordCaption); // Check GUID @@ -974,20 +974,20 @@ static void test12_printMessagesDetailsTest() outputGuidString(ss, confirmedGUIDS.at(i)); bsl::string guidStr(ss.str(), bmqtst::TestHelperUtil::allocator()); foundIdx = resultString.find(guidStr, startIdx); - ASSERT_D(guidStr, (foundIdx != bsl::string::npos)); - ASSERT_D(guidStr, (foundIdx >= startIdx)); + BMQTST_ASSERT_D(guidStr, (foundIdx != bsl::string::npos)); + BMQTST_ASSERT_D(guidStr, (foundIdx >= startIdx)); startIdx = foundIdx + guidStr.length(); // Check Confirm type foundIdx = resultString.find(confirmRecordCaption, startIdx); - ASSERT_D(confirmRecordCaption, (foundIdx != bsl::string::npos)); - ASSERT_D(confirmRecordCaption, (foundIdx >= startIdx)); + BMQTST_ASSERT_D(confirmRecordCaption, (foundIdx != bsl::string::npos)); + BMQTST_ASSERT_D(confirmRecordCaption, (foundIdx >= startIdx)); startIdx = foundIdx + bsl::strlen(messageRecordCaption); // Check Delete type foundIdx = resultString.find(deleteRecordCaption, startIdx); - ASSERT_D(deleteRecordCaption, (foundIdx != bsl::string::npos)); - ASSERT_D(deleteRecordCaption, (foundIdx >= startIdx)); + BMQTST_ASSERT_D(deleteRecordCaption, (foundIdx != bsl::string::npos)); + BMQTST_ASSERT_D(deleteRecordCaption, (foundIdx >= startIdx)); startIdx = foundIdx + bsl::strlen(messageRecordCaption); } } @@ -1047,7 +1047,7 @@ static void test13_searchMessagesWithPayloadDumpTest() MESSAGES, k_NUM_MSGS, messageOffsets); - ASSERT(pd != 0); + BMQTST_ASSERT(pd != 0); BMQTST_ASSERT_GT(mfdData.fileSize(), 0ULL); // Create data file iterator DataFileIterator dataIt(&mfdData, fileHeader); @@ -1115,8 +1115,8 @@ static void test13_searchMessagesWithPayloadDumpTest() bsl::string guidStr(ss.str(), bmqtst::TestHelperUtil::allocator()); size_t foundIdx = resultString.find(guidStr, startIdx); - ASSERT_D(guidStr, (foundIdx != bsl::string::npos)); - ASSERT_D(guidStr, (foundIdx >= startIdx)); + BMQTST_ASSERT_D(guidStr, (foundIdx != bsl::string::npos)); + BMQTST_ASSERT_D(guidStr, (foundIdx >= startIdx)); startIdx = foundIdx + guidStr.length(); @@ -1124,8 +1124,8 @@ static void test13_searchMessagesWithPayloadDumpTest() bsl::string dumpStr = expectedPayloadSubstring[i]; foundIdx = resultString.find(dumpStr, startIdx); - ASSERT_D(dumpStr, (foundIdx != bsl::string::npos)); - ASSERT_D(guidStr, (foundIdx >= startIdx)); + BMQTST_ASSERT_D(dumpStr, (foundIdx != bsl::string::npos)); + BMQTST_ASSERT_D(guidStr, (foundIdx >= startIdx)); startIdx = foundIdx + dumpStr.length(); } @@ -1183,7 +1183,7 @@ static void test14_summaryTest() "Number of outstanding messages: 2\nOutstanding ratio: 40% (2/5)\n"; bsl::string res(resultStream.str(), bmqtst::TestHelperUtil::allocator()); - ASSERT(res.starts_with(expectedStream.str())); + BMQTST_ASSERT(res.starts_with(expectedStream.str())); } static void test15_timestampSearchTest() @@ -1212,7 +1212,7 @@ static void test15_timestampSearchTest() const bsls::Types::Uint64& ts) { BMQTST_ASSERT_GT(it.recordHeader().timestamp(), ts); - ASSERT(!it.isReverseMode()); + BMQTST_ASSERT(!it.isReverseMode()); // Check previous record it.flipDirection(); BMQTST_ASSERT_EQ(it.nextRecord(), 1); @@ -1272,7 +1272,7 @@ static void test15_timestampSearchTest() // specified iterator, which is initially backward BMQTST_ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts1); journalFileIt.flipDirection(); - ASSERT(journalFileIt.isReverseMode()); + BMQTST_ASSERT(journalFileIt.isReverseMode()); BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts1), 1); @@ -1282,7 +1282,7 @@ static void test15_timestampSearchTest() // specified iterator, which is initially backward BMQTST_ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts2); journalFileIt.flipDirection(); - ASSERT(journalFileIt.isReverseMode()); + BMQTST_ASSERT(journalFileIt.isReverseMode()); BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts2), 1); @@ -1304,7 +1304,7 @@ static void test15_timestampSearchTest() 0); BMQTST_ASSERT_EQ(journalFileIt.recordIndex(), k_NUM_RECORDS - 1); BMQTST_ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts); - ASSERT(!journalFileIt.isReverseMode()); + BMQTST_ASSERT(!journalFileIt.isReverseMode()); } { @@ -1321,7 +1321,7 @@ static void test15_timestampSearchTest() 1); BMQTST_ASSERT_EQ(journalFileIt.recordIndex(), 0U); BMQTST_ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts); - ASSERT(!journalFileIt.isReverseMode()); + BMQTST_ASSERT(!journalFileIt.isReverseMode()); } } diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp index 1c1aa77f9..d1d9f8747 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_searchresultfactory.t.cpp @@ -55,7 +55,7 @@ static void test1_breathingTest() fileManager, bsl::cout, bmqtst::TestHelperUtil::allocator()); - ASSERT(dynamic_cast(searchResult.get()) != 0); + BMQTST_ASSERT(dynamic_cast(searchResult.get()) != 0); } // ============================================================================ diff --git a/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp b/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp index b6eeb2090..dcf0c0502 100644 --- a/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp @@ -306,13 +306,13 @@ static void test1_breathingTest() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is NOT abstract"); - ASSERT(!testObj.testAbstract()); + BMQTST_ASSERT(!testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); PV("Verify that methods are public and virtual"); @@ -481,135 +481,142 @@ static void test2_instanceInvariants() const bmqa::AbstractSession::CloseQueueCallback closeQueueCallback; // Base class instance - ASSERT_OPT_FAIL(concreteObj.start(dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.startAsync(dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.stop()); - ASSERT_OPT_FAIL(concreteObj.stopAsync()); - ASSERT_OPT_FAIL(concreteObj.finalizeStop()); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL(concreteObj.start(dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.startAsync(dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.stop()); + BMQTST_ASSERT_OPT_FAIL(concreteObj.stopAsync()); + BMQTST_ASSERT_OPT_FAIL(concreteObj.finalizeStop()); + BMQTST_ASSERT_OPT_FAIL( concreteObj.loadMessageEventBuilder(dummyMessageEventBuilderPtr)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( concreteObj.loadConfirmEventBuilder(dummyConfirmEventBuilderPtr)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( concreteObj.loadMessageProperties(dummyMessagePropertiesPtr)); - ASSERT_OPT_FAIL(concreteObj.getQueueId(dummyQueueIdPtr, dummyUri)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL(concreteObj.getQueueId(dummyQueueIdPtr, dummyUri)); + BMQTST_ASSERT_OPT_FAIL( concreteObj.getQueueId(dummyQueueIdPtr, dummyCorrelationId)); - ASSERT_OPT_FAIL(concreteObj.openQueue(dummyQueueIdPtr, - dummyUri, - 0, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.openQueueSync(dummyQueueIdPtr, - dummyUri, - 0, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.openQueueAsync(dummyQueueIdPtr, - dummyUri, - 0, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.openQueueAsync(dummyQueueIdPtr, - dummyUri, - 0, - openQueueCallback, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.configureQueue(dummyQueueIdPtr, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.configureQueueSync(dummyQueueIdPtr, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.configureQueueAsync(dummyQueueIdPtr, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.configureQueueAsync(dummyQueueIdPtr, - dummyQueueOptions, - configureQueueCallback, - dummyTimeInterval)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL(concreteObj.openQueue(dummyQueueIdPtr, + dummyUri, + 0, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.openQueueSync(dummyQueueIdPtr, + dummyUri, + 0, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.openQueueAsync(dummyQueueIdPtr, + dummyUri, + 0, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.openQueueAsync(dummyQueueIdPtr, + dummyUri, + 0, + openQueueCallback, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.configureQueue(dummyQueueIdPtr, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.configureQueueSync(dummyQueueIdPtr, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.configureQueueAsync(dummyQueueIdPtr, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL( + concreteObj.configureQueueAsync(dummyQueueIdPtr, + dummyQueueOptions, + configureQueueCallback, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL( concreteObj.closeQueue(dummyQueueIdPtr, dummyTimeInterval)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( concreteObj.closeQueueSync(dummyQueueIdPtr, dummyTimeInterval)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( concreteObj.closeQueueAsync(dummyQueueIdPtr, dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.closeQueueAsync(dummyQueueIdPtr, - closeQueueCallback, - dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.nextEvent(dummyTimeInterval)); - ASSERT_OPT_FAIL(concreteObj.post(dummyMessageEvent)); - ASSERT_OPT_FAIL(concreteObj.confirmMessage(dummyMessage)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL(concreteObj.closeQueueAsync(dummyQueueIdPtr, + closeQueueCallback, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.nextEvent(dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.post(dummyMessageEvent)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.confirmMessage(dummyMessage)); + BMQTST_ASSERT_OPT_FAIL( concreteObj.confirmMessage(dummyMessageConfirmationCookie)); - ASSERT_OPT_FAIL(concreteObj.confirmMessages(dummyConfirmEventBuilderPtr)); - ASSERT_OPT_FAIL(concreteObj.configureMessageDumping("")); + BMQTST_ASSERT_OPT_FAIL( + concreteObj.confirmMessages(dummyConfirmEventBuilderPtr)); + BMQTST_ASSERT_OPT_FAIL(concreteObj.configureMessageDumping("")); // Derived instance - ASSERT_OPT_FAIL(testObj.start(dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.startAsync(dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.stop()); - ASSERT_OPT_FAIL(testObj.stopAsync()); - ASSERT_OPT_FAIL(testObj.finalizeStop()); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL(testObj.start(dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.startAsync(dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.stop()); + BMQTST_ASSERT_OPT_FAIL(testObj.stopAsync()); + BMQTST_ASSERT_OPT_FAIL(testObj.finalizeStop()); + BMQTST_ASSERT_OPT_FAIL( testObj.loadMessageEventBuilder(dummyMessageEventBuilderPtr)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( testObj.loadConfirmEventBuilder(dummyConfirmEventBuilderPtr)); - ASSERT_OPT_FAIL(testObj.loadMessageProperties(dummyMessagePropertiesPtr)); - ASSERT_OPT_FAIL(testObj.getQueueId(dummyQueueIdPtr, dummyUri)); - ASSERT_OPT_FAIL(testObj.getQueueId(dummyQueueIdPtr, dummyCorrelationId)); - ASSERT_OPT_FAIL(testObj.openQueue(dummyQueueIdPtr, - dummyUri, - 0, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.openQueueSync(dummyQueueIdPtr, - dummyUri, - 0, // flags - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.openQueueAsync(dummyQueueIdPtr, - dummyUri, - 0, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.openQueueAsync(dummyQueueIdPtr, - dummyUri, - 0, - openQueueCallback, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.configureQueue(dummyQueueIdPtr, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.configureQueueSync(dummyQueueIdPtr, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.configureQueueAsync(dummyQueueIdPtr, - dummyQueueOptions, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.configureQueueAsync(dummyQueueIdPtr, - dummyQueueOptions, - configureQueueCallback, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.closeQueue(dummyQueueIdPtr, dummyTimeInterval)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( + testObj.loadMessageProperties(dummyMessagePropertiesPtr)); + BMQTST_ASSERT_OPT_FAIL(testObj.getQueueId(dummyQueueIdPtr, dummyUri)); + BMQTST_ASSERT_OPT_FAIL( + testObj.getQueueId(dummyQueueIdPtr, dummyCorrelationId)); + BMQTST_ASSERT_OPT_FAIL(testObj.openQueue(dummyQueueIdPtr, + dummyUri, + 0, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.openQueueSync(dummyQueueIdPtr, + dummyUri, + 0, // flags + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.openQueueAsync(dummyQueueIdPtr, + dummyUri, + 0, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.openQueueAsync(dummyQueueIdPtr, + dummyUri, + 0, + openQueueCallback, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.configureQueue(dummyQueueIdPtr, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.configureQueueSync(dummyQueueIdPtr, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.configureQueueAsync(dummyQueueIdPtr, + dummyQueueOptions, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.configureQueueAsync(dummyQueueIdPtr, + dummyQueueOptions, + configureQueueCallback, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL( + testObj.closeQueue(dummyQueueIdPtr, dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL( testObj.closeQueueSync(dummyQueueIdPtr, dummyTimeInterval)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( testObj.closeQueueAsync(dummyQueueIdPtr, dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.closeQueueAsync(dummyQueueIdPtr, - closeQueueCallback, - dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.nextEvent(dummyTimeInterval)); - ASSERT_OPT_FAIL(testObj.post(dummyMessageEvent)); - ASSERT_OPT_FAIL(testObj.confirmMessage(dummyMessage)); - ASSERT_OPT_FAIL(testObj.confirmMessage(dummyMessageConfirmationCookie)); - ASSERT_OPT_FAIL(testObj.confirmMessages(dummyConfirmEventBuilderPtr)); + BMQTST_ASSERT_OPT_FAIL(testObj.closeQueueAsync(dummyQueueIdPtr, + closeQueueCallback, + dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.nextEvent(dummyTimeInterval)); + BMQTST_ASSERT_OPT_FAIL(testObj.post(dummyMessageEvent)); + BMQTST_ASSERT_OPT_FAIL(testObj.confirmMessage(dummyMessage)); + BMQTST_ASSERT_OPT_FAIL( + testObj.confirmMessage(dummyMessageConfirmationCookie)); + BMQTST_ASSERT_OPT_FAIL( + testObj.confirmMessages(dummyConfirmEventBuilderPtr)); PV("Verify that overriden methods execute as intended"); - ASSERT_OPT_PASS(testObj.configureMessageDumping("")); + BMQTST_ASSERT_OPT_PASS(testObj.configureMessageDumping("")); BMQTST_ASSERT_EQ(testObj.configureMessageDumping(""), -1497); } diff --git a/src/groups/bmq/bmqa/bmqa_closequeuestatus.t.cpp b/src/groups/bmq/bmqa/bmqa_closequeuestatus.t.cpp index 6d6f3ff1c..3fde374bb 100644 --- a/src/groups/bmq/bmqa/bmqa_closequeuestatus.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_closequeuestatus.t.cpp @@ -171,7 +171,7 @@ static void test2_comparison() bmqtst::TestHelperUtil::allocator()); bmqa::CloseQueueStatus obj2(obj1, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj1 == obj2); + BMQTST_ASSERT(obj1 == obj2); } PV("Inequality"); @@ -196,7 +196,7 @@ static void test2_comparison() errorDescription, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj1 != obj2); + BMQTST_ASSERT(obj1 != obj2); } } diff --git a/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp b/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp index cd8e5b3e0..252839e00 100644 --- a/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp @@ -173,7 +173,7 @@ static void test2_comparison() bmqa::ConfigureQueueStatus obj2(obj1, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj1 == obj2); + BMQTST_ASSERT(obj1 == obj2); } PV("Inequality"); @@ -198,7 +198,7 @@ static void test2_comparison() errorDescription, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj1 != obj2); + BMQTST_ASSERT(obj1 != obj2); } } diff --git a/src/groups/bmq/bmqa/bmqa_message.t.cpp b/src/groups/bmq/bmqa/bmqa_message.t.cpp index ab3de1b86..f389e4513 100644 --- a/src/groups/bmq/bmqa/bmqa_message.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_message.t.cpp @@ -109,36 +109,36 @@ static void test1_messageOnStackIsInvalid() bmqa::Message msg; - ASSERT_SAFE_FAIL(msg.queueId()); - ASSERT_SAFE_FAIL(msg.correlationId()); + BMQTST_ASSERT_SAFE_FAIL(msg.queueId()); + BMQTST_ASSERT_SAFE_FAIL(msg.correlationId()); #ifdef BMQ_ENABLE_MSG_GROUPID - ASSERT_SAFE_FAIL(msg.groupId()); + BMQTST_ASSERT_SAFE_FAIL(msg.groupId()); #endif - ASSERT_SAFE_FAIL(msg.messageGUID()); - ASSERT_SAFE_FAIL(msg.confirmationCookie()); - ASSERT_SAFE_FAIL(msg.ackStatus()); - ASSERT_SAFE_FAIL(msg.dataSize()); - ASSERT_SAFE_FAIL(msg.hasProperties()); + BMQTST_ASSERT_SAFE_FAIL(msg.messageGUID()); + BMQTST_ASSERT_SAFE_FAIL(msg.confirmationCookie()); + BMQTST_ASSERT_SAFE_FAIL(msg.ackStatus()); + BMQTST_ASSERT_SAFE_FAIL(msg.dataSize()); + BMQTST_ASSERT_SAFE_FAIL(msg.hasProperties()); #ifdef BMQ_ENABLE_MSG_GROUPID - ASSERT_SAFE_FAIL(msg.hasGroupId()); + BMQTST_ASSERT_SAFE_FAIL(msg.hasGroupId()); #endif PV("Cloned object - uninitialized"); bmqa::Message clone = msg.clone(); - ASSERT_SAFE_FAIL(clone.queueId()); - ASSERT_SAFE_FAIL(clone.correlationId()); + BMQTST_ASSERT_SAFE_FAIL(clone.queueId()); + BMQTST_ASSERT_SAFE_FAIL(clone.correlationId()); #ifdef BMQ_ENABLE_MSG_GROUPID - ASSERT_SAFE_FAIL(clone.groupId()); + BMQTST_ASSERT_SAFE_FAIL(clone.groupId()); #endif - ASSERT_SAFE_FAIL(clone.messageGUID()); - ASSERT_SAFE_FAIL(clone.confirmationCookie()); - ASSERT_SAFE_FAIL(clone.ackStatus()); - ASSERT_SAFE_FAIL(clone.dataSize()); - ASSERT_SAFE_FAIL(clone.hasProperties()); + BMQTST_ASSERT_SAFE_FAIL(clone.messageGUID()); + BMQTST_ASSERT_SAFE_FAIL(clone.confirmationCookie()); + BMQTST_ASSERT_SAFE_FAIL(clone.ackStatus()); + BMQTST_ASSERT_SAFE_FAIL(clone.dataSize()); + BMQTST_ASSERT_SAFE_FAIL(clone.hasProperties()); #ifdef BMQ_ENABLE_MSG_GROUPID - ASSERT_SAFE_FAIL(clone.hasGroupId()); + BMQTST_ASSERT_SAFE_FAIL(clone.hasGroupId()); #endif } @@ -370,11 +370,11 @@ static void test3_messageProperties() bmqa::MessagePropertiesIterator it(&out3); - ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); BMQTST_ASSERT_EQ(it.getAsString(), x); - ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); BMQTST_ASSERT_EQ(it.getAsString(), mod); - ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); BMQTST_ASSERT_EQ(it.getAsString(), z); } @@ -498,7 +498,7 @@ static void test4_subscriptionHandle() bmqa::MessageEvent pushMsgEvt = event.messageEvent(); bmqa::MessageIterator mIter = pushMsgEvt.messageIterator(); - ASSERT(mIter.nextMessage()); + BMQTST_ASSERT(mIter.nextMessage()); bmqa::Message message = mIter.message(); PVVV("Message: " << message); @@ -552,7 +552,7 @@ static void test4_subscriptionHandle() bmqa::MessageEvent pushMsgEvt = event.messageEvent(); bmqa::MessageIterator mIter = pushMsgEvt.messageIterator(); - ASSERT(mIter.nextMessage()); + BMQTST_ASSERT(mIter.nextMessage()); bmqa::Message message = mIter.message(); PVVV("Message: " << message); @@ -597,11 +597,11 @@ static void test4_subscriptionHandle() bmqa::MessageEvent putMsgEvt = event.messageEvent(); bmqa::MessageIterator mIter = putMsgEvt.messageIterator(); - ASSERT(mIter.nextMessage()); + BMQTST_ASSERT(mIter.nextMessage()); bmqa::Message message = mIter.message(); PVVV("Message: " << message); - ASSERT_OPT_FAIL(message.subscriptionHandle()); + BMQTST_ASSERT_OPT_FAIL(message.subscriptionHandle()); } PV("ACK MESSAGE - FAIL") @@ -634,11 +634,11 @@ static void test4_subscriptionHandle() bmqa::MessageEvent ackMsgEvt = event.messageEvent(); bmqa::MessageIterator mIter = ackMsgEvt.messageIterator(); - ASSERT(mIter.nextMessage()); + BMQTST_ASSERT(mIter.nextMessage()); bmqa::Message message = mIter.message(); PVVV("Message: " << message); - ASSERT_OPT_FAIL(message.subscriptionHandle()); + BMQTST_ASSERT_OPT_FAIL(message.subscriptionHandle()); } } diff --git a/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp b/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp index 7bc1dc30f..17dd6834c 100644 --- a/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp @@ -289,7 +289,8 @@ static void test3_putMessageIteratorTest() int rc = msg->getData(&payload); BMQTST_ASSERT_EQ(rc, 0); // Content isn't the same. Length is. Why? - ASSERT(payload.length() == messages[offset].d_payload.length()); + BMQTST_ASSERT(payload.length() == + messages[offset].d_payload.length()); ++offset; } BMQTST_ASSERT_EQ(offset, k_NUM_MSGS); diff --git a/src/groups/bmq/bmqa/bmqa_messageeventbuilder.t.cpp b/src/groups/bmq/bmqa/bmqa_messageeventbuilder.t.cpp index 798cf38a8..a19ff2ca9 100644 --- a/src/groups/bmq/bmqa/bmqa_messageeventbuilder.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_messageeventbuilder.t.cpp @@ -95,7 +95,7 @@ static void test2_testMessageEventSizeCount() session.loadMessageEventBuilder(&builder); // Empty MessageEvent should contain at least its header - ASSERT(builder.messageEventSize() > 0); + BMQTST_ASSERT(builder.messageEventSize() > 0); BMQTST_ASSERT_EQ(0, builder.messageCount()); const bsl::string payload("test payload", diff --git a/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp b/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp index 396a2bdc8..30472c2b7 100644 --- a/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp @@ -291,7 +291,7 @@ static void test1_staticMethods() { PVV("Create Queue Session Event using Session Event Method"); - ASSERT_FAIL(bmqa::MockSessionUtil::createSessionEvent( + BMQTST_ASSERT_FAIL(bmqa::MockSessionUtil::createSessionEvent( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqt::CorrelationId(1), 0, @@ -415,20 +415,20 @@ static void test2_call() { PVV("Incorrect call"); BMQA_EXPECT_CALL(mockSession, start()).returning(0); - ASSERT_FAIL(mockSession.stop()); + BMQTST_ASSERT_FAIL(mockSession.stop()); BMQTST_ASSERT_EQ(mockSession.start(), 0); } { PVV("Empty expected call queue"); - ASSERT_FAIL(mockSession.startAsync()); + BMQTST_ASSERT_FAIL(mockSession.startAsync()); } { PVV("Incorrect arguments"); BMQA_EXPECT_CALL(mockSession, startAsync(bsls::TimeInterval(10))) .returning(0); - ASSERT_FAIL(mockSession.startAsync(bsls::TimeInterval(1))); + BMQTST_ASSERT_FAIL(mockSession.startAsync(bsls::TimeInterval(1))); // To clear the expected queue. BMQTST_ASSERT_EQ(mockSession.startAsync(bsls::TimeInterval(10)), 0); } @@ -697,7 +697,7 @@ static void test3_queueManagement() bmqa::QueueId queueIdFound(bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), 0); - ASSERT(queueId1 == queueIdFound); + BMQTST_ASSERT(queueId1 == queueIdFound); BMQTST_ASSERT_NE(queueId1, savedQueueId); bmqa::CloseQueueStatus closeResult1 = diff --git a/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp b/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp index 7b5ec179d..81e1c5163 100644 --- a/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp @@ -172,7 +172,7 @@ static void test2_comparison() bmqtst::TestHelperUtil::allocator()); bmqa::OpenQueueStatus obj2(obj1, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj1 == obj2); + BMQTST_ASSERT(obj1 == obj2); } PV("Inequality"); @@ -197,7 +197,7 @@ static void test2_comparison() errorDescription, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj1 != obj2); + BMQTST_ASSERT(obj1 != obj2); } } diff --git a/src/groups/bmq/bmqc/bmqc_array.t.cpp b/src/groups/bmq/bmqc/bmqc_array.t.cpp index 5c655c90e..c788d9690 100644 --- a/src/groups/bmq/bmqc/bmqc_array.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_array.t.cpp @@ -222,30 +222,30 @@ static void test1_breathingTest() ObjType::iterator it2 = it++; BMQTST_ASSERT_EQ(it2->valueAsInt(), 1); BMQTST_ASSERT_EQ(it->valueAsInt(), 2); - ASSERT(it != it2); - ASSERT(it > it2); - ASSERT(it >= it2); - ASSERT(it2 <= it); - ASSERT(it2 < it); - ASSERT(it == it2 + 1); - ASSERT(it == 1 + it2); - ASSERT(it - 1 == it2); - ASSERT(it - it2 == 1); - ASSERT(it[0] == it2[1]); + BMQTST_ASSERT(it != it2); + BMQTST_ASSERT(it > it2); + BMQTST_ASSERT(it >= it2); + BMQTST_ASSERT(it2 <= it); + BMQTST_ASSERT(it2 < it); + BMQTST_ASSERT(it == it2 + 1); + BMQTST_ASSERT(it == 1 + it2); + BMQTST_ASSERT(it - 1 == it2); + BMQTST_ASSERT(it - it2 == 1); + BMQTST_ASSERT(it[0] == it2[1]); ObjType::iterator it3 = --it; BMQTST_ASSERT_EQ(it3->valueAsInt(), 1); BMQTST_ASSERT_EQ(it2->valueAsInt(), 1); - ASSERT(it == it3); - ASSERT(it >= it3); - ASSERT(it <= it3); - ASSERT(it + 1 == 1 + it); - ASSERT(it3 + 1 == 1 + it3); - ASSERT(it + 1 == it3 + 1); - ASSERT(it - it3 == 0); - ASSERT(it3 - it == 0); - ASSERT(it[2] == it3[2]); - ASSERT(*it++ == *it3); + BMQTST_ASSERT(it == it3); + BMQTST_ASSERT(it >= it3); + BMQTST_ASSERT(it <= it3); + BMQTST_ASSERT(it + 1 == 1 + it); + BMQTST_ASSERT(it3 + 1 == 1 + it3); + BMQTST_ASSERT(it + 1 == it3 + 1); + BMQTST_ASSERT(it - it3 == 0); + BMQTST_ASSERT(it3 - it == 0); + BMQTST_ASSERT(it[2] == it3[2]); + BMQTST_ASSERT(*it++ == *it3); } { @@ -481,14 +481,14 @@ static void test2_outOfBoundValidation() const ObjType& constObj = obj; // non-const - ASSERT_SAFE_FAIL(obj.front()); - ASSERT_SAFE_FAIL(obj.back()); - ASSERT_SAFE_FAIL(obj[0]); + BMQTST_ASSERT_SAFE_FAIL(obj.front()); + BMQTST_ASSERT_SAFE_FAIL(obj.back()); + BMQTST_ASSERT_SAFE_FAIL(obj[0]); // const - ASSERT_SAFE_FAIL(constObj.front()); - ASSERT_SAFE_FAIL(constObj.back()); - ASSERT_SAFE_FAIL(constObj[0]); + BMQTST_ASSERT_SAFE_FAIL(constObj.front()); + BMQTST_ASSERT_SAFE_FAIL(constObj.back()); + BMQTST_ASSERT_SAFE_FAIL(constObj[0]); // insert some items const int k_NB_ITEMS = 5; @@ -496,7 +496,7 @@ static void test2_outOfBoundValidation() obj.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); } - ASSERT_SAFE_FAIL(constObj[k_NB_ITEMS + 1]); + BMQTST_ASSERT_SAFE_FAIL(constObj[k_NB_ITEMS + 1]); static_cast(constObj); } @@ -626,7 +626,7 @@ static void test5_resize() // 5) Resize to zero obj.resize(0, TestType(5, bmqtst::TestHelperUtil::allocator())); - ASSERT(obj.empty()); + BMQTST_ASSERT(obj.empty()); BMQTST_ASSERT_EQ(obj.size(), 0UL); BMQTST_ASSERT_EQ(TestType::s_numAliveInstances, 0); BMQTST_ASSERT_EQ(ta.numAllocations(), numAllocations + 1); @@ -871,7 +871,7 @@ static void test10_pushBackSelfRef() for (int i = 0; i < k_SIZE; ++i) { obj.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); } - ASSERT_PASS(obj.push_back(obj[k_STATIC_LEN])); + BMQTST_ASSERT_PASS(obj.push_back(obj[k_STATIC_LEN])); BMQTST_ASSERT_EQ(k_STATIC_LEN, obj[k_STATIC_LEN].valueAsInt()); BMQTST_ASSERT_EQ(k_STATIC_LEN, obj[k_SIZE].valueAsInt()); } diff --git a/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp b/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp index 15c7e9acf..89b2ae39a 100644 --- a/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp @@ -206,7 +206,7 @@ static void test1_MonitoredQueue_breathingTest() // // int item = -1; // const bsls::TimeInterval timeout = bsls::TimeInterval( // 0, 5 * bdlt::TimeUnitRatio::k_NANOSECONDS_PER_MILLISECOND); - // ASSERT_SAFE_FAIL(queue.timedPopFront(&item, timeout)); + // BMQTST_ASSERT_SAFE_FAIL(queue.timedPopFront(&item, timeout)); // (void)timeout; // prod-build compiler happiness // popfront two items diff --git a/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp b/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp index 46a6b44ed..6fb9c2de8 100644 --- a/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp @@ -925,20 +925,20 @@ static void test15_eraseRange() BMQTST_ASSERT_EQ(k_NUM_ELEMENTS, map.size()); - ASSERT(map.erase(map.begin(), map.begin()) == map.begin()); + BMQTST_ASSERT(map.erase(map.begin(), map.begin()) == map.begin()); BMQTST_ASSERT_EQ(k_NUM_ELEMENTS, map.size()); - ASSERT(map.erase(map.end(), map.end()) == map.end()); + BMQTST_ASSERT(map.erase(map.end(), map.end()) == map.end()); BMQTST_ASSERT_EQ(k_NUM_ELEMENTS, map.size()); ConstIterType second = ++map.begin(); - ASSERT(map.erase(map.begin(), second) == second); - ASSERT(map.begin() == second); + BMQTST_ASSERT(map.erase(map.begin(), second) == second); + BMQTST_ASSERT(map.begin() == second); BMQTST_ASSERT_EQ(k_NUM_ELEMENTS - 1, map.size()); BMQTST_ASSERT_EQ_D(1, 1U, map.begin()->first); BMQTST_ASSERT_EQ_D(1, 1U, map.begin()->second); - ASSERT(map.erase(--map.end(), map.end()) == map.end()); + BMQTST_ASSERT(map.erase(--map.end(), map.end()) == map.end()); BMQTST_ASSERT_EQ(k_NUM_ELEMENTS - 2, map.size()); BMQTST_ASSERT_EQ_D(k_NUM_ELEMENTS - 2, k_NUM_ELEMENTS - 2, @@ -947,7 +947,7 @@ static void test15_eraseRange() k_NUM_ELEMENTS - 2, (--map.end())->second); - ASSERT(map.erase(map.begin(), map.end()) == map.end()); + BMQTST_ASSERT(map.erase(map.begin(), map.end()) == map.end()); BMQTST_ASSERT_EQ(0U, map.size()); diff --git a/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp b/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp index 8e0a471bc..443e9e60a 100644 --- a/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp @@ -273,12 +273,12 @@ static void test5_insertAfterEnd() Iterator begin = obj.begin(); Iterator end = obj.end(); - ASSERT(begin == end); + BMQTST_ASSERT(begin == end); setup(obj, 1, timeout); - ASSERT(begin == end); - ASSERT(end != obj.end()); + BMQTST_ASSERT(begin == end); + BMQTST_ASSERT(end != obj.end()); BMQTST_ASSERT_EQ(0U, end->first); // key BMQTST_ASSERT_EQ(1U, end->second); // value } diff --git a/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp b/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp index ac5360ef5..6c1e7cc1c 100644 --- a/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp @@ -251,8 +251,8 @@ static void test0_usageExample() { map.clear(); BMQTST_ASSERT_EQ(map.size(), 0u); - ASSERT(map.begin() == map.end()); - ASSERT(map.begin() == map.end()); + BMQTST_ASSERT(map.begin() == map.end()); + BMQTST_ASSERT(map.begin() == map.end()); } } @@ -1928,19 +1928,19 @@ static void test13_equality() map1.insert(3, "third", "value3"); for (Map::const_iterator it = map1.cbegin(); it != map1.cend(); ++it) { - ASSERT(map1 != map2); + BMQTST_ASSERT(map1 != map2); map2.insert(it->key1(), it->key2(), it->value()); } - ASSERT(map1 == map2); + BMQTST_ASSERT(map1 == map2); while (!map1.empty()) { map1.erase(map1.begin()); - ASSERT(map1 != map2); + BMQTST_ASSERT(map1 != map2); } while (!map2.empty()) { - ASSERT(map1 != map2); + BMQTST_ASSERT(map1 != map2); map2.erase(map2.begin()); } - ASSERT(map1 == map2); + BMQTST_ASSERT(map1 == map2); } //============================================================================= diff --git a/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp b/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp index ea481b5f6..de3fd963f 100644 --- a/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp +++ b/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp @@ -88,8 +88,8 @@ static void testN1_SimpleEvaluator_GoogleBenchmark(benchmark::State& state) CompilationContext compilationContext(&localAllocator); SimpleEvaluator evaluator; - ASSERT(evaluator.compile("false || (i64_42==42 && s_foo==\"foo\")", - compilationContext) == 0); + BMQTST_ASSERT(evaluator.compile("false || (i64_42==42 && s_foo==\"foo\")", + compilationContext) == 0); BMQTST_ASSERT_EQ(evaluator.evaluate(evaluationContext), true); @@ -135,7 +135,7 @@ static bsl::string makeTooLongExpression() // pairs. But the initial guess of `k_STACK_SIZE` is more than sufficient // to cause segfault if this case is not handled properly. const size_t k_STACK_SIZE = 1024 * 1024; - ASSERT(SimpleEvaluator::k_MAX_EXPRESSION_LENGTH < k_STACK_SIZE); + BMQTST_ASSERT(SimpleEvaluator::k_MAX_EXPRESSION_LENGTH < k_STACK_SIZE); for (size_t i = 0; i < k_STACK_SIZE; i += 16) { // Combining `!` and `~` differently in case we want to introduce @@ -222,7 +222,7 @@ static void test1_compilationErrors() evaluator.compile(parameters->expression, compilationContext); PV(compilationContext.lastErrorMessage()); - ASSERT(!evaluator.isValid()); + BMQTST_ASSERT(!evaluator.isValid()); BMQTST_ASSERT_EQ(compilationContext.lastErrorMessage(), parameters->errorMessage); } @@ -534,15 +534,15 @@ static void test3_evaluation() bmqtst::TestHelperUtil::allocator()); SimpleEvaluator evaluator; - ASSERT(!evaluator.isValid()); + BMQTST_ASSERT(!evaluator.isValid()); if (evaluator.compile(parameters->expression, compilationContext)) { PV(bsl::string("UNEXPECTED: ") + compilationContext.lastErrorMessage()); - ASSERT(false); + BMQTST_ASSERT(false); } else { - ASSERT(evaluator.isValid()); + BMQTST_ASSERT(evaluator.isValid()); BMQTST_ASSERT_EQ(evaluator.evaluate(evaluationContext), parameters->expected); } diff --git a/src/groups/bmq/bmqex/bmqex_bdlmteventschedulerexecutor.t.cpp b/src/groups/bmq/bmqex/bmqex_bdlmteventschedulerexecutor.t.cpp index b9eec98c6..19eb4556e 100644 --- a/src/groups/bmq/bmqex/bmqex_bdlmteventschedulerexecutor.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_bdlmteventschedulerexecutor.t.cpp @@ -357,8 +357,8 @@ static void test8_defaultTimePoint() const bsls::TimeInterval defTimePoint = bmqex::BdlmtEventSchedulerExecutor::k_DEFAULT_TIME_POINT; - ASSERT(defTimePoint < bsls::SystemTime::nowMonotonicClock()); - ASSERT(defTimePoint < bsls::SystemTime::nowRealtimeClock()); + BMQTST_ASSERT(defTimePoint < bsls::SystemTime::nowMonotonicClock()); + BMQTST_ASSERT(defTimePoint < bsls::SystemTime::nowRealtimeClock()); } // ============================================================================ diff --git a/src/groups/bmq/bmqex/bmqex_bdlmtfixedthreadpoolexecutor.t.cpp b/src/groups/bmq/bmqex/bmqex_bdlmtfixedthreadpoolexecutor.t.cpp index 30e3274fd..03a0cc217 100644 --- a/src/groups/bmq/bmqex/bmqex_bdlmtfixedthreadpoolexecutor.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_bdlmtfixedthreadpoolexecutor.t.cpp @@ -124,8 +124,8 @@ static void test2_post() threadPool.stop(); // both jobs executed - ASSERT(job1Complete); - ASSERT(job2Complete); + BMQTST_ASSERT(job1Complete); + BMQTST_ASSERT(job2Complete); } static void test3_swap() diff --git a/src/groups/bmq/bmqex/bmqex_bdlmtmultiqueuethreadpoolexecutor.t.cpp b/src/groups/bmq/bmqex/bmqex_bdlmtmultiqueuethreadpoolexecutor.t.cpp index c847a6a08..51b354318 100644 --- a/src/groups/bmq/bmqex/bmqex_bdlmtmultiqueuethreadpoolexecutor.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_bdlmtmultiqueuethreadpoolexecutor.t.cpp @@ -175,8 +175,8 @@ static void test2_postDispatch() threadPool.stop(); // both jobs executed - ASSERT(job1Complete); - ASSERT(job2Complete); + BMQTST_ASSERT(job1Complete); + BMQTST_ASSERT(job2Complete); } static void test3_swap() diff --git a/src/groups/bmq/bmqex/bmqex_bdlmtthreadpoolexecutor.t.cpp b/src/groups/bmq/bmqex/bmqex_bdlmtthreadpoolexecutor.t.cpp index 70ef86b7b..35d7cc297 100644 --- a/src/groups/bmq/bmqex/bmqex_bdlmtthreadpoolexecutor.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_bdlmtthreadpoolexecutor.t.cpp @@ -129,8 +129,8 @@ static void test2_post() threadPool.stop(); // both jobs executed - ASSERT(job1Complete); - ASSERT(job2Complete); + BMQTST_ASSERT(job1Complete); + BMQTST_ASSERT(job2Complete); } static void test3_swap() diff --git a/src/groups/bmq/bmqex/bmqex_bindutil.t.cpp b/src/groups/bmq/bmqex/bmqex_bindutil.t.cpp index b0259f23c..a2592264a 100644 --- a/src/groups/bmq/bmqex/bmqex_bindutil.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_bindutil.t.cpp @@ -264,13 +264,13 @@ static void test1_bindUtil_bindExecute() SetFlagOnCall(&executed))); // target not executed yet - ASSERT(!executed); + BMQTST_ASSERT(!executed); // invoke the bind wrapper wrapper(); // target executed - ASSERT(executed); + BMQTST_ASSERT(executed); } static void test2_bindWrapper_creators() @@ -315,13 +315,13 @@ static void test2_bindWrapper_creators() &alloc); // target not executed yet - ASSERT(!executed); + BMQTST_ASSERT(!executed); // invoke the bind wrapper wrapper(); // target executed - ASSERT(executed); + BMQTST_ASSERT(executed); } // 2. copy c-tor @@ -341,7 +341,7 @@ static void test2_bindWrapper_creators() wrapperCopy(); // target executed - ASSERT(executed); + BMQTST_ASSERT(executed); } // 3. move c-tor @@ -361,7 +361,7 @@ static void test2_bindWrapper_creators() wrapperCopy(); // target executed - ASSERT(executed); + BMQTST_ASSERT(executed); } } diff --git a/src/groups/bmq/bmqex/bmqex_executionpolicy.t.cpp b/src/groups/bmq/bmqex/bmqex_executionpolicy.t.cpp index 329732b38..e788d8137 100644 --- a/src/groups/bmq/bmqex/bmqex_executionpolicy.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_executionpolicy.t.cpp @@ -309,12 +309,12 @@ static void test4_policy_traits() typedef bmqex::ExecutionPolicy > TwoWayPolicyWithResult; - ASSERT(OneWayPolicy::k_IS_ONE_WAY && !OneWayPolicy::k_IS_TWO_WAY); + BMQTST_ASSERT(OneWayPolicy::k_IS_ONE_WAY && !OneWayPolicy::k_IS_TWO_WAY); - ASSERT(TwoWayPolicy::k_IS_TWO_WAY && !TwoWayPolicy::k_IS_ONE_WAY); + BMQTST_ASSERT(TwoWayPolicy::k_IS_TWO_WAY && !TwoWayPolicy::k_IS_ONE_WAY); - ASSERT(TwoWayPolicyWithResult::k_IS_TWO_WAY && - !TwoWayPolicyWithResult::k_IS_ONE_WAY); + BMQTST_ASSERT(TwoWayPolicyWithResult::k_IS_TWO_WAY && + !TwoWayPolicyWithResult::k_IS_ONE_WAY); } static void test5_util() @@ -356,7 +356,7 @@ static void test5_util() { BMQTST_ASSERT_EQ(defaultPolicy.blocking(), bmqex::ExecutionProperty::e_POSSIBLY_BLOCKING); - ASSERT(defaultPolicy.executor() == bmqex::SystemExecutor()); + BMQTST_ASSERT(defaultPolicy.executor() == bmqex::SystemExecutor()); BMQTST_ASSERT_EQ(defaultPolicy.allocator(), bslma::Default::allocator()); } @@ -367,7 +367,7 @@ static void test5_util() bmqex::ExecutionPolicyUtil::oneWay(); BMQTST_ASSERT_EQ(p.blocking(), defaultPolicy.blocking()); - ASSERT(p.executor() == defaultPolicy.executor()); + BMQTST_ASSERT(p.executor() == defaultPolicy.executor()); BMQTST_ASSERT_EQ(p.allocator(), defaultPolicy.allocator()); } @@ -377,7 +377,7 @@ static void test5_util() bmqex::ExecutionPolicyUtil::twoWay(); BMQTST_ASSERT_EQ(p.blocking(), defaultPolicy.blocking()); - ASSERT(p.executor() == defaultPolicy.executor()); + BMQTST_ASSERT(p.executor() == defaultPolicy.executor()); BMQTST_ASSERT_EQ(p.allocator(), defaultPolicy.allocator()); } @@ -387,7 +387,7 @@ static void test5_util() bmqex::ExecutionPolicyUtil::twoWayR(); BMQTST_ASSERT_EQ(p.blocking(), defaultPolicy.blocking()); - ASSERT(p.executor() == defaultPolicy.executor()); + BMQTST_ASSERT(p.executor() == defaultPolicy.executor()); BMQTST_ASSERT_EQ(p.allocator(), defaultPolicy.allocator()); } @@ -397,7 +397,7 @@ static void test5_util() BMQTST_ASSERT_EQ(p.blocking(), bmqex::ExecutionProperty::e_NEVER_BLOCKING); - ASSERT(p.executor() == defaultPolicy.executor()); + BMQTST_ASSERT(p.executor() == defaultPolicy.executor()); BMQTST_ASSERT_EQ(p.allocator(), defaultPolicy.allocator()); } @@ -407,7 +407,7 @@ static void test5_util() BMQTST_ASSERT_EQ(p.blocking(), bmqex::ExecutionProperty::e_POSSIBLY_BLOCKING); - ASSERT(p.executor() == defaultPolicy.executor()); + BMQTST_ASSERT(p.executor() == defaultPolicy.executor()); BMQTST_ASSERT_EQ(p.allocator(), defaultPolicy.allocator()); } @@ -417,7 +417,7 @@ static void test5_util() BMQTST_ASSERT_EQ(p.blocking(), bmqex::ExecutionProperty::e_ALWAYS_BLOCKING); - ASSERT(p.executor() == defaultPolicy.executor()); + BMQTST_ASSERT(p.executor() == defaultPolicy.executor()); BMQTST_ASSERT_EQ(p.allocator(), defaultPolicy.allocator()); } @@ -437,7 +437,7 @@ static void test5_util() &allocator); BMQTST_ASSERT_EQ(p.blocking(), defaultPolicy.blocking()); - ASSERT(p.executor() == defaultPolicy.executor()); + BMQTST_ASSERT(p.executor() == defaultPolicy.executor()); BMQTST_ASSERT_EQ(p.allocator(), &allocator); } } diff --git a/src/groups/bmq/bmqex/bmqex_executionutil.t.cpp b/src/groups/bmq/bmqex/bmqex_executionutil.t.cpp index 34686bb59..a333bd598 100644 --- a/src/groups/bmq/bmqex/bmqex_executionutil.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_executionutil.t.cpp @@ -495,20 +495,20 @@ static void test1_executeResult() typedef bmqex::ExecutionPolicy PolicyType; - ASSERT((bsl::is_same >::Type, - void>::value)); - - ASSERT((bsl::is_same >::Type, - void>::value)); - - ASSERT((bsl::is_same >::Type, - void>::value)); + BMQTST_ASSERT((bsl::is_same >::Type, + void>::value)); + + BMQTST_ASSERT((bsl::is_same >::Type, + void>::value)); + + BMQTST_ASSERT((bsl::is_same >::Type, + void>::value)); } // Two-Way policy @@ -516,20 +516,20 @@ static void test1_executeResult() typedef bmqex::ExecutionPolicy PolicyType; - ASSERT((bsl::is_same >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT((bsl::is_same >::Type, + bmqex::Future >::value)); - ASSERT((bsl::is_same >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT((bsl::is_same >::Type, + bmqex::Future >::value)); - ASSERT((bsl::is_same >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT((bsl::is_same >::Type, + bmqex::Future >::value)); } // Two-Way policy with encoded result type @@ -538,20 +538,20 @@ static void test1_executeResult() bmqex::ExecutionProperty::TwoWayR > PolicyType; - ASSERT((bsl::is_same >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT((bsl::is_same >::Type, + bmqex::Future >::value)); - ASSERT((bsl::is_same >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT((bsl::is_same >::Type, + bmqex::Future >::value)); - ASSERT((bsl::is_same >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT((bsl::is_same >::Type, + bmqex::Future >::value)); } } @@ -597,23 +597,26 @@ static void test2_thenExecuteResult() typedef bmqex::ExecutionPolicy PolicyType; - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - void>::value)); - - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - void>::value)); - - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - void>::value)); + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + void>::value)); + + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + void>::value)); + + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + void>::value)); } // Two-Way policy @@ -621,23 +624,26 @@ static void test2_thenExecuteResult() typedef bmqex::ExecutionPolicy PolicyType; - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - bmqex::Future >::value)); - - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - bmqex::Future >::value)); - - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + bmqex::Future >::value)); + + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + bmqex::Future >::value)); + + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + bmqex::Future >::value)); } // Two-Way policy with encoded result type @@ -646,23 +652,26 @@ static void test2_thenExecuteResult() bmqex::ExecutionProperty::TwoWayR > PolicyType; - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - bmqex::Future >::value)); - - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - bmqex::Future >::value)); - - ASSERT((bsl::is_same, - DummyContinuationFunction >::Type, - bmqex::Future >::value)); + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + bmqex::Future >::value)); + + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + bmqex::Future >::value)); + + BMQTST_ASSERT( + (bsl::is_same, + DummyContinuationFunction >::Type, + bmqex::Future >::value)); } } @@ -718,7 +727,7 @@ static void test3_execute_one_way_never_blocking() BMQTST_ASSERT_EQ(context.statistics().d_postCount, 1); // function object invocation *not* completed - ASSERT(!executed); + BMQTST_ASSERT(!executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 0); sem1.post(); // allow the function object to continue execution @@ -728,7 +737,7 @@ static void test3_execute_one_way_never_blocking() context.drain(); // function object invocation completed - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 1); } @@ -802,7 +811,7 @@ static void test4_execute_one_way_possibly_blocking() BMQTST_ASSERT_EQ(context.statistics().d_dispatchCount, 1); // function object invocation *not* completed - ASSERT(!executed); + BMQTST_ASSERT(!executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 0); sem1.post(); // allow the function object to continue execution @@ -812,7 +821,7 @@ static void test4_execute_one_way_possibly_blocking() context.drain(); // function object invocation completed - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 1); } @@ -878,7 +887,7 @@ static void test5_execute_one_way_always_blocking() BMQTST_ASSERT_EQ(context.statistics().d_dispatchCount, 1); // function object invocation completed - ASSERT(executed); + BMQTST_ASSERT(executed); // make sure all postconditions on the context are established context.drain(); @@ -973,11 +982,11 @@ static void test6_execute_two_way_never_blocking() BMQTST_ASSERT_EQ(context.statistics().d_postCount, 1); // function object invocation *not* completed - ASSERT(!executed); + BMQTST_ASSERT(!executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 0); // async result *not* ready - ASSERT(!result.isReady()); + BMQTST_ASSERT(!result.isReady()); sem1.post(); // allow the function object to continue execution sem2.wait(); // wait till the function object finish executing @@ -986,10 +995,10 @@ static void test6_execute_two_way_never_blocking() context.drain(); // async result ready - ASSERT(result.isReady()); + BMQTST_ASSERT(result.isReady()); // function object invocation completed - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 1); } @@ -1033,7 +1042,7 @@ static void test6_execute_two_way_never_blocking() // retrieve the result result.get(); - ASSERT(result.isReady()); + BMQTST_ASSERT(result.isReady()); } #ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING @@ -1060,7 +1069,7 @@ static void test6_execute_two_way_never_blocking() exceptionThrown = true; } - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); } #endif } @@ -1135,11 +1144,11 @@ static void test7_execute_two_way_possibly_blocking() BMQTST_ASSERT_EQ(context.statistics().d_dispatchCount, 1); // function object invocation *not* completed - ASSERT(!executed); + BMQTST_ASSERT(!executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 0); // async result *not* ready - ASSERT(!result.isReady()); + BMQTST_ASSERT(!result.isReady()); sem1.post(); // allow the function object to continue execution sem2.wait(); // wait till the function object finish executing @@ -1148,10 +1157,10 @@ static void test7_execute_two_way_possibly_blocking() context.drain(); // async result ready - ASSERT(result.isReady()); + BMQTST_ASSERT(result.isReady()); // function object invocation completed - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(context.statistics().d_successfulExecutionCount, 1); } @@ -1195,7 +1204,7 @@ static void test7_execute_two_way_possibly_blocking() // retrieve the result result.get(); - ASSERT(result.isReady()); + BMQTST_ASSERT(result.isReady()); } #ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING @@ -1218,7 +1227,7 @@ static void test7_execute_two_way_possibly_blocking() exceptionThrown = true; } - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); } #endif } @@ -1282,14 +1291,14 @@ static void test8_execute_two_way_always_blocking() toBeExecuted); // function object invocation completed - ASSERT(executed); + BMQTST_ASSERT(executed); // function object was submitted for execution via a call to // 'dispatch()' an the specified executor BMQTST_ASSERT_EQ(context.statistics().d_dispatchCount, 1); // returned future is ready - ASSERT(result.isReady()); + BMQTST_ASSERT(result.isReady()); // make sure all postconditions on the context are established context.drain(); @@ -1339,7 +1348,7 @@ static void test8_execute_two_way_always_blocking() ReturnVoidOnCall()); // retrieve the result - ASSERT(result.isReady()); + BMQTST_ASSERT(result.isReady()); result.get(); } @@ -1355,7 +1364,7 @@ static void test8_execute_two_way_always_blocking() ThrowOnCall()); // retrieve the result - ASSERT(result.isReady()); + BMQTST_ASSERT(result.isReady()); bool exceptionThrown = false; try { @@ -1365,7 +1374,7 @@ static void test8_execute_two_way_always_blocking() exceptionThrown = true; } - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); } #endif } @@ -1598,7 +1607,7 @@ static void test11_invoke() BMQTST_ASSERT_EQ(context.statistics().d_dispatchCount, 1); // function object invocation completed - ASSERT(executed); + BMQTST_ASSERT(executed); // make sure all postconditions on the context are established context.drain(); @@ -1647,7 +1656,7 @@ static void test11_invoke() exceptionThrown = true; } - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); } #endif } diff --git a/src/groups/bmq/bmqex/bmqex_executor.t.cpp b/src/groups/bmq/bmqex/bmqex_executor.t.cpp index b6e1ec1f0..17cf62940 100644 --- a/src/groups/bmq/bmqex/bmqex_executor.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_executor.t.cpp @@ -308,15 +308,16 @@ static void test1_creators() bmqex::Executor ex1(smallEx, &alloc); // check postconditions - ASSERT(ex1.target()); - ASSERT(*ex1.target() == smallEx); + BMQTST_ASSERT(ex1.target()); + BMQTST_ASSERT(*ex1.target() == smallEx); // create an 'bmqex::Executor' from a large executor to disable SBO bmqex::Executor ex2(largeEx, &alloc); // check postconditions - ASSERT(ex2.target >()); - ASSERT(*ex2.target >() == largeEx); + BMQTST_ASSERT(ex2.target >()); + BMQTST_ASSERT(*ex2.target >() == + largeEx); } // 3. copy constructor @@ -332,31 +333,33 @@ static void test1_creators() bmqex::Executor ex1Copy(ex1); // check postconditions - ASSERT(!ex1Copy); + BMQTST_ASSERT(!ex1Copy); // copy an empty executor specifying an (to be ignored) allocator bmqex::Executor ex1CopyAlloc(ex1, &alloc); // check postconditions, the copy constructor should have been selected // against the template one - ASSERT(!ex1CopyAlloc); + BMQTST_ASSERT(!ex1CopyAlloc); // copy executor containing a small target bmqex::Executor ex2Copy(ex2); // check postconditions - ASSERT(ex2Copy.target()); - ASSERT(ex2.target() != ex2Copy.target()); - ASSERT(*ex2Copy.target() == smallEx); + BMQTST_ASSERT(ex2Copy.target()); + BMQTST_ASSERT(ex2.target() != + ex2Copy.target()); + BMQTST_ASSERT(*ex2Copy.target() == smallEx); // copy executor containing a large target bmqex::Executor ex3Copy(ex3); // check postconditions - ASSERT(ex3Copy.target >()); - ASSERT(ex3.target >() == - ex3Copy.target >()); - ASSERT(*ex3Copy.target >() == largeEx); + BMQTST_ASSERT(ex3Copy.target >()); + BMQTST_ASSERT(ex3.target >() == + ex3Copy.target >()); + BMQTST_ASSERT(*ex3Copy.target >() == + largeEx); } // 4. move constructor @@ -372,30 +375,32 @@ static void test1_creators() bmqex::Executor ex1Copy(bslmf::MovableRefUtil::move(ex1)); // check postconditions - ASSERT(!ex1Copy); + BMQTST_ASSERT(!ex1Copy); // move an empty executor specifying an (to be ignored) allocator bmqex::Executor ex1CopyAlloc(bslmf::MovableRefUtil::move(ex1), &alloc); // check postconditions, the move constructor should have been selected // against the template one - ASSERT(!ex1CopyAlloc); + BMQTST_ASSERT(!ex1CopyAlloc); // move executor containing a small target bmqex::Executor ex2Copy(bslmf::MovableRefUtil::move(ex2)); // check postconditions - ASSERT(ex2.target()); - ASSERT(ex2Copy.target()); - ASSERT(ex2.target() != ex2Copy.target()); - ASSERT(*ex2Copy.target() == smallEx); + BMQTST_ASSERT(ex2.target()); + BMQTST_ASSERT(ex2Copy.target()); + BMQTST_ASSERT(ex2.target() != + ex2Copy.target()); + BMQTST_ASSERT(*ex2Copy.target() == smallEx); // move executor containing a large target bmqex::Executor ex3Copy(bslmf::MovableRefUtil::move(ex3)); // check postconditions - ASSERT(ex3Copy.target >()); - ASSERT(*ex3Copy.target >() == largeEx); + BMQTST_ASSERT(ex3Copy.target >()); + BMQTST_ASSERT(*ex3Copy.target >() == + largeEx); } } @@ -444,12 +449,13 @@ static void test2_assignment() ex1 = smallEx; // check postconditions - ASSERT(*ex1.target() == smallEx); + BMQTST_ASSERT(*ex1.target() == smallEx); // create an 'bmqex::Executor' from a large executor to disable SBO bmqex::Executor ex2; ex2 = largeEx; - ASSERT(*ex2.target >() == largeEx); + BMQTST_ASSERT(*ex2.target >() == + largeEx); } // 2. copy assignment operator @@ -466,26 +472,28 @@ static void test2_assignment() ex1Copy = ex1; // check postconditions - ASSERT(!ex1Copy); + BMQTST_ASSERT(!ex1Copy); // copy executor containing a small target bmqex::Executor ex2Copy; ex2Copy = ex2; // check postconditions - ASSERT(ex2Copy.target()); - ASSERT(ex2.target() != ex2Copy.target()); - ASSERT(*ex2Copy.target() == smallEx); + BMQTST_ASSERT(ex2Copy.target()); + BMQTST_ASSERT(ex2.target() != + ex2Copy.target()); + BMQTST_ASSERT(*ex2Copy.target() == smallEx); // copy executor containing a large target bmqex::Executor ex3Copy; ex3Copy = ex3; // check postconditions - ASSERT(ex3Copy.target >()); - ASSERT(ex3.target >() == - ex3Copy.target >()); - ASSERT(*ex3Copy.target >() == largeEx); + BMQTST_ASSERT(ex3Copy.target >()); + BMQTST_ASSERT(ex3.target >() == + ex3Copy.target >()); + BMQTST_ASSERT(*ex3Copy.target >() == + largeEx); } // 3. move assignment operator @@ -502,24 +510,26 @@ static void test2_assignment() ex1Copy = bslmf::MovableRefUtil::move(ex1); // check postconditions - ASSERT(!ex1Copy); + BMQTST_ASSERT(!ex1Copy); // move executor containing a small target bmqex::Executor ex2Copy; ex2Copy = bslmf::MovableRefUtil::move(ex2); // check postconditions - ASSERT(ex2Copy.target()); - ASSERT(ex2.target() != ex2Copy.target()); - ASSERT(*ex2Copy.target() == smallEx); + BMQTST_ASSERT(ex2Copy.target()); + BMQTST_ASSERT(ex2.target() != + ex2Copy.target()); + BMQTST_ASSERT(*ex2Copy.target() == smallEx); // move executor containing a large target bmqex::Executor ex3Copy; ex3Copy = bslmf::MovableRefUtil::move(ex3); // check postconditions - ASSERT(ex3Copy.target >()); - ASSERT(*ex3Copy.target >() == largeEx); + BMQTST_ASSERT(ex3Copy.target >()); + BMQTST_ASSERT(*ex3Copy.target >() == + largeEx); } // 4. assign @@ -531,8 +541,8 @@ static void test2_assignment() ex2.assign(ex1, &alloc); // check - ASSERT(ex2.target()); - ASSERT(*ex2.target() == ex1); + BMQTST_ASSERT(ex2.target()); + BMQTST_ASSERT(*ex2.target() == ex1); } } @@ -560,7 +570,7 @@ static void test3_post() bool executed = false; ex.post(SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(estat.d_postCallCount, 1); BMQTST_ASSERT_EQ(estat.d_dispatchCallCount, 0); } @@ -589,7 +599,7 @@ static void test4_dispatch() bool executed = false; ex.dispatch(SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(estat.d_postCallCount, 0); BMQTST_ASSERT_EQ(estat.d_dispatchCallCount, 1); } @@ -635,8 +645,8 @@ static void test5_swap() ex1.swap(ex2); // check - ASSERT(*ex1.target() == smallEx2); - ASSERT(*ex2.target() == smallEx1); + BMQTST_ASSERT(*ex1.target() == smallEx2); + BMQTST_ASSERT(*ex2.target() == smallEx1); } // 2. large targets @@ -653,8 +663,10 @@ static void test5_swap() ex1.swap(ex2); // check - ASSERT(*ex1.target >() == largeEx2); - ASSERT(*ex2.target >() == largeEx1); + BMQTST_ASSERT(*ex1.target >() == + largeEx2); + BMQTST_ASSERT(*ex2.target >() == + largeEx1); } // 3. small and large targets @@ -671,8 +683,9 @@ static void test5_swap() ex1.swap(ex2); // check - ASSERT(*ex1.target >() == largeEx); - ASSERT(*ex2.target() == smallEx); + BMQTST_ASSERT(*ex1.target >() == + largeEx); + BMQTST_ASSERT(*ex2.target() == smallEx); } } @@ -728,8 +741,8 @@ static void test7_target() // NOTE: check const and non-const overloads { bmqex::Executor ex; - ASSERT(!ex.target()); - ASSERT(!bsl::cref(ex).get().target()); + BMQTST_ASSERT(!ex.target()); + BMQTST_ASSERT(!bsl::cref(ex).get().target()); } // check non-default-constructed executor diff --git a/src/groups/bmq/bmqex/bmqex_executortraits.t.cpp b/src/groups/bmq/bmqex/bmqex_executortraits.t.cpp index 1dc97d4f7..669ed85e7 100644 --- a/src/groups/bmq/bmqex/bmqex_executortraits.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_executortraits.t.cpp @@ -143,14 +143,14 @@ static void test1_post() bmqex::ExecutorTraits::post( executor, SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(executor.d_postCallCount, 1); executed = false; bmqex::ExecutorTraits::post( executor, SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(executor.d_postCallCount, 2); } @@ -185,14 +185,14 @@ static void test2_dispatch() bmqex::ExecutorTraits::dispatch( executor, SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(executor.d_dispatchCallCount, 1); executed = false; bmqex::ExecutorTraits::dispatch( executor, SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(executor.d_dispatchCallCount, 2); } @@ -205,14 +205,14 @@ static void test2_dispatch() bmqex::ExecutorTraits::dispatch( executor, SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(executor.d_postCallCount, 1); executed = false; bmqex::ExecutorTraits::dispatch( executor, SetFlagOnCall(&executed)); - ASSERT(executed); + BMQTST_ASSERT(executed); BMQTST_ASSERT_EQ(executor.d_postCallCount, 2); } } diff --git a/src/groups/bmq/bmqex/bmqex_future.t.cpp b/src/groups/bmq/bmqex/bmqex_future.t.cpp index 3018ed351..b638dbff7 100644 --- a/src/groups/bmq/bmqex/bmqex_future.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_future.t.cpp @@ -287,10 +287,10 @@ static void test2_sharedState_setValue() } // exception thrown - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); // shared state not ready - ASSERT(!sharedState.isReady()); + BMQTST_ASSERT(!sharedState.isReady()); // callback not invoked or destroyed BMQTST_ASSERT_EQ(callbackInvoked, false); @@ -298,7 +298,7 @@ static void test2_sharedState_setValue() // shared state can still be made ready sharedState.emplaceValue(); - ASSERT(sharedState.isReady()); + BMQTST_ASSERT(sharedState.isReady()); // callback invoked and destroyed BMQTST_ASSERT_EQ(callbackInvoked, true); @@ -436,10 +436,10 @@ static void test3_sharedState_emplaceValue() } // exception thrown - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); // shared state not ready - ASSERT(!sharedState.isReady()); + BMQTST_ASSERT(!sharedState.isReady()); // callback not invoked or destroyed BMQTST_ASSERT_EQ(callbackInvoked, false); @@ -447,7 +447,7 @@ static void test3_sharedState_emplaceValue() // shared state can still be made ready sharedState.emplaceValue(); - ASSERT(sharedState.isReady()); + BMQTST_ASSERT(sharedState.isReady()); // callback invoked and destroyed BMQTST_ASSERT_EQ(callbackInvoked, true); @@ -736,10 +736,10 @@ static void test5_sharedState_setException_object() } // exception thrown - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); // shared state not ready - ASSERT(!sharedState.isReady()); + BMQTST_ASSERT(!sharedState.isReady()); // callback not invoked or destroyed BMQTST_ASSERT_EQ(callbackInvoked, false); @@ -747,7 +747,7 @@ static void test5_sharedState_setException_object() // shared state can still be made ready sharedState.emplaceValue(); - ASSERT(sharedState.isReady()); + BMQTST_ASSERT(sharedState.isReady()); // callback invoked and destroyed BMQTST_ASSERT_EQ(callbackInvoked, true); @@ -870,10 +870,10 @@ static void test6_sharedState_whenReady() } // exception thrown - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); // shared state not ready - ASSERT(!sharedState.isReady()); + BMQTST_ASSERT(!sharedState.isReady()); // shared state can still be attached a callback and made ready int result = 0; @@ -1195,7 +1195,7 @@ static void test12_future_creators() bmqex::Future future(sharedState); // is valid - ASSERT(future.isValid()); + BMQTST_ASSERT(future.isValid()); // shared state ownership acquired BMQTST_ASSERT_EQ(sharedState.use_count(), 2); @@ -1226,7 +1226,7 @@ static void test12_future_creators() bmqex::Future future(sharedState); // is valid - ASSERT(future.isValid()); + BMQTST_ASSERT(future.isValid()); // shared state ownership acquired BMQTST_ASSERT_EQ(sharedState.use_count(), 2); @@ -1257,7 +1257,7 @@ static void test12_future_creators() bmqex::Future future(sharedState); // is valid - ASSERT(future.isValid()); + BMQTST_ASSERT(future.isValid()); // shared state ownership acquired BMQTST_ASSERT_EQ(sharedState.use_count(), 2); diff --git a/src/groups/bmq/bmqex/bmqex_promise.t.cpp b/src/groups/bmq/bmqex/bmqex_promise.t.cpp index d82d57ce8..0f761e475 100644 --- a/src/groups/bmq/bmqex/bmqex_promise.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_promise.t.cpp @@ -67,7 +67,7 @@ static void test1_promise_creators() bmqex::Promise promise(&alloc); // has a shared state - ASSERT(promise.future().isValid()); + BMQTST_ASSERT(promise.future().isValid()); } // 2. clock constructor @@ -75,7 +75,7 @@ static void test1_promise_creators() bmqex::Promise promise(bsls::SystemClockType::e_REALTIME, &alloc); // has a shared state - ASSERT(promise.future().isValid()); + BMQTST_ASSERT(promise.future().isValid()); } // 3. move constructor @@ -103,7 +103,7 @@ static void test1_promise_creators() } // the shared state is ready - ASSERT(future.isReady()); + BMQTST_ASSERT(future.isReady()); // the shared state contains a 'bmqex::PromiseBroken' exception bool exceptionThrown = false; @@ -114,7 +114,7 @@ static void test1_promise_creators() exceptionThrown = true; } - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); } } @@ -224,7 +224,7 @@ static void test5_promiseBroken_what() { bmqex::PromiseBroken promiseBroken; - ASSERT(bsl::strcmp(promiseBroken.what(), "PromiseBroken") == 0); + BMQTST_ASSERT(bsl::strcmp(promiseBroken.what(), "PromiseBroken") == 0); } // ============================================================================ diff --git a/src/groups/bmq/bmqex/bmqex_sequentialcontext.t.cpp b/src/groups/bmq/bmqex/bmqex_sequentialcontext.t.cpp index 66bf008d5..5069c1efc 100644 --- a/src/groups/bmq/bmqex/bmqex_sequentialcontext.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_sequentialcontext.t.cpp @@ -340,7 +340,7 @@ static void test3_context_stop() // the working thread completed, function object #1 completed execution // function object #2 had not been executed - ASSERT(job2Storage.empty()); + BMQTST_ASSERT(job2Storage.empty()); // delete the thread-local storage rc = bslmt::ThreadUtil::deleteKey(tlsKey); @@ -591,7 +591,7 @@ static void test7_executor_post() } // no function object executed so far - ASSERT(out.empty()); + BMQTST_ASSERT(out.empty()); // start the context and join it ctx.start(); @@ -721,7 +721,7 @@ static void test8_executor_dispatch() } // no function object executed so far - ASSERT(out.empty()); + BMQTST_ASSERT(out.empty()); // start the context and join it ctx.start(); diff --git a/src/groups/bmq/bmqex/bmqex_strand.t.cpp b/src/groups/bmq/bmqex/bmqex_strand.t.cpp index 6714b18cb..0a547fb5e 100644 --- a/src/groups/bmq/bmqex/bmqex_strand.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_strand.t.cpp @@ -463,9 +463,9 @@ static void test1_strand_creators() // IdentifiableExecutor { bmqex::Strand strand(&alloc); - ASSERT_OPT_FAIL(strand.innerExecutor().post(NoOp())); - ASSERT_OPT_FAIL(strand.innerExecutor().dispatch(NoOp())); - ASSERT(strand.innerExecutor() == strand.innerExecutor()); + BMQTST_ASSERT_OPT_FAIL(strand.innerExecutor().post(NoOp())); + BMQTST_ASSERT_OPT_FAIL(strand.innerExecutor().dispatch(NoOp())); + BMQTST_ASSERT(strand.innerExecutor() == strand.innerExecutor()); } { @@ -584,7 +584,7 @@ static void test3_strand_stop() strand.join(); // function object #2 had not been executed - ASSERT(!job2Executed); + BMQTST_ASSERT(!job2Executed); } static void test4_strand_join() @@ -832,7 +832,7 @@ static void test7_executor_post() } // no function object executed so far - ASSERT(out.empty()); + BMQTST_ASSERT(out.empty()); // start the context and join it strand.start(); @@ -1005,7 +1005,7 @@ static void test8_executor_dispatch() } // no function object executed so far - ASSERT(out.empty()); + BMQTST_ASSERT(out.empty()); // start the context and join it strand.start(); diff --git a/src/groups/bmq/bmqex/bmqex_systemexecutor.t.cpp b/src/groups/bmq/bmqex/bmqex_systemexecutor.t.cpp index 119aa3a6e..af788d437 100644 --- a/src/groups/bmq/bmqex/bmqex_systemexecutor.t.cpp +++ b/src/groups/bmq/bmqex/bmqex_systemexecutor.t.cpp @@ -194,7 +194,7 @@ static void test3_executor_creators() { bmqex::SystemExecutor ex; - ASSERT(!ex.threadAttributes()); + BMQTST_ASSERT(!ex.threadAttributes()); } // 2. ThreadAttributes-construct @@ -214,8 +214,8 @@ static void test3_executor_creators() bmqex::SystemExecutor ex(attr, &alloc); // executor holds a copy of the thread attributes - ASSERT(ex.threadAttributes()); - ASSERT(ex.threadAttributes() != &attr); + BMQTST_ASSERT(ex.threadAttributes()); + BMQTST_ASSERT(ex.threadAttributes() != &attr); // the copy is identical to the original value BMQTST_ASSERT_EQ(ex.threadAttributes()->detachedState(), @@ -354,8 +354,8 @@ static void test6_executor_comparison() { bmqex::SystemExecutor ex1, ex2; - ASSERT(!ex1.threadAttributes()); - ASSERT(!ex2.threadAttributes()); + BMQTST_ASSERT(!ex1.threadAttributes()); + BMQTST_ASSERT(!ex2.threadAttributes()); BMQTST_ASSERT_EQ(ex1 == ex2, true); BMQTST_ASSERT_EQ(ex1 != ex2, false); @@ -366,7 +366,7 @@ static void test6_executor_comparison() bmqex::SystemExecutor ex1(bslmt::ThreadAttributes(), &alloc); bmqex::SystemExecutor ex2 = ex1; - ASSERT(ex1.threadAttributes() == ex2.threadAttributes()); + BMQTST_ASSERT(ex1.threadAttributes() == ex2.threadAttributes()); BMQTST_ASSERT_EQ(ex1 == ex2, true); BMQTST_ASSERT_EQ(ex1 != ex2, false); @@ -377,8 +377,8 @@ static void test6_executor_comparison() bmqex::SystemExecutor ex1(bslmt::ThreadAttributes(), &alloc); bmqex::SystemExecutor ex2; - ASSERT(ex1.threadAttributes()); - ASSERT(!ex2.threadAttributes()); + BMQTST_ASSERT(ex1.threadAttributes()); + BMQTST_ASSERT(!ex2.threadAttributes()); BMQTST_ASSERT_EQ(ex1 == ex2, false); BMQTST_ASSERT_EQ(ex1 != ex2, true); @@ -389,8 +389,8 @@ static void test6_executor_comparison() bmqex::SystemExecutor ex1(bslmt::ThreadAttributes(), &alloc); bmqex::SystemExecutor ex2(bslmt::ThreadAttributes(), &alloc); - ASSERT(ex1.threadAttributes() && ex2.threadAttributes()); - ASSERT(ex1.threadAttributes() != ex2.threadAttributes()); + BMQTST_ASSERT(ex1.threadAttributes() && ex2.threadAttributes()); + BMQTST_ASSERT(ex1.threadAttributes() != ex2.threadAttributes()); BMQTST_ASSERT_EQ(ex1 == ex2, true); BMQTST_ASSERT_EQ(ex1 != ex2, false); @@ -407,8 +407,8 @@ static void test6_executor_comparison() bmqex::SystemExecutor ex1(attr1, &alloc); bmqex::SystemExecutor ex2(attr2, &alloc); - ASSERT(ex1.threadAttributes() && ex2.threadAttributes()); - ASSERT(ex1.threadAttributes() != ex2.threadAttributes()); + BMQTST_ASSERT(ex1.threadAttributes() && ex2.threadAttributes()); + BMQTST_ASSERT(ex1.threadAttributes() != ex2.threadAttributes()); BMQTST_ASSERT_EQ(ex1 == ex2, false); BMQTST_ASSERT_EQ(ex1 != ex2, true); diff --git a/src/groups/bmq/bmqimp/bmqimp_application.t.cpp b/src/groups/bmq/bmqimp/bmqimp_application.t.cpp index a6e2af079..50565ab71 100644 --- a/src/groups/bmq/bmqimp/bmqimp_application.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_application.t.cpp @@ -90,20 +90,20 @@ static void test2_startStopTest() // Stop without previous start obj.stop(); - ASSERT(!obj.isStarted()); + BMQTST_ASSERT(!obj.isStarted()); int rc = obj.start(bsls::TimeInterval(0.1)); BMQTST_ASSERT_EQ(rc, bmqt::GenericResult::e_TIMEOUT); - ASSERT(!obj.isStarted()); + BMQTST_ASSERT(!obj.isStarted()); obj.stop(); bsl::shared_ptr event = obj.brokerSession().nextEvent( bsls::TimeInterval(0.1)); - ASSERT(event); + BMQTST_ASSERT(event); BMQTST_ASSERT_EQ(event->sessionEventType(), bmqt::SessionEventType::e_TIMEOUT); } @@ -146,22 +146,22 @@ static void test3_startStopAsyncTest() bsl::shared_ptr event = obj.brokerSession().nextEvent( bsls::TimeInterval(0.1)); - ASSERT(event); + BMQTST_ASSERT(event); BMQTST_ASSERT_EQ(event->sessionEventType(), bmqt::SessionEventType::e_TIMEOUT); - ASSERT(!obj.isStarted()); + BMQTST_ASSERT(!obj.isStarted()); int rc = obj.startAsync(bsls::TimeInterval(0.1)); BMQTST_ASSERT_EQ(rc, bmqt::GenericResult::e_SUCCESS); // Expect CONNECTION_TIMEOUT event event = obj.brokerSession().nextEvent(bsls::TimeInterval(1)); - ASSERT(event); + BMQTST_ASSERT(event); BMQTST_ASSERT_EQ(event->sessionEventType(), bmqt::SessionEventType::e_CONNECTION_TIMEOUT); - ASSERT(!obj.isStarted()); + BMQTST_ASSERT(!obj.isStarted()); // Interrupted start rc = obj.startAsync(bsls::TimeInterval(0.5)); @@ -170,10 +170,10 @@ static void test3_startStopAsyncTest() obj.stop(); event = obj.brokerSession().nextEvent(bsls::TimeInterval(1)); - ASSERT(event); + BMQTST_ASSERT(event); BMQTST_ASSERT_EQ(event->sessionEventType(), bmqt::SessionEventType::e_TIMEOUT); - ASSERT(!obj.isStarted()); + BMQTST_ASSERT(!obj.isStarted()); } // ============================================================================ diff --git a/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp b/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp index 2ae14ab4e..7f745dcc6 100644 --- a/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp @@ -194,7 +194,7 @@ void channelSetEventHandler(const bsl::shared_ptr& event, PV_SAFE("Incoming event: " << *event); - ASSERT(event != 0); + BMQTST_ASSERT(event != 0); BMQTST_ASSERT_EQ(event->type(), bmqimp::Event::EventType::e_SESSION); ++eventCounter; @@ -253,7 +253,7 @@ void sessionEventHandler( bdlcc::Deque >* eventQueue, const bsl::shared_ptr& event) { - ASSERT(event); + BMQTST_ASSERT(event); // May be Session or Message event PV_SAFE("Incoming event: " << *event); @@ -263,7 +263,7 @@ void sessionEventHandler( bool waitRealTime(bslmt::TimedSemaphore* sem) { - ASSERT(sem); + BMQTST_ASSERT(sem); const bsls::TimeInterval k_REALTIME_TIMEOUT = bsls::TimeInterval(15); @@ -283,7 +283,7 @@ bool isConfigure(const bmqp_ctrlmsg::ControlMessage& request) void makeResponse(bmqp_ctrlmsg::ControlMessage* response, const bmqp_ctrlmsg::ControlMessage& request) { - ASSERT(!request.rId().isNull()); + BMQTST_ASSERT(!request.rId().isNull()); response->rId().makeValue(request.rId().value()); if (request.choice().isConfigureStreamValue()) { @@ -802,7 +802,7 @@ void TestSession::advanceTime(const bsls::TimeInterval& step) // By return of this call the FSM queue is expected to be empty and there // should be no in progress requests. int rc = session()._synchronize(); - ASSERT(rc); + BMQTST_ASSERT(rc); if (!d_testClock_p) { // System time source is used. Cannot advance time manually. @@ -964,10 +964,10 @@ void TestSession::startAndConnect(bool expectHostUnhealthy) setChannel(); if (expectHostUnhealthy) { - ASSERT(waitHostUnhealthyEvent()); + BMQTST_ASSERT(waitHostUnhealthyEvent()); } - ASSERT(waitConnectedEvent()); + BMQTST_ASSERT(waitConnectedEvent()); PVVV_SAFE("Channel connected"); } @@ -1019,7 +1019,7 @@ void TestSession::openQueueWithError(bsl::shared_ptr queue, const ErrorResult errorResult, const bsls::TimeInterval& timeout) { - ASSERT(queue); + BMQTST_ASSERT(queue); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_CLOSED); BMQTST_ASSERT_EQ(queue->isValid(), false); @@ -1169,14 +1169,14 @@ void TestSession::reopenQueue( bsl::shared_ptr queue, BSLS_ANNOTATION_UNUSED const bsls::TimeInterval& timeout) { - ASSERT(queue); + BMQTST_ASSERT(queue); PVVV_SAFE("Reopening: verify first part of open request is sent"); bmqp_ctrlmsg::ControlMessage request = getNextOutboundRequest( TestSession::e_REQ_OPEN_QUEUE); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_REOPENING_OPN); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); PVVV_SAFE("Reopening: send open queue response"); sendResponse(request); @@ -1190,20 +1190,21 @@ void TestSession::reopenQueue( } PVVV_SAFE("Reopening: wait for reopen queue result"); - ASSERT(verifyOperationResult(bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, - bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); + BMQTST_ASSERT( + verifyOperationResult(bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, + bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } void TestSession::closeQueue(bsl::shared_ptr queue, const bsls::TimeInterval& timeout, bool isFinal) { - ASSERT(queue); + BMQTST_ASSERT(queue); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); bmqp_ctrlmsg::ControlMessage request(d_allocator_p); @@ -1239,8 +1240,8 @@ void TestSession::closeQueueWithError(bsl::shared_ptr queue, bool isFinal, const bsls::TimeInterval& timeout) { - ASSERT(queue); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue); + BMQTST_ASSERT(queue->isValid()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); bmqp_ctrlmsg::ControlMessage currentRequest( @@ -1274,7 +1275,7 @@ void TestSession::closeQueueWithError(bsl::shared_ptr queue, d_testChannel.setWriteStatus(bmqio::Status()); PVVV_SAFE(L_ << " Verify there is no close queue request"); - ASSERT(isChannelEmpty()); + BMQTST_ASSERT(isChannelEmpty()); return; // RETURN } @@ -1312,7 +1313,7 @@ void TestSession::closeQueueWithError(bsl::shared_ptr queue, bmqimp::QueueState::e_CLOSING_CFG_EXPIRED); PVVV_SAFE(L_ << " Verify close queue request is not sent"); - ASSERT(isChannelEmpty()); + BMQTST_ASSERT(isChannelEmpty()); return; // RETURN } @@ -1381,7 +1382,7 @@ void TestSession::closeQueueWithError(bsl::shared_ptr queue, void TestSession::closeDeconfiguredQueue(bsl::shared_ptr queue, const bsls::TimeInterval& timeout) { - ASSERT(queue); + BMQTST_ASSERT(queue); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_CLOSING_CLS); BMQTST_ASSERT_EQ(queue->isValid(), false); @@ -1407,7 +1408,7 @@ void TestSession::configureQueueSync(bsl::shared_ptr& queue, const bmqt::QueueOptions& options, const bsls::TimeInterval& timeout) { - ASSERT(queue); + BMQTST_ASSERT(queue); session().configureQueueSync( queue, options, @@ -1452,15 +1453,16 @@ TestSession::openQueueFirstStepExpired(bsl::shared_ptr queue, // Start with a queue in OPENING state and pending open request currentRequest = arriveAtStep(queue, e_OPEN_OPENING, timeout); - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); // Emulate request timeout. advanceTime(timeout); PVVV_SAFE(L_ << " Verify open request timed out"); - ASSERT(verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, - bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); + BMQTST_ASSERT( + verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, + bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); PVVV_SAFE(L_ << " Send back late open queue response"); sendResponse(currentRequest); @@ -1488,8 +1490,9 @@ TestSession::reopenQueueFirstStepExpired(bsl::shared_ptr queue, advanceTime(timeout); PVVV_SAFE(L_ << " Verify reopen request timed out"); - ASSERT(verifyOperationResult(bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, - bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); + BMQTST_ASSERT( + verifyOperationResult(bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, + bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENING_OPN_EXPIRED); @@ -1498,7 +1501,7 @@ TestSession::reopenQueueFirstStepExpired(bsl::shared_ptr queue, // We assume there is only one queue under the test and it has failed to // reopen. That means the session should emit STATE_RESTORED event because // there are no more queues for reopening. - ASSERT(waitStateRestoredEvent()); + BMQTST_ASSERT(waitStateRestoredEvent()); PVVV_SAFE(L_ << " Send back late reopen queue response"); sendResponse(currentRequest); @@ -1516,7 +1519,7 @@ bmqp_ctrlmsg::ControlMessage TestSession::reopenQueueFirstStep(bsl::shared_ptr queue) { BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); bmqp_ctrlmsg::ControlMessage currentRequest( bmqtst::TestHelperUtil::allocator()); @@ -1524,21 +1527,21 @@ TestSession::reopenQueueFirstStep(bsl::shared_ptr queue) PVVV_SAFE(L_ << " Trigger channel drop"); session().setChannel(bsl::shared_ptr()); - ASSERT(waitConnectionLostEvent()); + BMQTST_ASSERT(waitConnectionLostEvent()); - ASSERT(waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); - ASSERT(queue->isValid()); + BMQTST_ASSERT(waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); + BMQTST_ASSERT(queue->isValid()); PVVV_SAFE(L_ << " Restore the connection"); setChannel(); - ASSERT(waitReconnectedEvent()); + BMQTST_ASSERT(waitReconnectedEvent()); PVVV_SAFE(L_ << " Check open part of open request is sent"); currentRequest = getNextOutboundRequest(TestSession::e_REQ_OPEN_QUEUE); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_REOPENING_OPN); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); return currentRequest; } @@ -1548,7 +1551,7 @@ void TestSession::closeQueueSecondStep( const bmqp_ctrlmsg::ControlMessage& closeRequest, bool waitCloseEvent) { - ASSERT(closeRequest.choice().isCloseQueueValue()); + BMQTST_ASSERT(closeRequest.choice().isCloseQueueValue()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_CLOSING_CLS); BMQTST_ASSERT_EQ(queue->isValid(), false); @@ -1557,11 +1560,11 @@ void TestSession::closeQueueSecondStep( if (waitCloseEvent) { PVVV_SAFE(L_ << " Wait for close queue result"); - ASSERT( + BMQTST_ASSERT( verifyOperationResult(bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); } - ASSERT(waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT(waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); BMQTST_ASSERT_EQ(queue->isValid(), false); } @@ -1575,15 +1578,16 @@ TestSession::closeQueueSecondStepExpired(bsl::shared_ptr queue, // Go to the step with pending 2nd phase close request currentRequest = arriveAtStep(queue, e_CLOSE_CLOSING, timeout); - ASSERT(currentRequest.choice().isCloseQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isCloseQueueValue()); // Emulate request timeout. advanceTime(timeout); PVVV_SAFE(L_ << " Verify close request timed out"); - ASSERT(verifyOperationResult(bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT, - bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); + BMQTST_ASSERT( + verifyOperationResult(bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT, + bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_CLOSING_CLS_EXPIRED); @@ -1592,13 +1596,13 @@ TestSession::closeQueueSecondStepExpired(bsl::shared_ptr queue, PVVV_SAFE(L_ << " Send back late close queue response"); sendResponse(currentRequest); - ASSERT(waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT(waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); BMQTST_ASSERT_EQ(queue->isValid(), false); // Late close response has arrived, and there should be no more close // requests PVVV_SAFE(L_ << " Ensure no more requests are sent"); - ASSERT(isChannelEmpty()); + BMQTST_ASSERT(isChannelEmpty()); return currentRequest; } @@ -1620,7 +1624,7 @@ TestSession::arriveAtStepWithCfgs(bsl::shared_ptr queue, currentRequest = openQueueFirstStep(queue, timeout); } break; case e_OPEN_CONFIGURING: { - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); PVVV_SAFE("arriveAtStep: Send back open queue response"); sendResponse(currentRequest); @@ -1637,18 +1641,18 @@ TestSession::arriveAtStepWithCfgs(bsl::shared_ptr queue, sendResponse(currentRequest); PVVV_SAFE("arriveAtStep: Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_REOPEN_OPENING: { currentRequest = reopenQueueFirstStep(queue); } break; case e_REOPEN_CONFIGURING: { - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); PVVV_SAFE("arriveAtStep: Send back open queue response"); sendResponse(currentRequest); @@ -1658,21 +1662,21 @@ TestSession::arriveAtStepWithCfgs(bsl::shared_ptr queue, BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_REOPENING_CFG); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_REOPEN_REOPENED: { PVVV_SAFE("arriveAtStep: Send back configure queue response"); sendResponse(currentRequest); PVVV_SAFE("arriveAtStep: Waiting QUEUE_REOPEN_RESULT event..."); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(waitStateRestoredEvent()); + BMQTST_ASSERT(waitStateRestoredEvent()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CONFIGURING: { PVVV_SAFE("arriveAtStep: Standalone configure queue async"); @@ -1685,7 +1689,7 @@ TestSession::arriveAtStepWithCfgs(bsl::shared_ptr queue, currentRequest = getNextOutboundRequest(e_REQ_CONFIG_QUEUE); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CONFIGURING_RECONFIGURING: { PVVV_SAFE("arriveAtStep: Verify configure request timed out"); @@ -1693,7 +1697,7 @@ TestSession::arriveAtStepWithCfgs(bsl::shared_ptr queue, // Emulate request timeout. advanceTime(timeout); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -1714,17 +1718,17 @@ TestSession::arriveAtStepWithCfgs(bsl::shared_ptr queue, currentRequest = getNextOutboundRequest(e_REQ_CONFIG_QUEUE); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CONFIGURED: { PVVV_SAFE("arriveAtStep: Send back configure queue response"); sendResponse(currentRequest); PVVV_SAFE("arriveAtStep: expect no queue event for reconfigure"); - ASSERT(checkNoEvent()); + BMQTST_ASSERT(checkNoEvent()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CLOSE_CONFIGURING: { PVVV_SAFE("arriveAtStep: Close queue async"); @@ -1778,41 +1782,41 @@ TestSession::arriveAtStepWithoutCfgs(bsl::shared_ptr queue, currentRequest = openQueueFirstStep(queue, timeout); } break; case e_OPEN_CONFIGURING: { - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); PVVV_SAFE("arriveAtStep: Send back open queue response"); sendResponse(currentRequest); PVVV_SAFE("arriveAtStep: Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); } break; case e_OPEN_OPENED: { BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_REOPEN_OPENING: { currentRequest = reopenQueueFirstStep(queue); } break; case e_REOPEN_CONFIGURING: { - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); PVVV_SAFE("arriveAtStep: Send back open queue response"); sendResponse(currentRequest); PVVV_SAFE("arriveAtStep: Waiting QUEUE_REOPEN_RESULT event..."); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_REOPEN_REOPENED: { - ASSERT(waitStateRestoredEvent()); + BMQTST_ASSERT(waitStateRestoredEvent()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CONFIGURING: { PVVV_SAFE("arriveAtStep: Standalone configure queue async"); @@ -1822,22 +1826,22 @@ TestSession::arriveAtStepWithoutCfgs(bsl::shared_ptr queue, BMQTST_ASSERT_EQ(rc, bmqp_ctrlmsg::StatusCategory::E_SUCCESS); // Configure request is skipped for the writer - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CONFIGURING_RECONFIGURING: { // No reconfigure for writer BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CONFIGURED: { // No reconfigure for writer BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_CLOSE_CONFIGURING: { PVVV_SAFE("arriveAtStep: Close queue async"); @@ -1924,14 +1928,14 @@ void TestSession::arriveAtLateResponseStepReader( // Move the queue to opening state and pending configure request currentRequest = arriveAtStep(queue, e_OPEN_CONFIGURING, timeout); - ASSERT(isConfigure(currentRequest)); + BMQTST_ASSERT(isConfigure(currentRequest)); // Emulate request timeout. advanceTime(timeout); PVVV_SAFE("Step: " << currentStep << " Verify open request timed out"); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -1951,7 +1955,7 @@ void TestSession::arriveAtLateResponseStepReader( } break; case e_LATE_OPEN_CONFIGURING_CLS: { // Handle pending request from the previous step - ASSERT(isConfigure(currentRequest)); + BMQTST_ASSERT(isConfigure(currentRequest)); PVVV_SAFE("Step: " << currentStep << " Send back deconfigure queue response"); @@ -1987,7 +1991,7 @@ void TestSession::arriveAtLateResponseStepReader( PVVV_SAFE("Step: " << currentStep << " Verify reopen request timed out"); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -1999,7 +2003,7 @@ void TestSession::arriveAtLateResponseStepReader( // failed to reopen. That means the session should emit // STATE_RESTORED event because there are no more queues for // reopening. - ASSERT(waitStateRestoredEvent()); + BMQTST_ASSERT(waitStateRestoredEvent()); PVVV_SAFE("Step: " << currentStep << " Send back late configure queue response"); @@ -2015,7 +2019,7 @@ void TestSession::arriveAtLateResponseStepReader( } break; case e_LATE_REOPEN_CONFIGURING_CLS: { // Handle pending request from the previous step - ASSERT(isConfigure(currentRequest)); + BMQTST_ASSERT(isConfigure(currentRequest)); PVVV_SAFE("Step: " << currentStep << " Send back deconfigure queue response"); @@ -2040,13 +2044,13 @@ void TestSession::arriveAtLateResponseStepReader( e_CONFIGURING_RECONFIGURING, timeout); - ASSERT(isConfigure(currentRequest)); + BMQTST_ASSERT(isConfigure(currentRequest)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_LATE_CLOSE_CONFIGURING: { // Cleanup pending reconfigure request from the previous step - ASSERT(isConfigure(currentRequest)); + BMQTST_ASSERT(isConfigure(currentRequest)); PVVV_SAFE("Step: " << currentStep << " Send back reconfigure queue response"); @@ -2055,14 +2059,14 @@ void TestSession::arriveAtLateResponseStepReader( // Go to state with pending deconfigure request currentRequest = arriveAtStep(queue, e_CLOSE_CONFIGURING, timeout); - ASSERT(isConfigure(currentRequest)); + BMQTST_ASSERT(isConfigure(currentRequest)); // Emulate request timeout. advanceTime(timeout); PVVV_SAFE("Step: " << currentStep << " Verify deconfigure request timed out"); - ASSERT(verifyOperationResult( + BMQTST_ASSERT(verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -2124,12 +2128,12 @@ void TestSession::arriveAtLateResponseStepWriter( currentRequest = arriveAtStep(queue, e_OPEN_CONFIGURING, timeout); // For writer there should be no pending configure request - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); } break; case e_LATE_OPEN_CONFIGURING_CLS: { // Skip the step for the writer BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_LATE_REOPEN_OPENING: { currentRequest = reopenQueueFirstStepExpired(queue, timeout); @@ -2145,26 +2149,26 @@ void TestSession::arriveAtLateResponseStepWriter( timeout); // No reopen-configure for the writer - ASSERT(currentRequest.choice().isOpenQueueValue()); - ASSERT(waitStateRestoredEvent()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(waitStateRestoredEvent()); } break; case e_LATE_REOPEN_CONFIGURING_CLS: { // No reopen-configure for the writer - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_LATE_RECONFIGURING: { // No reconfigure for the writer - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_LATE_CLOSE_CONFIGURING: { // No configuring for the writer - ASSERT(currentRequest.choice().isOpenQueueValue()); + BMQTST_ASSERT(currentRequest.choice().isOpenQueueValue()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); } break; case e_LATE_CLOSE_CLOSING: { // Go to the step with pending 2nd phase close request @@ -2183,7 +2187,7 @@ TestSession::createQueue(const char* name, bsls::Types::Uint64 flags, const bmqt::QueueOptions& options) { - ASSERT(name); + BMQTST_ASSERT(name); bmqt::Uri uri(name, bmqtst::TestHelperUtil::allocator()); bsl::shared_ptr pQueue; @@ -2299,8 +2303,8 @@ void TestSession::stopGracefully(bool waitForDisconnected) bmqtst::TestHelperUtil::allocator()); getOutboundControlMessage(&disconnectMessage); - ASSERT(!disconnectMessage.rId().isNull()); - ASSERT(disconnectMessage.choice().isDisconnectValue()); + BMQTST_ASSERT(!disconnectMessage.rId().isNull()); + BMQTST_ASSERT(disconnectMessage.choice().isDisconnectValue()); PVVV_SAFE("Stopping: Prepare and send disconnect response message"); bmqp_ctrlmsg::ControlMessage disconnectResponseMessage( @@ -2311,12 +2315,12 @@ void TestSession::stopGracefully(bool waitForDisconnected) sendControlMessage(disconnectResponseMessage); if (waitForDisconnected) { - ASSERT(waitForChannelClose()); + BMQTST_ASSERT(waitForChannelClose()); PVVV_SAFE("Stopping: Waiting DISCONNECTED event"); - ASSERT(waitDisconnectedEvent()); + BMQTST_ASSERT(waitDisconnectedEvent()); PVVV_SAFE("Stopping: Waiting session stop CB"); - ASSERT(verifySessionIsStopped()); + BMQTST_ASSERT(verifySessionIsStopped()); } PVVV_SAFE("Session stopped..."); @@ -2427,7 +2431,7 @@ bool TestSession::isChannelEmpty() void TestSession::getOutboundEvent(bmqp::Event* rawEvent) { - ASSERT(d_testChannel.waitFor(1, true, bsls::TimeInterval(1))); + BMQTST_ASSERT(d_testChannel.waitFor(1, true, bsls::TimeInterval(1))); bmqio::TestChannel::WriteCall wc = d_testChannel.popWriteCall(); bmqp::Event ev(&wc.d_blob, bmqtst::TestHelperUtil::allocator(), true); @@ -2438,12 +2442,12 @@ void TestSession::getOutboundEvent(bmqp::Event* rawEvent) void TestSession::getOutboundControlMessage( bmqp_ctrlmsg::ControlMessage* outMsg) { - ASSERT(d_testChannel.waitFor(1, true, k_EVENT_TIMEOUT)); + BMQTST_ASSERT(d_testChannel.waitFor(1, true, k_EVENT_TIMEOUT)); bmqio::TestChannel::WriteCall wc = d_testChannel.popWriteCall(); bmqp::Event ev(&wc.d_blob, bmqtst::TestHelperUtil::allocator()); - ASSERT(ev.isControlEvent()); + BMQTST_ASSERT(ev.isControlEvent()); int rc = ev.loadControlEvent(outMsg); BMQTST_ASSERT_EQ(0, rc); @@ -2507,20 +2511,20 @@ TestSession::getNextOutboundRequest(const RequestType requestType) PVVV_SAFE("Outbound request: " << controlMessage); - ASSERT(!controlMessage.rId().isNull()); + BMQTST_ASSERT(!controlMessage.rId().isNull()); switch (requestType) { case e_REQ_OPEN_QUEUE: { - ASSERT(controlMessage.choice().isOpenQueueValue()); + BMQTST_ASSERT(controlMessage.choice().isOpenQueueValue()); } break; case e_REQ_CONFIG_QUEUE: { - ASSERT(isConfigure(controlMessage)); + BMQTST_ASSERT(isConfigure(controlMessage)); } break; case e_REQ_CLOSE_QUEUE: { - ASSERT(controlMessage.choice().isCloseQueueValue()); + BMQTST_ASSERT(controlMessage.choice().isCloseQueueValue()); } break; case e_REQ_DISCONNECT: { - ASSERT(controlMessage.choice().isDisconnectValue()); + BMQTST_ASSERT(controlMessage.choice().isDisconnectValue()); } break; case e_REQ_UNDEFINED: default: { @@ -2575,18 +2579,19 @@ void TestSession::verifyOpenQueueErrorResult( const bsl::shared_ptr& queue, const bmqimp::QueueState::Enum queueState) { - ASSERT(queue); + BMQTST_ASSERT(queue); BMQTST_ASSERT_EQ(queue->isValid(), false); - ASSERT(verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, - eventStatus)); + BMQTST_ASSERT( + verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, + eventStatus)); - ASSERT(waitForQueueState(queue, queueState)); + BMQTST_ASSERT(waitForQueueState(queue, queueState)); if (queueState == bmqimp::QueueState::e_CLOSED) { // Verify that the queue is removed from the active queue list - ASSERT(waitForQueueRemoved(queue)); + BMQTST_ASSERT(waitForQueueRemoved(queue)); } } @@ -2632,11 +2637,11 @@ void TestSession::verifyCloseQueueResult( BMQTST_ASSERT_EQ(queueCloseEvent->statusCode(), status); - ASSERT(waitForQueueState(queue, state)); + BMQTST_ASSERT(waitForQueueState(queue, state)); if (state == bmqimp::QueueState::e_CLOSED) { // Verify that the queue is removed from the active queue list - ASSERT(waitForQueueRemoved(queue)); + BMQTST_ASSERT(waitForQueueRemoved(queue)); } BMQTST_ASSERT_EQ(queue->isValid(), false); } @@ -2676,10 +2681,10 @@ static void test_disconnectRequestErr(bmqio::StatusCategory::Enum category) // verify disconnect message obj.verifyRequestSent(TestSession::e_REQ_DISCONNECT); - ASSERT(obj.waitForChannelClose()); - ASSERT(obj.waitDisconnectedEvent()); + BMQTST_ASSERT(obj.waitForChannelClose()); + BMQTST_ASSERT(obj.waitDisconnectedEvent()); - ASSERT(obj.verifySessionIsStopped()); + BMQTST_ASSERT(obj.verifySessionIsStopped()); } struct AsyncCancelTestData { @@ -2938,11 +2943,11 @@ static void test2_basicAccessorsTest() emptyStateCb, bmqtst::TestHelperUtil::allocator()); - ASSERT(!obj.isUsingSessionEventHandler()); + BMQTST_ASSERT(!obj.isUsingSessionEventHandler()); - ASSERT(obj.lookupQueue(uri) == 0); - ASSERT(obj.lookupQueue(k_QUEUE_ID) == 0); - ASSERT(obj.lookupQueue(corrId) == 0); + BMQTST_ASSERT(obj.lookupQueue(uri) == 0); + BMQTST_ASSERT(obj.lookupQueue(k_QUEUE_ID) == 0); + BMQTST_ASSERT(obj.lookupQueue(corrId) == 0); } static void test3_nullChannelTest() @@ -3031,7 +3036,7 @@ static void test3_nullChannelTest() bsls::TimeInterval(0.1)); // Timeout since there are no events - ASSERT(rc != 0); + BMQTST_ASSERT(rc != 0); PVV_SAFE("Stopping session..."); obj.stop(); @@ -3159,10 +3164,10 @@ static void queueErrorsTest(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 2b. Checking sync open queue..."); session.openQueueSync(pQueue, timeout, eventCallback); // use the same callback to capture event - ASSERT(waitRealTime(&semaphore)); + BMQTST_ASSERT(waitRealTime(&semaphore)); BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_CLOSED); - ASSERT(eventSp); + BMQTST_ASSERT(eventSp); BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_OPEN_RESULT); BMQTST_ASSERT_EQ(eventSp->statusCode(), bmqt::OpenQueueResult::e_REFUSED); @@ -3173,7 +3178,7 @@ static void queueErrorsTest(bsls::Types::Uint64 queueFlags) rc = session.openQueueAsync(pQueue, timeout); BMQTST_ASSERT_EQ(rc, bmqt::OpenQueueResult::e_REFUSED); - ASSERT(session.lookupQueue(uri) == 0); + BMQTST_ASSERT(session.lookupQueue(uri) == 0); PVV_SAFE("Step 4a. Checking deprecated sync configure..."); queueOptions.setMaxUnconfirmedMessages(0).setMaxUnconfirmedBytes(0); @@ -3184,9 +3189,9 @@ static void queueErrorsTest(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 4b. Checking sync configure..."); session.configureQueueSync(pQueue, queueOptions, timeout, eventCallback); - ASSERT(waitRealTime(&semaphore)); + BMQTST_ASSERT(waitRealTime(&semaphore)); - ASSERT(eventSp); + BMQTST_ASSERT(eventSp); BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT); BMQTST_ASSERT_EQ(eventSp->statusCode(), @@ -3206,9 +3211,9 @@ static void queueErrorsTest(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 6b. Checking sync configure..."); session.configureQueueSync(pQueue, queueOptions, timeout, eventCallback); - ASSERT(waitRealTime(&semaphore)); + BMQTST_ASSERT(waitRealTime(&semaphore)); - ASSERT(eventSp); + BMQTST_ASSERT(eventSp); BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT); @@ -3229,9 +3234,9 @@ static void queueErrorsTest(bsls::Types::Uint64 queueFlags) session.closeQueueSync(pQueue, timeout, eventCallback); - ASSERT(waitRealTime(&semaphore)); + BMQTST_ASSERT(waitRealTime(&semaphore)); - ASSERT(eventSp != 0); + BMQTST_ASSERT(eventSp != 0); BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT); BMQTST_ASSERT_EQ(eventSp->statusCode(), bmqt::CloseQueueResult::e_REFUSED); @@ -3433,7 +3438,7 @@ static void queueOpenTimeoutTest(bsls::Types::Uint64 queueFlags) obj.advanceTime(timeout); PVV_SAFE("Step 4. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -3444,15 +3449,16 @@ static void queueOpenTimeoutTest(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 5. Reset the channel to make the queue CLOSED"); // Reset channel to force closing of the expired queue obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); - ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT( + obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); BMQTST_ASSERT_EQ(pQueue->isValid(), false); // Restore the channel, the queue is closed and can be reused obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); } PVV_SAFE("Step 6. Check async open second part timeout"); @@ -3473,17 +3479,18 @@ static void queueOpenTimeoutTest(bsls::Types::Uint64 queueFlags) // Writer queue will be opened without configuring if (!bmqt::QueueFlagsUtil::isReader(queueFlags)) { PVV_SAFE("Step 10. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT( + BMQTST_ASSERT( obj.waitForQueueState(pQueue, bmqimp::QueueState::e_OPENED)); - ASSERT(pQueue->isValid()); + BMQTST_ASSERT(pQueue->isValid()); } else { - ASSERT(obj.waitForQueueState(pQueue, - bmqimp::QueueState::e_OPENING_CFG)); + BMQTST_ASSERT( + obj.waitForQueueState(pQueue, + bmqimp::QueueState::e_OPENING_CFG)); BMQTST_ASSERT_EQ(pQueue->isValid(), false); PVV_SAFE("Step 10. Verify config request was sent"); @@ -3493,7 +3500,7 @@ static void queueOpenTimeoutTest(bsls::Types::Uint64 queueFlags) obj.advanceTime(timeout); PVV_SAFE("Step 11. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); BMQTST_ASSERT_EQ(pQueue->state(), @@ -3593,7 +3600,7 @@ static void test8_queueWriterConfigureTest() // Consume the connected event (so that stop gracefully will be able to // work and pop the 'disconnected' event) - ASSERT(obj.waitConnectedEvent()); + BMQTST_ASSERT(obj.waitConnectedEvent()); // We empty any outbound message now, so that we can then ensure no // messages was sent as part of the following configures). @@ -3602,14 +3609,14 @@ static void test8_queueWriterConfigureTest() PVV_SAFE("Calling configure queue when channel"); rc = obj.session().configureQueue(pQueue, pQueue->options(), timeout); BMQTST_ASSERT_EQ(rc, bmqt::ConfigureQueueResult::e_SUCCESS); - ASSERT(obj.channel().writeCalls().empty()); + BMQTST_ASSERT(obj.channel().writeCalls().empty()); rc = obj.session().configureQueueAsync(pQueue, pQueue->options(), timeout); BMQTST_ASSERT_EQ(rc, bmqt::ConfigureQueueResult::e_SUCCESS); - ASSERT(obj.channel().writeCalls().empty()); + BMQTST_ASSERT(obj.channel().writeCalls().empty()); // Async configure should have enqueued a configure result of value success - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); @@ -3636,7 +3643,7 @@ static void test8_queueWriterConfigureTest() // The non-callback 'configureQueueAsync' versions _must_ _not_ generate /// an event on failure - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); // Now really stop obj.stopGracefully(); @@ -3711,12 +3718,13 @@ static void queueOpenErrorTest(bsls::Types::Uint64 queueFlags) // Writer queue is already opened, reader queue should be configured if (!bmqt::QueueFlagsUtil::isReader(queueFlags)) { PVV_SAFE("Step 9. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_OPENED)); - ASSERT(pQueue->isValid()); + BMQTST_ASSERT( + obj.waitForQueueState(pQueue, bmqimp::QueueState::e_OPENED)); + BMQTST_ASSERT(pQueue->isValid()); } else { PVV_SAFE("Step 9. Check config request was sent"); @@ -3739,7 +3747,8 @@ static void queueOpenErrorTest(bsls::Types::Uint64 queueFlags) obj.sendResponse(request); PVV_SAFE("Step 14. Check the queue gets closed"); - ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT( + obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); } PVV_SAFE("Step 15. Stop the session"); @@ -3813,7 +3822,7 @@ static void queueOpenCloseAsync(bsls::Types::Uint64 queueFlags) BMQTST_ASSERT_EQ(rc, bmqt::CloseQueueResult::e_SUCCESS); PVV_SAFE("Waiting QUEUE_CLOSE_RESULT event..."); - ASSERT( + BMQTST_ASSERT( obj.verifyOperationResult(bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT, bmqt::CloseQueueResult::e_UNKNOWN_QUEUE)); @@ -3850,8 +3859,8 @@ static void queueOpenCloseAsync(bsls::Types::Uint64 queueFlags) PVV_SAFE("Ensure configure queue request has been sent"); obj.getOutboundControlMessage(&configureQueueMessage); - ASSERT(!configureQueueMessage.rId().isNull()); - ASSERT(isConfigure(configureQueueMessage)); + BMQTST_ASSERT(!configureQueueMessage.rId().isNull()); + BMQTST_ASSERT(isConfigure(configureQueueMessage)); // Prepare and process configure queue response PVV_SAFE("Prepare and send back configure queue response"); @@ -3862,12 +3871,12 @@ static void queueOpenCloseAsync(bsls::Types::Uint64 queueFlags) } PVV_SAFE("Waiting QUEUE_OPEN_RESULT event..."); - ASSERT( + BMQTST_ASSERT( obj.verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(pQueue->isValid()); + BMQTST_ASSERT(pQueue->isValid()); // Close the queue async PVV_SAFE("Close the queue async"); @@ -3886,8 +3895,8 @@ static void queueOpenCloseAsync(bsls::Types::Uint64 queueFlags) BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_CLOSING_CFG); BMQTST_ASSERT_EQ(pQueue->isValid(), false); - ASSERT(!configureQueueMessage.rId().isNull()); - ASSERT(isConfigure(configureQueueMessage)); + BMQTST_ASSERT(!configureQueueMessage.rId().isNull()); + BMQTST_ASSERT(isConfigure(configureQueueMessage)); // Prepare and process configure queue response PVV_SAFE("Prepare and send back configure queue response"); @@ -3904,9 +3913,9 @@ static void queueOpenCloseAsync(bsls::Types::Uint64 queueFlags) bmqtst::TestHelperUtil::allocator()); obj.getOutboundControlMessage(&closeQueueMessage); - ASSERT(!closeQueueMessage.rId().isNull()); - ASSERT(closeQueueMessage.choice().isCloseQueueValue()); - ASSERT(closeQueueMessage.choice().closeQueue().isFinal()); + BMQTST_ASSERT(!closeQueueMessage.rId().isNull()); + BMQTST_ASSERT(closeQueueMessage.choice().isCloseQueueValue()); + BMQTST_ASSERT(closeQueueMessage.choice().closeQueue().isFinal()); // Prepare and process close queue response PVV_SAFE("Prepare and send back close queue response"); @@ -4082,15 +4091,15 @@ static void test11_disconnect() eventQueue.timedPopFront(&event, bmqsys::Time::nowMonotonicClock() + bsls::TimeInterval(0.1)); - ASSERT(!event); + BMQTST_ASSERT(!event); PVV_SAFE("Ensure a disconnectMessage was sent to the broker"); bmqp_ctrlmsg::ControlMessage disconnectMessage( bmqtst::TestHelperUtil::allocator()); - ASSERT(testChannel.waitFor(1, true, bsls::TimeInterval(5))); + BMQTST_ASSERT(testChannel.waitFor(1, true, bsls::TimeInterval(5))); bmqio::TestChannel::WriteCall wc = testChannel.popWriteCall(); bmqp::Event ev(&wc.d_blob, bmqtst::TestHelperUtil::allocator()); - ASSERT(ev.isControlEvent()); + BMQTST_ASSERT(ev.isControlEvent()); rc = ev.loadControlEvent(&disconnectMessage); BMQTST_ASSERT_EQ(rc, 0); @@ -4128,7 +4137,7 @@ static void test11_disconnect() eventQueue.timedPopFront(&event, bmqsys::Time::nowMonotonicClock() + bsls::TimeInterval(0.1)); - ASSERT(!event); + BMQTST_ASSERT(!event); BMQTST_ASSERT_EQ(startCounter, 1); // Ensure stateCb was called @@ -4171,7 +4180,7 @@ static void test11_disconnect() PVV_SAFE("Waiting CONNECTED event..."); bsl::shared_ptr event; event = obj.nextEvent(bsls::TimeInterval(5)); - ASSERT(event); + BMQTST_ASSERT(event); BMQTST_ASSERT_EQ(event->statusCode(), 0); BMQTST_ASSERT_EQ(event->sessionEventType(), bmqt::SessionEventType::e_CONNECTED); @@ -4190,10 +4199,10 @@ static void test11_disconnect() PVV_SAFE("Ensure a disconnectMessage was sent to the broker"); bmqp_ctrlmsg::ControlMessage disconnectMessage( bmqtst::TestHelperUtil::allocator()); - ASSERT(testChannel.waitFor(1, true, bsls::TimeInterval(5))); + BMQTST_ASSERT(testChannel.waitFor(1, true, bsls::TimeInterval(5))); bmqio::TestChannel::WriteCall wc = testChannel.popWriteCall(); bmqp::Event ev(&wc.d_blob, bmqtst::TestHelperUtil::allocator()); - ASSERT(ev.isControlEvent()); + BMQTST_ASSERT(ev.isControlEvent()); rc = ev.loadControlEvent(&disconnectMessage); BMQTST_ASSERT_EQ(rc, 0); @@ -4222,7 +4231,7 @@ static void test11_disconnect() // 'disconnected' events now. for (int i = 0; i < 5; ++i) { event = obj.nextEvent(bsls::TimeInterval(5)); - ASSERT(event); + BMQTST_ASSERT(event); BMQTST_ASSERT_EQ(event->statusCode(), 0); BMQTST_ASSERT_EQ(event->sessionEventType(), bmqt::SessionEventType::e_DISCONNECTED); @@ -4281,8 +4290,8 @@ static void test12_disconnectStatus() bmqtst::TestHelperUtil::allocator()); obj.getOutboundControlMessage(&disconnectMessage); - ASSERT(!disconnectMessage.rId().isNull()); - ASSERT(disconnectMessage.choice().isDisconnectValue()); + BMQTST_ASSERT(!disconnectMessage.rId().isNull()); + BMQTST_ASSERT(disconnectMessage.choice().isDisconnectValue()); // prepare status message bmqp_ctrlmsg::ControlMessage statusMessage( @@ -4297,10 +4306,10 @@ static void test12_disconnectStatus() // process status message obj.sendControlMessage(statusMessage); - ASSERT(obj.waitForChannelClose()); - ASSERT(obj.waitDisconnectedEvent()); + BMQTST_ASSERT(obj.waitForChannelClose()); + BMQTST_ASSERT(obj.waitDisconnectedEvent()); - ASSERT(obj.verifySessionIsStopped()); + BMQTST_ASSERT(obj.verifySessionIsStopped()); } static void test13_disconnectTimeout() @@ -4349,16 +4358,16 @@ static void test13_disconnectTimeout() bmqtst::TestHelperUtil::allocator()); obj.getOutboundControlMessage(&disconnectMessage); - ASSERT(!disconnectMessage.rId().isNull()); - ASSERT(disconnectMessage.choice().isDisconnectValue()); + BMQTST_ASSERT(!disconnectMessage.rId().isNull()); + BMQTST_ASSERT(disconnectMessage.choice().isDisconnectValue()); // Emulate disconnect request timeout. obj.advanceTime(timeout); - ASSERT(obj.waitForChannelClose()); - ASSERT(obj.waitDisconnectedEvent()); + BMQTST_ASSERT(obj.waitForChannelClose()); + BMQTST_ASSERT(obj.waitDisconnectedEvent()); - ASSERT(obj.verifySessionIsStopped()); + BMQTST_ASSERT(obj.verifySessionIsStopped()); } static void test14_disconnectRequestGenericErr() @@ -4541,7 +4550,7 @@ static void lateOpenQueueResponse(bsls::Types::Uint64 queueFlags) obj.advanceTime(timeout); PVV_SAFE("Step 4. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT( + BMQTST_ASSERT( obj.verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -4558,13 +4567,13 @@ static void lateOpenQueueResponse(bsls::Types::Uint64 queueFlags) BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_CLOSING_CLS); BMQTST_ASSERT_EQ(pQueue->isValid(), false); - ASSERT(obj.session().lookupQueue(pQueue->uri()) != 0); + BMQTST_ASSERT(obj.session().lookupQueue(pQueue->uri()) != 0); PVV_SAFE("Step 7. Send close response"); obj.sendResponse(request); PVV_SAFE("Step 8. Check the queue gets closed"); - ASSERT(obj.waitForQueueRemoved(pQueue)); + BMQTST_ASSERT(obj.waitForQueueRemoved(pQueue)); PVV_SAFE("Step 9. Stop the session"); obj.stopGracefully(); @@ -4676,7 +4685,7 @@ static void test20_queueOpen_LateConfigureQueueResponse() obj.advanceTime(timeout); PVV_SAFE("Step 6. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT( + BMQTST_ASSERT( obj.verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -4693,7 +4702,7 @@ static void test20_queueOpen_LateConfigureQueueResponse() BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_CLOSING_CFG); BMQTST_ASSERT_EQ(pQueue->isValid(), false); - ASSERT(obj.session().lookupQueue(uri) != 0); + BMQTST_ASSERT(obj.session().lookupQueue(uri) != 0); PVV_SAFE("Step 9. Send close response (config part)"); obj.sendResponse(request); @@ -4705,7 +4714,7 @@ static void test20_queueOpen_LateConfigureQueueResponse() obj.sendResponse(request); PVV_SAFE("Step 12. Check the queue gets closed"); - ASSERT(obj.waitForQueueRemoved(pQueue)); + BMQTST_ASSERT(obj.waitForQueueRemoved(pQueue)); PVV_SAFE("Step 13. Stop the session"); obj.stopGracefully(); @@ -4791,7 +4800,7 @@ static void test21_post_Limit() bmqp::Event rawEvent(bmqtst::TestHelperUtil::allocator()); obj.getOutboundEvent(&rawEvent); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isPutEvent()); PVV_SAFE("Step 6. Ensure e_BW_LIMIT is returned for the second post"); rc = obj.session().post(*builder.blob(), postTimeout); @@ -4821,7 +4830,7 @@ static void test21_post_Limit() for (int i = 0; i < 2; i++) { rawEvent.clear(); obj.getOutboundEvent(&rawEvent); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isPutEvent()); } BMQTST_ASSERT_EQ(obj.channel().writeCalls().size(), 0u); @@ -4839,7 +4848,7 @@ static void test21_post_Limit() // Verify the channel is closed after write error rawEvent.clear(); obj.getOutboundEvent(&rawEvent); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isPutEvent()); BMQTST_ASSERT_EQ(obj.channel().closeCalls().size(), 1u); // Set write status back to e_SUCCESS @@ -5006,10 +5015,11 @@ static void queueCloseSync(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 3. Trigger channel drop"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); - ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_PENDING)); - ASSERT(pQueue->isValid()); + BMQTST_ASSERT( + obj.waitForQueueState(pQueue, bmqimp::QueueState::e_PENDING)); + BMQTST_ASSERT(pQueue->isValid()); PVV_SAFE("Step 4. Close the queue"); int rc = obj.session().closeQueue(pQueue, timeout); @@ -5028,7 +5038,7 @@ static void queueCloseSync(bsls::Types::Uint64 queueFlags) BMQTST_ASSERT_EQ(pQueue->isValid(), false); PVV_SAFE("Step 6. Stop the session"); - ASSERT(obj.stop()); + BMQTST_ASSERT(obj.stop()); BMQTST_ASSERT_EQ(pQueue->isValid(), false); } @@ -5113,36 +5123,36 @@ queueAsyncCanceled(int lineNum, PVV_SAFE(lineNum << ": Step 4. Waiting queue operation result" << " STATE_RESTORED and CONNECTION_LOST events"); - ASSERT(obj.waitForQueueState(pQueue, queueStateAfterDisconnect)); + BMQTST_ASSERT(obj.waitForQueueState(pQueue, queueStateAfterDisconnect)); if (waitOperationResultOnChannelDown) { PVV_SAFE(lineNum << ": Step 4.1. Waiting queue operation result"); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( eventType, bmqp_ctrlmsg::StatusCategory::E_CANCELED)); } if (waitStateRestoredOnChannelDown) { PVV_SAFE(lineNum << ": Step 4.2. Waiting STATE_RESTORED event"); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); } - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); PVV_SAFE(lineNum << ": Step 5. Restore the connection"); obj.setChannel(); PVV_SAFE(lineNum << ": Step 6. Waiting RECONNECTED and STATE_RESTORED " "events"); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); if (queueStateAfterDisconnect == bmqimp::QueueState::e_PENDING) { PVV_SAFE(lineNum << ": Step 6.1. process queue reopening"); obj.reopenQueue(pQueue); } - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); if (retransmittedRequest != TestSession::e_REQ_UNDEFINED) { PVV_SAFE(lineNum << ": Step 7. Check retransmitted request"); @@ -5161,23 +5171,23 @@ queueAsyncCanceled(int lineNum, if (waitOperationResultOnDisconnect) { PVV_SAFE(lineNum << ": Step 9.1. Waiting queue operation result"); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( eventType, bmqp_ctrlmsg::StatusCategory::E_NOT_CONNECTED)); } if (waitStateRestoredOnDisconnect) { PVV_SAFE(lineNum << ": Step 9.2. Waiting STATE_RESTORED event"); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); } PVV_SAFE(lineNum << ": Step 10. Waiting DISCONNECTED event"); - ASSERT(obj.waitForChannelClose()); - ASSERT(obj.waitDisconnectedEvent()); - ASSERT(obj.verifySessionIsStopped()); + BMQTST_ASSERT(obj.waitForChannelClose()); + BMQTST_ASSERT(obj.waitDisconnectedEvent()); + BMQTST_ASSERT(obj.verifySessionIsStopped()); - ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); BMQTST_ASSERT_EQ(pQueue->isValid(), false); } @@ -6019,7 +6029,7 @@ static void test25_sessionFsmTable() } PVV_SAFE("Waiting for empty transition table"); - ASSERT(waitRealTime(&doneSemaphore)); + BMQTST_ASSERT(waitRealTime(&doneSemaphore)); scheduler.cancelAllEventsAndWait(); scheduler.stop(); @@ -6353,9 +6363,9 @@ queueLateAsyncCanceled(int testId, PVV_SAFE(testId << ": Step 4. Waiting queue operation result" << " STATE_RESTORED and CONNECTION_LOST events"); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); - ASSERT(obj.waitForQueueState(pQueue, queueStateAfterDisconnect)); + BMQTST_ASSERT(obj.waitForQueueState(pQueue, queueStateAfterDisconnect)); PVV_SAFE(testId << ": Step 5. Restore the connection"); obj.setChannel(); @@ -6363,16 +6373,16 @@ queueLateAsyncCanceled(int testId, PVV_SAFE( testId << ": Step 6. Waiting RECONNECTED and STATE_RESTORED events"); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); if (queueStateAfterDisconnect == bmqimp::QueueState::e_PENDING) { PVV_SAFE(testId << ": Step 6.1. process queue reopening"); obj.reopenQueue(pQueue); } - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE(testId << ": Step 7. Setup the queue again"); @@ -6393,7 +6403,7 @@ queueLateAsyncCanceled(int testId, PVV_SAFE(testId << ": Step 8. Stop the session"); obj.stopGracefully(); - ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT(obj.waitForQueueState(pQueue, bmqimp::QueueState::e_CLOSED)); BMQTST_ASSERT_EQ(pQueue->isValid(), false); } @@ -6549,7 +6559,7 @@ static void queueDoubleOpenUri(bsls::Types::Uint64 queueFlags) BMQTST_ASSERT_EQ(rc, bmqt::OpenQueueResult::e_ALREADY_OPENED); BMQTST_ASSERT_EQ(pQueue1->state(), bmqimp::QueueState::e_OPENED); - ASSERT(pQueue1->isValid()); + BMQTST_ASSERT(pQueue1->isValid()); BMQTST_ASSERT_EQ(pQueue2->state(), bmqimp::QueueState::e_CLOSED); BMQTST_ASSERT_EQ(pQueue2->isValid(), false); @@ -6639,7 +6649,7 @@ static void queueDoubleOpenCorrelationId(bsls::Types::Uint64 queueFlags) BMQTST_ASSERT_EQ(rc, bmqt::OpenQueueResult::e_CORRELATIONID_NOT_UNIQUE); BMQTST_ASSERT_EQ(pQueue1->state(), bmqimp::QueueState::e_OPENED); - ASSERT(pQueue1->isValid()); + BMQTST_ASSERT(pQueue1->isValid()); BMQTST_ASSERT_EQ(pQueue2->state(), bmqimp::QueueState::e_CLOSED); BMQTST_ASSERT_EQ(pQueue2->isValid(), false); @@ -6782,40 +6792,40 @@ static void test33_queueNackTest() bmqp::Event rawEvent(bmqtst::TestHelperUtil::allocator()); obj.getOutboundEvent(&rawEvent); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isPutEvent()); PVV_SAFE("Step 5. Trigger channel drop and verify no NACK event is sent"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); // Restore the connection obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); PVV_SAFE("Step 6. Reopen the queue"); obj.reopenQueue(pQueue, timeout); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 7. Verify PUT event is sent again"); rawEvent.clear(); obj.getOutboundEvent(&rawEvent); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isPutEvent()); PVV_SAFE("Step 8. Trigger channel drop, close the queue and verify NACK " "event"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); obj.session().closeQueueAsync(pQueue, timeout); bsl::shared_ptr nackEvent = obj.waitAckEvent(); - ASSERT(nackEvent); + BMQTST_ASSERT(nackEvent); const int k_ACK_STATUS_UNKNOWN = bmqp::ProtocolUtil::ackResultToCode( bmqt::AckResult::e_UNKNOWN); @@ -6833,7 +6843,7 @@ static void test33_queueNackTest() pQueue); PVV_SAFE("Step 10. Stop the session when not connected"); - ASSERT(obj.stop()); + BMQTST_ASSERT(obj.stop()); BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_CLOSED); BMQTST_ASSERT_EQ(pQueue->isValid(), false); @@ -6871,10 +6881,11 @@ static void reopenError(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 4. Reset the channel"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); - ASSERT(queue->isValid()); + BMQTST_ASSERT( + obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); + BMQTST_ASSERT(queue->isValid()); // Set write error condition obj.channel().setWriteStatus(bmqio::StatusCategory::e_GENERIC_ERROR); @@ -6882,19 +6893,19 @@ static void reopenError(bsls::Types::Uint64 queueFlags) // Restore the connection obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); PVV_SAFE("Step 5. Verify reopen request was sent"); obj.verifyRequestSent(TestSession::e_REQ_OPEN_QUEUE); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_NOT_CONNECTED)); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 6. Verify the queue gets closed"); - ASSERT(obj.waitForQueueRemoved(queue, timeout)); + BMQTST_ASSERT(obj.waitForQueueRemoved(queue, timeout)); // Set normal write status obj.channel().setWriteStatus(bmqio::StatusCategory::e_SUCCESS); @@ -6908,15 +6919,16 @@ static void reopenError(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 9. Reset the channel"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); - ASSERT(queue->isValid()); + BMQTST_ASSERT( + obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); + BMQTST_ASSERT(queue->isValid()); // Restore the connection obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); PVV_SAFE("Step 10. Verify reopen request was sent"); bmqp_ctrlmsg::ControlMessage request = obj.getNextOutboundRequest( @@ -6933,26 +6945,28 @@ static void reopenError(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 12. Verify configure request was sent"); obj.verifyRequestSent(TestSession::e_REQ_CONFIG_QUEUE); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_NOT_CONNECTED)); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 13. Verify the queue is e_CLOSING_CLS"); obj.verifyRequestSent(TestSession::e_REQ_CLOSE_QUEUE); - ASSERT(obj.waitForQueueState(queue, - bmqimp::QueueState::e_CLOSING_CLS)); + BMQTST_ASSERT( + obj.waitForQueueState(queue, + bmqimp::QueueState::e_CLOSING_CLS)); BMQTST_ASSERT_EQ(queue->isValid(), false); } else { - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(obj.waitStateRestoredEvent()); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_OPENED)); - ASSERT(queue->isValid()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT( + obj.waitForQueueState(queue, bmqimp::QueueState::e_OPENED)); + BMQTST_ASSERT(queue->isValid()); } // Set normal write status @@ -7068,12 +7082,12 @@ static void test35_hostHealthMonitoring() monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); PVV_SAFE("Step 4. Ensure that event arrives"); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); PVV_SAFE( "Ensure that flipping to unknown state does not re-publish event"); monitor->setState(bmqt::HostHealthState::e_UNKNOWN); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 5. Stop the session"); obj.stopGracefully(); @@ -7092,20 +7106,20 @@ static void test35_hostHealthMonitoring() "bmq://ts.trades.myapp/my.queue?id=foo", bmqt::QueueFlags::e_READ, queueOptions); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(!queue->isSuspended()); obj.openQueue(queue, bsls::TimeInterval(5), true); - ASSERT(queue->isSuspended()); + BMQTST_ASSERT(queue->isSuspended()); size_t before = obj.channel().writeCalls().size(); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); queueOptions.setMaxUnconfirmedMessages(321); BMQTST_ASSERT_EQ(bmqt::GenericResult::e_SUCCESS, obj.session().configureQueue(queue, queueOptions, bsls::TimeInterval(5))); BMQTST_ASSERT_EQ(queue->options().maxUnconfirmedMessages(), 321); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); BMQTST_ASSERT_EQ(obj.channel().writeCalls().size(), before); queueOptions.setMaxUnconfirmedMessages(123); @@ -7113,11 +7127,11 @@ static void test35_hostHealthMonitoring() obj.session().configureQueueAsync(queue, queueOptions, bsls::TimeInterval(5))); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(queue->options().maxUnconfirmedMessages(), 123); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); BMQTST_ASSERT_EQ(obj.channel().writeCalls().size(), before); PVV_SAFE("Step 8. " @@ -7133,11 +7147,11 @@ static void test35_hostHealthMonitoring() BMQTST_ASSERT_EQ(ci.consumerPriority(), 0); BMQTST_ASSERT_EQ(ci.maxUnconfirmedMessages(), 123); - ASSERT(queue->isSuspended()); + BMQTST_ASSERT(queue->isSuspended()); obj.sendResponse(request); - ASSERT(obj.waitQueueResumedEvent()); - ASSERT(!queue->isSuspended()); - ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.waitQueueResumedEvent()); + BMQTST_ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); PVV_SAFE("Step 9. " "Verify that resumed queue can again configure with broker"); @@ -7147,19 +7161,19 @@ static void test35_hostHealthMonitoring() bsls::TimeInterval(5))); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); obj.sendResponse(request); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); PVV_SAFE("Step 10. Queue deconfigures on host again becoming unhealthy"); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(!queue->isSuspended()); obj.sendResponse(request); - ASSERT(obj.waitQueueSuspendedEvent()); - ASSERT(queue->isSuspended()); + BMQTST_ASSERT(obj.waitQueueSuspendedEvent()); + BMQTST_ASSERT(queue->isSuspended()); PVV_SAFE("Step 11. " "Queue defers host-health changes if configure in progress"); @@ -7172,8 +7186,8 @@ static void test35_hostHealthMonitoring() BMQTST_ASSERT_EQ(ci.maxUnconfirmedMessages(), 123); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); obj.sendResponse(request); - ASSERT(obj.waitQueueResumedEvent()); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(obj.waitQueueResumedEvent()); + BMQTST_ASSERT(!queue->isSuspended()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); getConsumerInfo(&ci, request); @@ -7181,8 +7195,8 @@ static void test35_hostHealthMonitoring() bmqp::Protocol::k_CONSUMER_PRIORITY_INVALID); obj.sendResponse(request); - ASSERT(obj.waitQueueSuspendedEvent()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.waitQueueSuspendedEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); // No HOST_HEALTH_RESUMED or additional HOST_UNHEALTHY, since session // never returned to a fully healthy state: All queues were never // resumed concurrently with a healthy host state. @@ -7197,7 +7211,7 @@ static void test35_hostHealthMonitoring() monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); obj.sendResponse(request); // responding to resume - ASSERT(obj.waitQueueResumedEvent()); + BMQTST_ASSERT(obj.waitQueueResumedEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); getConsumerInfo(&ci, request); BMQTST_ASSERT_EQ(ci.consumerPriority(), @@ -7206,19 +7220,19 @@ static void test35_hostHealthMonitoring() monitor->setState(bmqt::HostHealthState::e_HEALTHY); obj.sendResponse(request); // responding to suspend - ASSERT(obj.waitQueueSuspendedEvent()); + BMQTST_ASSERT(obj.waitQueueSuspendedEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); getConsumerInfo(&ci, request); // request := resume obj.sendResponse(request); // responding to resume - ASSERT(obj.waitQueueResumedEvent()); - ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.waitQueueResumedEvent()); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); // This time, we arrive back into a state in which the host is healthy // and all queues have managed to resume: We therefore issue the // HOST_HEALTH_RESTORED event. - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 13. Re-close session"); obj.stopGracefully(); @@ -7288,18 +7302,19 @@ static void test36_closingAfterConfigTimeout() // Emulate request timeout. obj.advanceTime(timeout); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); - ASSERT(queue->isValid()); + BMQTST_ASSERT(queue->isValid()); PVV_SAFE("Test step: Do queue closing"); rc = obj.session().closeQueueAsync(queue, timeout); BMQTST_ASSERT_EQ(rc, bmqp_ctrlmsg::StatusCategory::E_SUCCESS); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CFG)); + BMQTST_ASSERT( + obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CFG)); BMQTST_ASSERT_EQ(queue->isValid(), false); PVV_SAFE("Test step: Send late standalone configure response"); @@ -7311,7 +7326,8 @@ static void test36_closingAfterConfigTimeout() obj.sendResponse(currentRequest); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CLS)); + BMQTST_ASSERT( + obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CLS)); BMQTST_ASSERT_EQ(queue->isValid(), false); PVV_SAFE("Test step: Send close response"); @@ -7319,7 +7335,7 @@ static void test36_closingAfterConfigTimeout() obj.sendResponse(currentRequest); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); BMQTST_ASSERT_EQ(queue->isValid(), false); PVV_SAFE("Test step: Waiting QUEUE_CLOSE_RESULT event..."); @@ -7390,12 +7406,13 @@ static void test37_closingPendingConfig() rc = obj.session().closeQueueAsync(queue, timeout); BMQTST_ASSERT_EQ(rc, bmqp_ctrlmsg::StatusCategory::E_SUCCESS); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CFG)); + BMQTST_ASSERT( + obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CFG)); BMQTST_ASSERT_EQ(queue->isValid(), false); PVV_SAFE("Test step: Verify configure request is rejected"); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_NOT_SUPPORTED)); @@ -7409,7 +7426,8 @@ static void test37_closingPendingConfig() obj.sendResponse(currentRequest); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CLS)); + BMQTST_ASSERT( + obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSING_CLS)); BMQTST_ASSERT_EQ(queue->isValid(), false); PVV_SAFE("Test step: Send close response"); @@ -7417,7 +7435,7 @@ static void test37_closingPendingConfig() obj.sendResponse(currentRequest); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); + BMQTST_ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_CLOSED)); BMQTST_ASSERT_EQ(queue->isValid(), false); PVV_SAFE("Test step: Waiting QUEUE_CLOSE_RESULT event..."); @@ -7464,7 +7482,7 @@ static void responderMockup(TestSession* obj, response.choice().makeDisconnectResponse(); obj->sendControlMessage(response); - ASSERT(obj->waitForChannelClose(bsls::TimeInterval(1))); + BMQTST_ASSERT(obj->waitForChannelClose(bsls::TimeInterval(1))); break; } @@ -7540,7 +7558,7 @@ static void test_syncOpenConfigureClose(bool withHandler) BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_OPEN_RESULT); // There is no user event. - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("3: Configure"); calls = 0; @@ -7553,7 +7571,7 @@ static void test_syncOpenConfigureClose(bool withHandler) BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT); // There is no user event. - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("4: Close"); calls = 0; @@ -7567,18 +7585,18 @@ static void test_syncOpenConfigureClose(bool withHandler) BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT); // There is no user event. - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("5: Stop"); calls = 0; if (withHandler) { - ASSERT(obj.stop()); + BMQTST_ASSERT(obj.stop()); } else { // since this is nextEvent mode, 'stop' unblock _before_ the event obj.session().stop(); - ASSERT(obj.waitDisconnectedEvent()); + BMQTST_ASSERT(obj.waitDisconnectedEvent()); } BMQTST_ASSERT_EQ(queueSp->isValid(), false); @@ -7644,13 +7662,13 @@ static void test_asyncOpenConfigureClose(bool withHandler) obj.session().openQueueAsync(queueSp, timeout, cb); BMQTST_ASSERT_EQ(calls, 0); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_OPEN_QUEUE); obj.sendResponse(request); BMQTST_ASSERT_EQ(calls, 0); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); obj.sendResponse(request); @@ -7667,13 +7685,13 @@ static void test_asyncOpenConfigureClose(bool withHandler) BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_OPEN_RESULT); // There is no user event. - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("3: Configure"); obj.session().configureQueueAsync(queueSp, queueOptions, timeout, cb); BMQTST_ASSERT_EQ(calls, 1); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); obj.sendResponse(request); @@ -7690,19 +7708,19 @@ static void test_asyncOpenConfigureClose(bool withHandler) BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT); // There is no user event. - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("4: Close"); obj.session().closeQueueAsync(queueSp, timeout, cb); BMQTST_ASSERT_EQ(calls, 2); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); obj.sendResponse(request); BMQTST_ASSERT_EQ(calls, 2); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CLOSE_QUEUE); obj.sendResponse(request); @@ -7719,7 +7737,7 @@ static void test_asyncOpenConfigureClose(bool withHandler) BMQTST_ASSERT_EQ(eventSp->sessionEventType(), bmqt::SessionEventType::e_QUEUE_CLOSE_RESULT); // There is no user event. - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("5: Stop"); @@ -8029,11 +8047,11 @@ static void test43_hostHealthMonitoringErrors() bmqt::QueueFlags::e_READ, queueOptions); obj.openQueue(queue); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(!queue->isSuspended()); PVV_SAFE("Step 4. Set host to an unhealthy state"); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); PVV_SAFE("Step 5. Provide an error response from the broker"); bmqp_ctrlmsg::ControlMessage request(bmqtst::TestHelperUtil::allocator()); @@ -8041,42 +8059,42 @@ static void test43_hostHealthMonitoringErrors() obj.sendStatus(request); PVV_SAFE("Step 6. Verify channel dropped, etc"); - ASSERT(obj.waitQueueSuspendedEvent(bmqt::GenericResult::e_UNKNOWN)); - ASSERT(queue->isSuspended()); - ASSERT(obj.waitForChannelClose()); - ASSERT(obj.waitConnectionLostEvent()); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); + BMQTST_ASSERT(obj.waitQueueSuspendedEvent(bmqt::GenericResult::e_UNKNOWN)); + BMQTST_ASSERT(queue->isSuspended()); + BMQTST_ASSERT(obj.waitForChannelClose()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); PVV_SAFE("Step 7. " "Ensure queue is not reconfigured when channel comes back"); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_OPEN_QUEUE); obj.sendResponse(request); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_OPENED)); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_OPENED)); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 8. Verify same flow with response timeout"); monitor->setState(bmqt::HostHealthState::e_HEALTHY); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); obj.sendResponse(request); - ASSERT(obj.waitQueueResumedEvent()); - ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.waitQueueResumedEvent()); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); // Emulate request timeout. obj.advanceTime(timeout); - ASSERT(obj.waitQueueSuspendedEvent(bmqt::GenericResult::e_TIMEOUT)); - ASSERT(obj.waitForChannelClose()); - ASSERT(obj.waitConnectionLostEvent()); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); + BMQTST_ASSERT(obj.waitQueueSuspendedEvent(bmqt::GenericResult::e_TIMEOUT)); + BMQTST_ASSERT(obj.waitForChannelClose()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_PENDING)); // Ensure late response is no-op. obj.checkNoEvent(); @@ -8084,14 +8102,14 @@ static void test43_hostHealthMonitoringErrors() obj.checkNoEvent(); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_OPEN_QUEUE); obj.sendResponse(request); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_REOPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_OPENED)); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitForQueueState(queue, bmqimp::QueueState::e_OPENED)); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 9. Provide monitor with a healthy host health state"); monitor->setState(bmqt::HostHealthState::e_HEALTHY); @@ -8101,16 +8119,16 @@ static void test43_hostHealthMonitoringErrors() obj.sendStatus(request); PVV_SAFE("Step 11. Verify that channel is not dropped, etc"); - ASSERT(obj.waitQueueResumedEvent(bmqt::GenericResult::e_UNKNOWN)); - ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.waitQueueResumedEvent(bmqt::GenericResult::e_UNKNOWN)); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); PVV_SAFE("Step 12. Verify same behavior with a timeout response"); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); obj.sendResponse(request); - ASSERT(obj.waitQueueSuspendedEvent()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.waitQueueSuspendedEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); monitor->setState(bmqt::HostHealthState::e_HEALTHY); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); @@ -8118,8 +8136,8 @@ static void test43_hostHealthMonitoringErrors() // Emulate request timeout. obj.advanceTime(timeout); - ASSERT(obj.waitQueueResumedEvent(bmqt::GenericResult::e_TIMEOUT)); - ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.waitQueueResumedEvent(bmqt::GenericResult::e_TIMEOUT)); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); BMQTST_ASSERT_EQ(queue->state(), bmqimp::QueueState::e_OPENED); const int k_INVALID_CONFIGURE_ID = bmqimp::Queue::k_INVALID_CONFIGURE_ID; @@ -8154,7 +8172,7 @@ static void testHostHealthWithMultipleQueues( PVV_SAFE("Step 1. Set host to an unhealthy state"); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); - ASSERT(testSession->waitHostUnhealthyEvent()); + BMQTST_ASSERT(testSession->waitHostUnhealthyEvent()); PVV_SAFE("Step 2. Verify that only two queues are suspended"); bmqp_ctrlmsg::ControlMessage request(bmqtst::TestHelperUtil::allocator()); @@ -8165,19 +8183,19 @@ static void testHostHealthWithMultipleQueues( } for (size_t k = 0; k < numSensitiveQueues; k++) { PVV_SAFE("Waiting on event #" << k); - ASSERT(testSession->waitQueueSuspendedEvent()); + BMQTST_ASSERT(testSession->waitQueueSuspendedEvent()); } for (size_t k = 0; k < numSensitiveReaders; k++) { - ASSERT(sensitiveReaders[k]->isSuspended()); + BMQTST_ASSERT(sensitiveReaders[k]->isSuspended()); } for (size_t k = 0; k < numSensitiveWriters; k++) { - ASSERT(sensitiveWriters[k]->isSuspended()); + BMQTST_ASSERT(sensitiveWriters[k]->isSuspended()); } for (size_t k = 0; k < numNaiveReaders; k++) { - ASSERT(!naiveReaders[k]->isSuspended()); + BMQTST_ASSERT(!naiveReaders[k]->isSuspended()); } for (size_t k = 0; k < numNaiveWriters; k++) { - ASSERT(!naiveWriters[k]->isSuspended()); + BMQTST_ASSERT(!naiveWriters[k]->isSuspended()); } PVV_SAFE("Step 3. " @@ -8193,7 +8211,7 @@ static void testHostHealthWithMultipleQueues( request = testSession->getNextOutboundRequest( TestSession::e_REQ_CONFIG_QUEUE); testSession->sendResponse(request); - ASSERT(testSession->verifyOperationResult( + BMQTST_ASSERT(testSession->verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); } @@ -8206,22 +8224,22 @@ static void testHostHealthWithMultipleQueues( testSession->sendResponse(request); } for (size_t k = 0; k < numSensitiveQueues; k++) { - ASSERT(testSession->waitQueueResumedEvent()); + BMQTST_ASSERT(testSession->waitQueueResumedEvent()); } - ASSERT(testSession->waitHostHealthRestoredEvent()); - ASSERT(testSession->checkNoEvent()); + BMQTST_ASSERT(testSession->waitHostHealthRestoredEvent()); + BMQTST_ASSERT(testSession->checkNoEvent()); for (size_t k = 0; k < numSensitiveReaders; k++) { - ASSERT(!sensitiveReaders[k]->isSuspended()); + BMQTST_ASSERT(!sensitiveReaders[k]->isSuspended()); } for (size_t k = 0; k < numSensitiveWriters; k++) { - ASSERT(!sensitiveWriters[k]->isSuspended()); + BMQTST_ASSERT(!sensitiveWriters[k]->isSuspended()); } for (size_t k = 0; k < numNaiveReaders; k++) { - ASSERT(!naiveReaders[k]->isSuspended()); + BMQTST_ASSERT(!naiveReaders[k]->isSuspended()); } for (size_t k = 0; k < numNaiveWriters; k++) { - ASSERT(!naiveWriters[k]->isSuspended()); + BMQTST_ASSERT(!naiveWriters[k]->isSuspended()); } } @@ -8462,9 +8480,9 @@ static void test45_hostHealthMonitoringPendingStandalone() "bmq://ts.trades.myapp/my.queue", bmqt::QueueFlags::e_READ, queueOptions); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(!queue->isSuspended()); obj.openQueue(queue, timeout, false); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(!queue->isSuspended()); PVV_SAFE("Step 4. Send standalone configure request."); int rc = obj.session().configureQueueAsync(queue, @@ -8481,37 +8499,37 @@ static void test45_hostHealthMonitoringPendingStandalone() monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); PVV_SAFE("Step 6. Verify HOST_UNHEALTHY session event is issued."); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); PVV_SAFE("Step 7. Verify the queue defers to suspend."); - ASSERT(obj.checkNoEvent()); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(!queue->isSuspended()); PVV_SAFE("Step 8. Set the host health back to healthy."); monitor->setState(bmqt::HostHealthState::e_HEALTHY); PVV_SAFE("Step 9. Verify e_HOST_HEALTH_RESTORED event is issued."); - ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); PVV_SAFE("Step 10. Verify the queue defers to resume."); - ASSERT(obj.checkNoEvent()); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(!queue->isSuspended()); PVV_SAFE("Step 11. Send standalone configure response."); obj.sendResponse(configureRequest); PVVV_SAFE("the queue should receive standalone configure response."); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); PVV_SAFE("Step 12. " "Verify the queue has not sent suspend/resume requests."); - ASSERT(obj.isChannelEmpty()); - ASSERT(!queue->isSuspended()); + BMQTST_ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(!queue->isSuspended()); PVV_SAFE("Step 13. Check there should be no more events."); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 14. Stop the session"); obj.stopGracefully(); @@ -8588,18 +8606,18 @@ static void test46_hostHealthMonitoringDeferredResumeClose() "bmq://ts.trades.myapp/other.queue", bmqt::QueueFlags::e_READ, queueOptions); - ASSERT(!queue1->isSuspended()); - ASSERT(!queue2->isSuspended()); + BMQTST_ASSERT(!queue1->isSuspended()); + BMQTST_ASSERT(!queue2->isSuspended()); obj.openQueue(queue1, timeout, false); obj.openQueue(queue2, timeout, false); - ASSERT(!queue1->isSuspended()); - ASSERT(!queue2->isSuspended()); + BMQTST_ASSERT(!queue1->isSuspended()); + BMQTST_ASSERT(!queue2->isSuspended()); PVV_SAFE("Step 4. Set the host health to unhealthy"); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); PVV_SAFE("Step 5. Verify HOST_UNHEALTHY session event is issued."); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); PVVV_SAFE("The queue should send suspend request."); bmqp_ctrlmsg::ControlMessage suspendRequest( @@ -8610,9 +8628,9 @@ static void test46_hostHealthMonitoringDeferredResumeClose() TestSession::e_REQ_CONFIG_QUEUE); PVVV_SAFE("There should be no e_QUEUE_SUSPENDED event."); - ASSERT(obj.checkNoEvent()); - ASSERT(!queue1->isSuspended()); - ASSERT(!queue2->isSuspended()); + BMQTST_ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(!queue1->isSuspended()); + BMQTST_ASSERT(!queue2->isSuspended()); PVV_SAFE("Step 6. Set the host health back to healthy."); monitor->setState(bmqt::HostHealthState::e_HEALTHY); @@ -8621,8 +8639,8 @@ static void test46_hostHealthMonitoringDeferredResumeClose() BMQTST_ASSERT_EQ(obj.session().start(bsls::TimeInterval(1)), 0); PVV_SAFE("Step 7. Verify the queue defers to resume."); - ASSERT(obj.checkNoEvent()); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.isChannelEmpty()); // Use _SAFE version to avoid std::cout race with logging from 'stateCb()'. PVV_SAFE("Step 8. Close the queue."); @@ -8645,10 +8663,10 @@ static void test46_hostHealthMonitoringDeferredResumeClose() BMQTST_ASSERT_EQ(queue1->isValid(), false); BMQTST_ASSERT_EQ(queue2->isValid(), false); - ASSERT(!queue1->isSuspended()); - ASSERT(!queue2->isSuspended()); - ASSERT(obj.waitHostHealthRestoredEvent()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(!queue1->isSuspended()); + BMQTST_ASSERT(!queue2->isSuspended()); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVVV_SAFE("Closing: Send valid configure queue response message"); obj.sendResponse(request1); @@ -8670,7 +8688,7 @@ static void test46_hostHealthMonitoringDeferredResumeClose() } PVV_SAFE("Step 10. Check there should be no more events."); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 11. Stop the session"); obj.stopGracefully(); @@ -8727,10 +8745,10 @@ static void test47_configureMergesQueueOptions() bmqt::QueueFlags::e_READ, queueOptions); obj.openQueue(queue, timeout, false); - ASSERT(queue->options().hasMaxUnconfirmedMessages()); - ASSERT(!queue->options().hasMaxUnconfirmedBytes()); - ASSERT(!queue->options().hasConsumerPriority()); - ASSERT(!queue->options().hasSuspendsOnBadHostHealth()); + BMQTST_ASSERT(queue->options().hasMaxUnconfirmedMessages()); + BMQTST_ASSERT(!queue->options().hasMaxUnconfirmedBytes()); + BMQTST_ASSERT(!queue->options().hasConsumerPriority()); + BMQTST_ASSERT(!queue->options().hasSuspendsOnBadHostHealth()); PVV_SAFE("Step 4. " "Configure queue with only 'maxUnconfirmedBytes' modified"); @@ -8754,15 +8772,15 @@ static void test47_configureMergesQueueOptions() bmqt::QueueOptions::k_DEFAULT_CONSUMER_PRIORITY); obj.sendResponse(request); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(queue->options().maxUnconfirmedBytes(), 500); BMQTST_ASSERT_EQ(queue->options().maxUnconfirmedMessages(), 300); - ASSERT(!queue->options().hasConsumerPriority()); - ASSERT(!queue->options().hasSuspendsOnBadHostHealth()); + BMQTST_ASSERT(!queue->options().hasConsumerPriority()); + BMQTST_ASSERT(!queue->options().hasSuspendsOnBadHostHealth()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 6. Stop the session"); obj.stopGracefully(); @@ -8837,20 +8855,20 @@ static void test48_hostHealthSensitivityReconfiguration() bmqt::QueueFlags::e_READ, queueOptions); obj.openQueue(reader, timeout, false); - ASSERT(!reader->isSuspended()); + BMQTST_ASSERT(!reader->isSuspended()); bsl::shared_ptr writer = obj.createQueue( "bmq://ts.trades.myapp/writer.queue", bmqt::QueueFlags::e_WRITE, queueOptions); obj.openQueue(writer, timeout, false); - ASSERT(!writer->isSuspended()); + BMQTST_ASSERT(!writer->isSuspended()); PVV_SAFE("Step 4. Set the host health to unhealthy"); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); PVV_SAFE("Step 5. Verify that queues suspend"); - ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); // Writer should suspend immediately without configure request. obj.waitQueueSuspendedEvent(); @@ -8865,11 +8883,11 @@ static void test48_hostHealthSensitivityReconfiguration() BMQTST_ASSERT_EQ(ci.consumerPriority(), bmqp::Protocol::k_CONSUMER_PRIORITY_INVALID); obj.sendResponse(request); - ASSERT(obj.waitQueueSuspendedEvent()); + BMQTST_ASSERT(obj.waitQueueSuspendedEvent()); - ASSERT(reader->isSuspended()); - ASSERT(writer->isSuspended()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(reader->isSuspended()); + BMQTST_ASSERT(writer->isSuspended()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE( "Step 6. Configure each queue as no longer host health sensitive"); @@ -8890,31 +8908,31 @@ static void test48_hostHealthSensitivityReconfiguration() PVV_SAFE( "Step 7. Verify each queue resumes, with no HOST_HEALTH_RESTORED"); - ASSERT(obj.waitQueueResumedEvent()); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.waitQueueResumedEvent()); + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(writer->options(), queueOptions); obj.sendResponse(request); - ASSERT(obj.waitQueueResumedEvent()); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.waitQueueResumedEvent()); + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(reader->options(), queueOptions); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 8. Set the host health back to healthy"); monitor->setState(bmqt::HostHealthState::e_HEALTHY); PVV_SAFE("Step 9. Verify HOST_HEALTH_RESTORED event is issued"); - ASSERT(obj.waitHostHealthRestoredEvent()); + BMQTST_ASSERT(obj.waitHostHealthRestoredEvent()); PVV_SAFE("Step 10. Set the host back to unhealthy"); monitor->setState(bmqt::HostHealthState::e_UNHEALTHY); PVV_SAFE("Step 11. Verify HOST_UNHEALTHY with no QUEUE_SUSPENDED events"); - ASSERT(obj.waitHostUnhealthyEvent()); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.waitHostUnhealthyEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 12. Configure each queue back to host health sensitive"); queueOptions.setSuspendsOnBadHostHealth(true); @@ -8934,18 +8952,18 @@ static void test48_hostHealthSensitivityReconfiguration() BMQTST_ASSERT_EQ(ci.maxUnconfirmedMessages(), 0); PVV_SAFE("Step 13. Verify that queues suspend"); - ASSERT(obj.waitQueueSuspendedEvent()); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.waitQueueSuspendedEvent()); + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(writer->options(), queueOptions); obj.sendResponse(request); - ASSERT(obj.waitQueueSuspendedEvent()); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.waitQueueSuspendedEvent()); + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); BMQTST_ASSERT_EQ(reader->options(), queueOptions); - ASSERT(obj.checkNoEvent()); + BMQTST_ASSERT(obj.checkNoEvent()); PVV_SAFE("Step 14. Stop the session"); obj.stopGracefully(); @@ -9020,9 +9038,12 @@ static void test49_controlsBuffering() rc = obj.session().openQueueAsync(queueBaz, timeout); BMQTST_ASSERT_EQ(rc, bmqt::OpenQueueResult::e_SUCCESS); - ASSERT(obj.waitForQueueState(queueFoo, bmqimp::QueueState::e_OPENING_OPN)); - ASSERT(obj.waitForQueueState(queueBar, bmqimp::QueueState::e_OPENING_OPN)); - ASSERT(obj.waitForQueueState(queueBaz, bmqimp::QueueState::e_OPENING_OPN)); + BMQTST_ASSERT( + obj.waitForQueueState(queueFoo, bmqimp::QueueState::e_OPENING_OPN)); + BMQTST_ASSERT( + obj.waitForQueueState(queueBar, bmqimp::QueueState::e_OPENING_OPN)); + BMQTST_ASSERT( + obj.waitForQueueState(queueBaz, bmqimp::QueueState::e_OPENING_OPN)); // Verify there is only 1 outstanding request obj.verifyRequestSent(TestSession::e_REQ_OPEN_QUEUE); @@ -9072,8 +9093,8 @@ static void test49_controlsBuffering() queueBaz, bmqimp::QueueState::e_CLOSED); - ASSERT(obj.waitForChannelClose()); - ASSERT(obj.waitDisconnectedEvent()); + BMQTST_ASSERT(obj.waitForChannelClose()); + BMQTST_ASSERT(obj.waitDisconnectedEvent()); } static void test50_putRetransmittingTest() @@ -9211,7 +9232,7 @@ static void test50_putRetransmittingTest() PVV_SAFE("Step 4. Verify PUT event is sent"); obj.getOutboundEvent(&rawEvent); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isPutEvent()); // Send ACK for one message ackEventBuilder.appendMessage(k_ACK_STATUS_SUCCESS, @@ -9223,7 +9244,7 @@ static void test50_putRetransmittingTest() bsl::shared_ptr ackEvent = obj.waitAckEvent(); - ASSERT(ackEvent); + BMQTST_ASSERT(ackEvent); bmqp::AckMessageIterator* ackIter = ackEvent->ackMessageIterator(); BMQTST_ASSERT_EQ(1, ackIter->next()); @@ -9237,7 +9258,7 @@ static void test50_putRetransmittingTest() PVV_SAFE("Step 5. Trigger channel drop and verify no NACK event is sent"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); PVV_SAFE("Step 6. Send one more PUT message while the channel is down"); putEventBuilder.reset(); @@ -9257,12 +9278,12 @@ static void test50_putRetransmittingTest() // Restore the connection obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); PVV_SAFE("Step 7. Reopen the queue"); obj.reopenQueue(pQueue, timeout); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 8. Verify PUT event is sent with two messages"); rawEvent.clear(); @@ -9271,7 +9292,7 @@ static void test50_putRetransmittingTest() rawEvent.loadPutMessageIterator(&putIter, true); - ASSERT(putIter.isValid()); + BMQTST_ASSERT(putIter.isValid()); BMQTST_ASSERT_EQ(1, putIter.next()); BMQTST_ASSERT_EQ(pQueue->id(), putIter.header().queueId()); BMQTST_ASSERT_EQ(guidSecond, putIter.header().messageGUID()); @@ -9283,7 +9304,7 @@ static void test50_putRetransmittingTest() PVV_SAFE("Step 9. Trigger channel drop and advance the time"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); // Advance the time to emulate retransmission timeout bsls::TimeInterval retransmissionTimeout(0); @@ -9295,7 +9316,7 @@ static void test50_putRetransmittingTest() PVV_SAFE("Step 10. Verify NACKs for expired messages"); bsl::shared_ptr nackEvent = obj.waitAckEvent(); - ASSERT(nackEvent); + BMQTST_ASSERT(nackEvent); bmqp::AckMessageIterator* iter = nackEvent->ackMessageIterator(); BMQTST_ASSERT_EQ(1, iter->next()); @@ -9330,24 +9351,24 @@ static void test50_putRetransmittingTest() // Restore the connection obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); PVV_SAFE("Step 12. Reopen the queue"); obj.reopenQueue(pQueue, timeout); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 13. " "Drop the channel, close the queue and verify NACK event"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); obj.session().closeQueueAsync(pQueue, timeout); nackEvent = obj.waitAckEvent(); - ASSERT(nackEvent); + BMQTST_ASSERT(nackEvent); iter = nackEvent->ackMessageIterator(); BMQTST_ASSERT_EQ(1, iter->next()); @@ -9363,7 +9384,7 @@ static void test50_putRetransmittingTest() pQueue); PVV_SAFE("Step 15. Stop the session when not connected"); - ASSERT(obj.stop()); + BMQTST_ASSERT(obj.stop()); BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_CLOSED); BMQTST_ASSERT_EQ(pQueue->isValid(), false); @@ -9494,12 +9515,12 @@ static void test51_putRetransmittingNoAckTest() PVV_SAFE("Step 4. Verify PUT event is sent"); obj.getOutboundEvent(&rawEvent); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isPutEvent()); PVV_SAFE("Step 5. Trigger channel drop and verify no NACK event is sent"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); PVV_SAFE("Step 6. Send one more PUT message while the channel is down"); putEventBuilder.reset(); @@ -9519,12 +9540,12 @@ static void test51_putRetransmittingNoAckTest() // Restore the connection obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); PVV_SAFE("Step 7. Reopen the queue"); obj.reopenQueue(pQueue, timeout); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 8. Verify two PUT events are retransmitted"); rawEvent.clear(); @@ -9533,7 +9554,7 @@ static void test51_putRetransmittingNoAckTest() rawEvent.loadPutMessageIterator(&putIter, true); - ASSERT(putIter.isValid()); + BMQTST_ASSERT(putIter.isValid()); BMQTST_ASSERT_EQ(1, putIter.next()); BMQTST_ASSERT_EQ(pQueue->id(), putIter.header().queueId()); BMQTST_ASSERT_EQ(guid2, putIter.header().messageGUID()); @@ -9546,17 +9567,17 @@ static void test51_putRetransmittingNoAckTest() PVV_SAFE("Step 9. Trigger channel restart once again"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); // Restore the connection obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); PVV_SAFE("Step 10. Reopen the queue"); obj.reopenQueue(pQueue, timeout); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); PVV_SAFE("Step 11. Verify single PUT event is retransmitted"); rawEvent.clear(); @@ -9565,7 +9586,7 @@ static void test51_putRetransmittingNoAckTest() rawEvent.loadPutMessageIterator(&putIter, true); - ASSERT(putIter.isValid()); + BMQTST_ASSERT(putIter.isValid()); BMQTST_ASSERT_EQ(1, putIter.next()); BMQTST_ASSERT_EQ(pQueue->id(), putIter.header().queueId()); BMQTST_ASSERT_EQ(guid2, putIter.header().messageGUID()); @@ -9575,13 +9596,13 @@ static void test51_putRetransmittingNoAckTest() "Drop the channel, close the queue and verify NACK event"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); obj.session().closeQueueAsync(pQueue, timeout); bsl::shared_ptr nackEvent = obj.waitAckEvent(); - ASSERT(nackEvent); + BMQTST_ASSERT(nackEvent); bmqp::AckMessageIterator* iter = nackEvent->ackMessageIterator(); BMQTST_ASSERT_EQ(1, iter->next()); @@ -9597,7 +9618,7 @@ static void test51_putRetransmittingNoAckTest() pQueue); PVV_SAFE("Step 14. Stop the session when not connected"); - ASSERT(obj.stop()); + BMQTST_ASSERT(obj.stop()); BMQTST_ASSERT_EQ(pQueue->state(), bmqimp::QueueState::e_CLOSED); BMQTST_ASSERT_EQ(pQueue->isValid(), false); @@ -9659,7 +9680,7 @@ static void test52_controlRetransmission() PVV_SAFE("Step 2. Reset the channel and open a queue"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); int rc = obj.session().openQueueAsync(pQueue, timeout); BMQTST_ASSERT_EQ(rc, bmqp_ctrlmsg::StatusCategory::E_SUCCESS); @@ -9667,8 +9688,8 @@ static void test52_controlRetransmission() PVV_SAFE("Step 3. Restore the channel and finish queue opening"); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); bmqp_ctrlmsg::ControlMessage request = obj.getNextOutboundRequest( TestSession::e_REQ_OPEN_QUEUE); @@ -9679,22 +9700,22 @@ static void test52_controlRetransmission() // Advance time to verify the request is handled in the FSM. obj.advanceTime(TestSession::k_TIME_SOURCE_STEP); - ASSERT(pQueue->pendingConfigureId() != - bmqimp::Queue::k_INVALID_CONFIGURE_ID); + BMQTST_ASSERT(pQueue->pendingConfigureId() != + bmqimp::Queue::k_INVALID_CONFIGURE_ID); obj.sendResponse(request); - ASSERT( + BMQTST_ASSERT( obj.verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(pQueue->pendingConfigureId() == - bmqimp::Queue::k_INVALID_CONFIGURE_ID); + BMQTST_ASSERT(pQueue->pendingConfigureId() == + bmqimp::Queue::k_INVALID_CONFIGURE_ID); PVV_SAFE("Step 4. Reset the channel and configure the queue"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); rc = obj.session().configureQueueAsync(pQueue, pQueue->options(), timeout); BMQTST_ASSERT_EQ(rc, bmqt::ConfigureQueueResult::e_SUCCESS); @@ -9702,34 +9723,34 @@ static void test52_controlRetransmission() PVV_SAFE("Step 5. Restore the channel and check the queue is configured"); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); obj.reopenQueue(pQueue, timeout); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); // Advance time to verify the request is handled in the FSM. obj.advanceTime(TestSession::k_TIME_SOURCE_STEP); - ASSERT(pQueue->pendingConfigureId() != - bmqimp::Queue::k_INVALID_CONFIGURE_ID); + BMQTST_ASSERT(pQueue->pendingConfigureId() != + bmqimp::Queue::k_INVALID_CONFIGURE_ID); obj.sendResponse(request); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(pQueue->pendingConfigureId() == - bmqimp::Queue::k_INVALID_CONFIGURE_ID); + BMQTST_ASSERT(pQueue->pendingConfigureId() == + bmqimp::Queue::k_INVALID_CONFIGURE_ID); PVV_SAFE("Step 6. " "Reset the channel, configure the queue, emulate timeout"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); rc = obj.session().configureQueueAsync(pQueue, pQueue->options(), timeout); BMQTST_ASSERT_EQ(rc, bmqt::ConfigureQueueResult::e_SUCCESS); @@ -9737,50 +9758,50 @@ static void test52_controlRetransmission() // Emulate request timeout. obj.advanceTime(timeout); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); - ASSERT(pQueue->pendingConfigureId() == - bmqimp::Queue::k_INVALID_CONFIGURE_ID); + BMQTST_ASSERT(pQueue->pendingConfigureId() == + bmqimp::Queue::k_INVALID_CONFIGURE_ID); PVV_SAFE("Step 7. " "Restore the channel and check there is no configure request"); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); obj.reopenQueue(pQueue, timeout); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.isChannelEmpty()); PVV_SAFE("Step 8. Reset the channel, configure the queue, then close it"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); rc = obj.session().configureQueueAsync(pQueue, pQueue->options(), timeout); BMQTST_ASSERT_EQ(rc, bmqt::ConfigureQueueResult::e_SUCCESS); rc = obj.session().closeQueue(pQueue, timeout); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_NOT_SUPPORTED)); - ASSERT(pQueue->pendingConfigureId() == - bmqimp::Queue::k_INVALID_CONFIGURE_ID); + BMQTST_ASSERT(pQueue->pendingConfigureId() == + bmqimp::Queue::k_INVALID_CONFIGURE_ID); PVV_SAFE("Step 9. Restore the channel and check there is no configure " "request"); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.isChannelEmpty()); PVV_SAFE("Step 10. Stop the session"); @@ -9815,7 +9836,7 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 2. Trigger channel drop"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); PVV_SAFE("Step 3. Check expired open request"); { @@ -9826,7 +9847,7 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) obj.advanceTime(timeout); PVV_SAFE("Step 4. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -9836,8 +9857,8 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 5. Restore the channel"); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); } PVV_SAFE("Step 6. Check expired open-configure request"); @@ -9857,13 +9878,13 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 8. Trigger channel drop"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); // Emulate request timeout. obj.advanceTime(timeout); PVV_SAFE("Step 9. Waiting QUEUE_OPEN_RESULT event..."); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_TIMEOUT)); @@ -9873,8 +9894,8 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 10. Restore the channel"); obj.setChannel(); - ASSERT(obj.waitReconnectedEvent()); - ASSERT(obj.waitStateRestoredEvent()); + BMQTST_ASSERT(obj.waitReconnectedEvent()); + BMQTST_ASSERT(obj.waitStateRestoredEvent()); } } @@ -9885,7 +9906,7 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) PVV_SAFE("Step 12. Trigger channel drop"); obj.session().setChannel(bsl::shared_ptr()); - ASSERT(obj.waitConnectionLostEvent()); + BMQTST_ASSERT(obj.waitConnectionLostEvent()); PVV_SAFE("Step 13. Checking async configure..."); int rc = obj.session().configureQueueAsync(pQueue, @@ -9906,7 +9927,7 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) configRes = bmqp_ctrlmsg::StatusCategory::E_TIMEOUT; } - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, configRes)); @@ -9915,7 +9936,7 @@ static void queueExpired(bsls::Types::Uint64 queueFlags) } PVV_SAFE("Step 15. Stop the session"); - ASSERT(obj.stop()); + BMQTST_ASSERT(obj.stop()); } static void test53_queueExpired() @@ -10126,7 +10147,7 @@ static void test54_distributedTrace() PVV_SAFE("Step 1. Starting session..."); obj.startAndConnect(); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.isChannelEmpty()); localFns::fillEventBufferFn(dtEvents, dtEventsQueue, 2u); BMQTST_ASSERT_EQ(dtEvents[0], "START bmq.session.start"); @@ -10170,10 +10191,10 @@ static void test54_distributedTrace() dtEvents.clear(); obj.sendResponse(request); - ASSERT( + BMQTST_ASSERT( obj.verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.isChannelEmpty()); localFns::fillEventBufferFn(dtEvents, dtEventsQueue, 2u); BMQTST_ASSERT_EQ(dtEvents[0], "END bmq.queue.open < test54"); @@ -10182,12 +10203,12 @@ static void test54_distributedTrace() dtEvents.clear(); PVV_SAFE("Step 3. Configure a queue"); - ASSERT(obj.channel().writeCalls().empty()); + BMQTST_ASSERT(obj.channel().writeCalls().empty()); int rc = obj.session().configureQueueAsync(pQueue, pQueue->options(), timeout); BMQTST_ASSERT_EQ(rc, bmqt::ConfigureQueueResult::e_SUCCESS); - ASSERT(obj.channel().waitFor(1, false, bsls::TimeInterval(1))); + BMQTST_ASSERT(obj.channel().waitFor(1, false, bsls::TimeInterval(1))); localFns::fillEventBufferFn(dtEvents, dtEventsQueue, 1u); BMQTST_ASSERT_EQ(dtEvents[0], @@ -10197,10 +10218,10 @@ static void test54_distributedTrace() request = obj.getNextOutboundRequest(TestSession::e_REQ_CONFIG_QUEUE); obj.sendResponse(request); - ASSERT(obj.verifyOperationResult( + BMQTST_ASSERT(obj.verifyOperationResult( bmqt::SessionEventType::e_QUEUE_CONFIGURE_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.isChannelEmpty()); localFns::fillEventBufferFn(dtEvents, dtEventsQueue, 1u); BMQTST_ASSERT_EQ(dtEvents[0], "END bmq.queue.configure"); @@ -10230,7 +10251,7 @@ static void test54_distributedTrace() obj.verifyOpenQueueErrorResult(bmqp_ctrlmsg::StatusCategory::E_UNKNOWN, pQueue, bmqimp::QueueState::e_CLOSED); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.isChannelEmpty()); localFns::fillEventBufferFn(dtEvents, dtEventsQueue, 2u); BMQTST_ASSERT_EQ(dtEvents[0], @@ -10247,10 +10268,10 @@ static void test54_distributedTrace() request = obj.getNextOutboundRequest(TestSession::e_REQ_OPEN_QUEUE); obj.sendResponse(request); - ASSERT( + BMQTST_ASSERT( obj.verifyOperationResult(bmqt::SessionEventType::e_QUEUE_OPEN_RESULT, bmqp_ctrlmsg::StatusCategory::E_SUCCESS)); - ASSERT(obj.isChannelEmpty()); + BMQTST_ASSERT(obj.isChannelEmpty()); localFns::fillEventBufferFn(dtEvents, dtEventsQueue, 2u); BMQTST_ASSERT_EQ(dtEvents[0], diff --git a/src/groups/bmq/bmqimp/bmqimp_event.t.cpp b/src/groups/bmq/bmqimp/bmqimp_event.t.cpp index 1f9472977..7aa758f8f 100644 --- a/src/groups/bmq/bmqimp/bmqimp_event.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_event.t.cpp @@ -94,9 +94,9 @@ static void prepareBlobForMessageEvent(bmqp::EventHeader* eh, bmqt::MessageGUID* messageGUID, bmqp::EventType::Enum type) { - ASSERT(eh); - ASSERT(eb); - ASSERT(messageGUID); + BMQTST_ASSERT(eh); + BMQTST_ASSERT(eb); + BMQTST_ASSERT(messageGUID); bmqt::MessageGUID& guid = *messageGUID; (*eh).setType(type).setHeaderWords(k_EVENT_HEADER_WORDS); @@ -266,7 +266,7 @@ static void test1_breathingTest() bmqp::Event event(&eventBlob, bmqtst::TestHelperUtil::allocator()); // Fails to configure initialized event - ASSERT_OPT_FAIL(obj.configureAsMessageEvent(event)); + BMQTST_ASSERT_OPT_FAIL(obj.configureAsMessageEvent(event)); obj.clear(); BMQTST_ASSERT_EQ(obj.type(), bmqimp::Event::EventType::e_UNINITIALIZED); @@ -274,25 +274,25 @@ static void test1_breathingTest() obj.configureAsMessageEvent(event); BMQTST_ASSERT_EQ(obj.type(), bmqimp::Event::EventType::e_MESSAGE); - ASSERT(obj.rawEvent().isValid()); - ASSERT(obj.rawEvent().isAckEvent()); + BMQTST_ASSERT(obj.rawEvent().isValid()); + BMQTST_ASSERT(obj.rawEvent().isAckEvent()); PV("Configure as RawEvent"); // Fails to configure initialized event - ASSERT_OPT_FAIL(obj.configureAsRawEvent(event)); + BMQTST_ASSERT_OPT_FAIL(obj.configureAsRawEvent(event)); obj.clear(); BMQTST_ASSERT_EQ(obj.type(), bmqimp::Event::EventType::e_UNINITIALIZED); // Fails to configure as raw event with not cloned underlying event - ASSERT_OPT_FAIL(obj.configureAsRawEvent(event)); + BMQTST_ASSERT_OPT_FAIL(obj.configureAsRawEvent(event)); obj.configureAsRawEvent(event.clone(bmqtst::TestHelperUtil::allocator())); BMQTST_ASSERT_EQ(obj.type(), bmqimp::Event::EventType::e_RAW); - ASSERT(obj.rawEvent().isValid()); - ASSERT(obj.rawEvent().isAckEvent()); + BMQTST_ASSERT(obj.rawEvent().isValid()); + BMQTST_ASSERT(obj.rawEvent().isAckEvent()); } static void test2_setterGetterTest() @@ -518,7 +518,7 @@ static void test4_messageEvent_setterGetterTest() obj.setMessageCorrelationIdContainer(&container); bmqimp::MessageCorrelationIdContainer* container_p = obj.messageCorrelationIdContainer(); - ASSERT(container_p); + BMQTST_ASSERT(container_p); BMQTST_ASSERT_EQ(&container, container_p); } @@ -804,16 +804,16 @@ static void test6_comparisonOperatorTest() .setErrorDescription(errorDescription) .setStatusCode(statusCode); - ASSERT(obj1 == obj2); + BMQTST_ASSERT(obj1 == obj2); obj2.setErrorDescription("Different description"); - ASSERT(obj1 != obj2); + BMQTST_ASSERT(obj1 != obj2); obj1.setType(bmqimp::Event::EventType::e_UNINITIALIZED); - ASSERT(obj1 != obj2); + BMQTST_ASSERT(obj1 != obj2); obj2.setType(bmqimp::Event::EventType::e_UNINITIALIZED); - ASSERT(obj1 == obj2); + BMQTST_ASSERT(obj1 == obj2); PV("Configure as MesageEvent"); bmqimp::Event obj3(&bufferFactory, bmqtst::TestHelperUtil::allocator()); @@ -822,7 +822,7 @@ static void test6_comparisonOperatorTest() obj4.configureAsMessageEvent(&blobSpPool); // NOTE: Message event can not be equal. Is it expected? - ASSERT(obj3 != obj4); + BMQTST_ASSERT(obj3 != obj4); PV("Configure as RawEvent"); prepareBlobForMessageEvent(&eventHeader, @@ -836,7 +836,7 @@ static void test6_comparisonOperatorTest() obj6.configureAsRawEvent(event.clone(bmqtst::TestHelperUtil::allocator())); // NOTE: Raw event can not be equal - ASSERT(obj5 != obj6); + BMQTST_ASSERT(obj5 != obj6); } static void test7_printing() @@ -1000,7 +1000,7 @@ static void test7_printing() break; } default: { - ASSERT(false && "Unknown bmqimp::Event::EventType"); + BMQTST_ASSERT(false && "Unknown bmqimp::Event::EventType"); break; } } @@ -1046,7 +1046,7 @@ static void test7_printing() } break; case bmqimp::Event::EventType::e_REQUEST: default: { - ASSERT(false && "Unknown Event type"); + BMQTST_ASSERT(false && "Unknown Event type"); } } expected << " ]"; @@ -1080,7 +1080,7 @@ static void test7_printing() obj.setType(static_cast( bsl::numeric_limits::min())); - ASSERT_OPT_FAIL(out << obj); + BMQTST_ASSERT_OPT_FAIL(out << obj); out.reset(); } } @@ -1220,14 +1220,14 @@ static void test8_putEventBuilder() bmqp::Event rawEvent(builder.blob().get(), bmqtst::TestHelperUtil::allocator()); - ASSERT(rawEvent.isValid()); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isValid()); + BMQTST_ASSERT(rawEvent.isPutEvent()); bmqp::PutMessageIterator putIter(&bufferFactory, bmqtst::TestHelperUtil::allocator()); rawEvent.loadPutMessageIterator(&putIter, true); - ASSERT(putIter.isValid()); + BMQTST_ASSERT(putIter.isValid()); bdlbb::Blob payloadBlob(bmqtst::TestHelperUtil::allocator()); for (size_t idx = 0; idx < k_NUM_DATA; ++idx) { @@ -1242,8 +1242,8 @@ static void test8_putEventBuilder() payloadBlob.removeAll(); - ASSERT(putIter.loadMessagePayload(&payloadBlob) == 0); - ASSERT(putIter.messagePayloadSize() == k_PAYLOAD_LEN); + BMQTST_ASSERT(putIter.loadMessagePayload(&payloadBlob) == 0); + BMQTST_ASSERT(putIter.messagePayloadSize() == k_PAYLOAD_LEN); int res, compareResult; res = bmqu::BlobUtil::compareSection(&compareResult, @@ -1375,7 +1375,7 @@ static void test9_copyTest() bmqimp::Event obj5(obj, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj5 == obj); + BMQTST_ASSERT(obj5 == obj); PV("Configure as RawEvent"); obj.reset(); @@ -1473,7 +1473,7 @@ static void test10_assignmentTest() bmqimp::Event obj5(&bufferFactory, bmqtst::TestHelperUtil::allocator()); obj5 = obj; - ASSERT(obj5 == obj); + BMQTST_ASSERT(obj5 == obj); PV("ASSIGNMENT OPERATOR - Configure as RawEvent"); obj.reset(); diff --git a/src/groups/bmq/bmqimp/bmqimp_eventqueue.h b/src/groups/bmq/bmqimp/bmqimp_eventqueue.h index 046ab96b8..aa4a22fb6 100644 --- a/src/groups/bmq/bmqimp/bmqimp_eventqueue.h +++ b/src/groups/bmq/bmqimp/bmqimp_eventqueue.h @@ -92,7 +92,7 @@ // // // Let's read the item from the queue // bsl::shared_ptr dequeuedEvent = queue.popFront(); -// ASSERT(*dequeuedEvent == *event); +// BMQTST_ASSERT(*dequeuedEvent == *event); //.. // /// Usage Example (using the thread pool for processing events) diff --git a/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp b/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp index 60f736549..b05b66a2e 100644 --- a/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp @@ -308,14 +308,14 @@ static void test2_capacityTest() for (int i = 0; i < k_INITIAL_CAPACITY + 1 + 2; ++i) { event = obj.popFront(); PVV("Dequeued: " << (*event)); - ASSERT(event != 0); + BMQTST_ASSERT(event != 0); } // No more events bsls::TimeInterval timeout(0, 2000000); // 2 ms event = obj.timedPopFront(timeout); - ASSERT(event != 0); + BMQTST_ASSERT(event != 0); BMQTST_ASSERT_EQ(event->sessionEventType(), bmqt::SessionEventType::e_TIMEOUT); } @@ -514,7 +514,7 @@ static void test5_emptyStatsTest() 0, // numProcessingThreads bmqtst::TestHelperUtil::allocator()); - ASSERT_SAFE_FAIL(obj.printStats(out, false)); + BMQTST_ASSERT_SAFE_FAIL(obj.printStats(out, false)); obj.initializeStats(&rootStatContext, start, end); @@ -650,7 +650,7 @@ static void test6_workingStatsTest() // And dequeue some of them for (int i = 0; i < k_QUEUE_POPPED; ++i) { event = obj.popFront(); - ASSERT(event != 0); + BMQTST_ASSERT(event != 0); PVV("Dequeued: " << (*event)); } @@ -664,7 +664,7 @@ static void test6_workingStatsTest() const bmqst::StatContext* pSubCtx = rootStatContext.getSubcontext( "EventQueue"); - ASSERT(pSubCtx != 0); + BMQTST_ASSERT(pSubCtx != 0); BMQTST_ASSERT_EQ(pSubCtx->numValues(), 2); BMQTST_ASSERT_EQ(pSubCtx->valueName(0), "Queue"); BMQTST_ASSERT_EQ(pSubCtx->valueName(1), "Time"); diff --git a/src/groups/bmq/bmqimp/bmqimp_queue.t.cpp b/src/groups/bmq/bmqimp/bmqimp_queue.t.cpp index 302ef2a9f..e4d2ee046 100644 --- a/src/groups/bmq/bmqimp/bmqimp_queue.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_queue.t.cpp @@ -81,7 +81,7 @@ static void test1_breathingTest() BMQTST_ASSERT_EQ(obj.pendingConfigureId(), k_INVALID_CONFIGURE_ID); BMQTST_ASSERT_EQ(obj.flags(), 0u); - ASSERT(obj.hasDefaultSubQueueId()); + BMQTST_ASSERT(obj.hasDefaultSubQueueId()); BMQTST_ASSERT_EQ(obj.uri(), ""); BMQTST_ASSERT_EQ(obj.state(), k_STATE); @@ -169,7 +169,7 @@ static void test2_settersTest() BMQTST_ASSERT_EQ(obj.handleParameters().readCount(), 1); BMQTST_ASSERT_EQ(obj.handleParameters().adminCount(), 1); - ASSERT(!obj.hasDefaultSubQueueId()); + BMQTST_ASSERT(!obj.hasDefaultSubQueueId()); } static void test3_printQueueStateTest() @@ -366,7 +366,7 @@ static void test5_comparisionTest() bmqimp::Queue obj1(bmqtst::TestHelperUtil::allocator()); bmqimp::Queue obj2(bmqtst::TestHelperUtil::allocator()); - ASSERT(obj1 == obj2); + BMQTST_ASSERT(obj1 == obj2); // Check setters const char k_URI[] = "bmq://ts.trades.myapp/my.queue?id=my.app"; @@ -396,12 +396,12 @@ static void test5_comparisionTest() .setOptions(options) .setPendingConfigureId(k_PENDING_ID); - ASSERT(obj1 != obj2); + BMQTST_ASSERT(obj1 != obj2); obj2.setUri(uri).setState(k_STATE).setCorrelationId(k_CORID).setFlags( flags); - ASSERT(obj1 == obj2); + BMQTST_ASSERT(obj1 == obj2); } static void test6_statTest() @@ -458,17 +458,17 @@ static void test6_statTest() bmqst::StatContext* pStatContext = queuesStats.d_statContext_mp.get(); - ASSERT(pStatContext != 0); + BMQTST_ASSERT(pStatContext != 0); - ASSERT_SAFE_FAIL(obj.registerStatContext(pStatContext)); - ASSERT_SAFE_FAIL(obj.statUpdateOnMessage(1, true)); - ASSERT_SAFE_FAIL(obj.statReportCompressionRatio(2)); + BMQTST_ASSERT_SAFE_FAIL(obj.registerStatContext(pStatContext)); + BMQTST_ASSERT_SAFE_FAIL(obj.statUpdateOnMessage(1, true)); + BMQTST_ASSERT_SAFE_FAIL(obj.statReportCompressionRatio(2)); obj.setUri(uri); - ASSERT_SAFE_FAIL(obj.registerStatContext(pStatContext)); - ASSERT_SAFE_FAIL(obj.statUpdateOnMessage(1, true)); - ASSERT_SAFE_FAIL(obj.statReportCompressionRatio(2)); + BMQTST_ASSERT_SAFE_FAIL(obj.registerStatContext(pStatContext)); + BMQTST_ASSERT_SAFE_FAIL(obj.statUpdateOnMessage(1, true)); + BMQTST_ASSERT_SAFE_FAIL(obj.statReportCompressionRatio(2)); obj.setState(k_STATE); obj.registerStatContext(pStatContext); @@ -481,7 +481,7 @@ static void test6_statTest() const bmqst::StatContext* k_pSubContext = rootStatContext.getSubcontext( k_STAT_NAME); - ASSERT(k_pSubContext != 0); + BMQTST_ASSERT(k_pSubContext != 0); BMQTST_ASSERT_EQ(k_pSubContext->numValues(), 3); BMQTST_ASSERT_EQ(k_pSubContext->valueName(0), "in"); BMQTST_ASSERT_EQ(k_pSubContext->valueName(1), "out"); @@ -512,8 +512,8 @@ static void test6_statTest() 2 * 10000); // scaling factor obj.clearStatContext(); - ASSERT_SAFE_FAIL(obj.statUpdateOnMessage(1, true)); - ASSERT_SAFE_FAIL(obj.statReportCompressionRatio(2)); + BMQTST_ASSERT_SAFE_FAIL(obj.statUpdateOnMessage(1, true)); + BMQTST_ASSERT_SAFE_FAIL(obj.statReportCompressionRatio(2)); } } // close unnamed namespace diff --git a/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp b/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp index fe63a13f8..c9731fc0a 100644 --- a/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_queuemanager.t.cpp @@ -118,11 +118,11 @@ static void test1_breathingTest() bsl::vector queues( bmqtst::TestHelperUtil::allocator()); obj.lookupQueuesByState(&queues, k_QUEUE_STATE); - ASSERT(obj.lookupQueue(uri).get() == 0); - ASSERT(obj.lookupQueue(k_CORID).get() == 0); + BMQTST_ASSERT(obj.lookupQueue(uri).get() == 0); + BMQTST_ASSERT(obj.lookupQueue(k_CORID).get() == 0); BMQTST_ASSERT_EQ(queues.size(), 0U); - ASSERT_SAFE_FAIL(obj.subStreamCount( + BMQTST_ASSERT_SAFE_FAIL(obj.subStreamCount( bsl::string(uri.canonical(), bmqtst::TestHelperUtil::allocator()))); } @@ -171,10 +171,10 @@ static void test2_generateQueueIdTest() bmqt::Uri emptyUri(bmqtst::TestHelperUtil::allocator()); // NULL output QueueId - ASSERT_SAFE_FAIL(obj.generateQueueAndSubQueueId(0, uri, 0)); + BMQTST_ASSERT_SAFE_FAIL(obj.generateQueueAndSubQueueId(0, uri, 0)); // Not valid URI - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( obj.generateQueueAndSubQueueId(&queueId, emptyUri, 0)); } @@ -316,25 +316,25 @@ static void test3_insertQueueTest() bmqimp::QueueManager::QueueSp queueSp; // Cannot insert null object - ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); + BMQTST_ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); queueSp.createInplace(bmqtst::TestHelperUtil::allocator(), bmqtst::TestHelperUtil::allocator()); // Cannot insert queue object without queue ID. - ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); + BMQTST_ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); bmqp::QueueId queueId(bmqimp::Queue::k_INVALID_QUEUE_ID); queueSp->setId(queueId.id()); // Cannot insert queue object with invalid queue ID. - ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); + BMQTST_ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); queueId.setId(123); queueSp->setId(queueId.id()); // Cannot insert queue object with not generated queue ID. - ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); + BMQTST_ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); bsls::Types::Uint64 flags = 0; bmqt::QueueFlagsUtil::setReader(&flags); @@ -358,17 +358,17 @@ static void test3_insertQueueTest() BMQTST_ASSERT_EQ(queues.size(), 1U); - ASSERT(obj.lookupQueue(uri) == queueSp); - ASSERT(obj.lookupQueue(k_CORID) == queueSp); - ASSERT(obj.lookupQueue(queueId) == queueSp); + BMQTST_ASSERT(obj.lookupQueue(uri) == queueSp); + BMQTST_ASSERT(obj.lookupQueue(k_CORID) == queueSp); + BMQTST_ASSERT(obj.lookupQueue(queueId) == queueSp); - ASSERT(obj.subStreamCount( - bsl::string(uri.canonical(), - bmqtst::TestHelperUtil::allocator())) == 0); + BMQTST_ASSERT(obj.subStreamCount( + bsl::string(uri.canonical(), + bmqtst::TestHelperUtil::allocator())) == 0); // Cannot insert the second queue object with the same queue and subqueue // ID. - ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); + BMQTST_ASSERT_SAFE_FAIL(obj.insertQueue(queueSp)); } static void test4_lookupQueueByUri() @@ -420,8 +420,8 @@ static void test4_lookupQueueByUri() obj.insertQueue(queueSp); - ASSERT(obj.lookupQueue(uri1) == queueSp); - ASSERT(obj.lookupQueue(uri2) == bmqimp::QueueManager::QueueSp()); + BMQTST_ASSERT(obj.lookupQueue(uri1) == queueSp); + BMQTST_ASSERT(obj.lookupQueue(uri2) == bmqimp::QueueManager::QueueSp()); } static void test6_removeQueueTest() @@ -473,13 +473,13 @@ static void test6_removeQueueTest() obj.insertQueue(queueSp); - ASSERT(obj.removeQueue(queueSp.get()) == queueSp); - ASSERT(obj.lookupQueue(uri) == 0); - ASSERT(obj.lookupQueue(k_CORID) == 0); - ASSERT(obj.lookupQueue(queueId) == 0); + BMQTST_ASSERT(obj.removeQueue(queueSp.get()) == queueSp); + BMQTST_ASSERT(obj.lookupQueue(uri) == 0); + BMQTST_ASSERT(obj.lookupQueue(k_CORID) == 0); + BMQTST_ASSERT(obj.lookupQueue(queueId) == 0); // Cannot remove the same queue object twice - ASSERT((!(obj.removeQueue(queueSp.get())))); + BMQTST_ASSERT((!(obj.removeQueue(queueSp.get())))); } static void test8_substreamCountTest() @@ -530,17 +530,17 @@ static void test8_substreamCountTest() bsl::string uriCanonical(uri.canonical(), bmqtst::TestHelperUtil::allocator()); - ASSERT_SAFE_FAIL(obj.incrementSubStreamCount(uriCanonical)); - ASSERT_SAFE_FAIL(obj.decrementSubStreamCount(uriCanonical)); - ASSERT_SAFE_FAIL(obj.resetSubStreamCount(uriCanonical)); - ASSERT_SAFE_FAIL(obj.subStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.incrementSubStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.decrementSubStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.resetSubStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.subStreamCount(uriCanonical)); obj.insertQueue(queueSp); - ASSERT(obj.lookupQueue(queueId) == queueSp); + BMQTST_ASSERT(obj.lookupQueue(queueId) == queueSp); BMQTST_ASSERT_EQ(obj.subStreamCount(uriCanonical), 0U); - ASSERT_SAFE_FAIL(obj.decrementSubStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.decrementSubStreamCount(uriCanonical)); obj.incrementSubStreamCount(uriCanonical); obj.incrementSubStreamCount(uriCanonical); @@ -558,10 +558,10 @@ static void test8_substreamCountTest() obj.resetState(); - ASSERT_SAFE_FAIL(obj.incrementSubStreamCount(uriCanonical)); - ASSERT_SAFE_FAIL(obj.decrementSubStreamCount(uriCanonical)); - ASSERT_SAFE_FAIL(obj.resetSubStreamCount(uriCanonical)); - ASSERT_SAFE_FAIL(obj.subStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.incrementSubStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.decrementSubStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.resetSubStreamCount(uriCanonical)); + BMQTST_ASSERT_SAFE_FAIL(obj.subStreamCount(uriCanonical)); } static void test9_pushStatsTest() @@ -617,10 +617,10 @@ static void test9_pushStatsTest() bmqimp::QueueManager obj(bmqtst::TestHelperUtil::allocator()); // Fails due to empty iterator - ASSERT_SAFE_FAIL(obj.onPushEvent(&eventInfos, - &eventMessageCount, - &hasMessageWithMultipleSubQueueIds, - msgIterator)); + BMQTST_ASSERT_SAFE_FAIL(obj.onPushEvent(&eventInfos, + &eventMessageCount, + &hasMessageWithMultipleSubQueueIds, + msgIterator)); // Make a valid iterator obj.generateQueueAndSubQueueId(&queueId, uri, flags); @@ -643,10 +643,10 @@ static void test9_pushStatsTest() rawEvent.loadPushMessageIterator(&msgIterator); // Fails due to no queues - ASSERT_SAFE_FAIL(obj.onPushEvent(&eventInfos, - &eventMessageCount, - &hasMessageWithMultipleSubQueueIds, - msgIterator)); + BMQTST_ASSERT_SAFE_FAIL(obj.onPushEvent(&eventInfos, + &eventMessageCount, + &hasMessageWithMultipleSubQueueIds, + msgIterator)); // Add a queue with enabled statistics queueSp.createInplace(bmqtst::TestHelperUtil::allocator(), @@ -730,7 +730,7 @@ static void test10_putStatsTest() bmqimp::QueueManager obj(bmqtst::TestHelperUtil::allocator()); // Fails due to empty iterator - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( obj.updateStatsOnPutEvent(&eventMessageCount, msgIterator)); // Make a valid iterator @@ -752,7 +752,7 @@ static void test10_putStatsTest() rawEvent.loadPutMessageIterator(&msgIterator); // Fails due to no queues - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( obj.updateStatsOnPutEvent(&eventMessageCount, msgIterator)); // Add a queue with enabled statistics diff --git a/src/groups/bmq/bmqio/bmqio_channelutil.t.cpp b/src/groups/bmq/bmqio/bmqio_channelutil.t.cpp index 52651ecf5..f659403b6 100644 --- a/src/groups/bmq/bmqio/bmqio_channelutil.t.cpp +++ b/src/groups/bmq/bmqio/bmqio_channelutil.t.cpp @@ -352,11 +352,11 @@ static void test3_isLocalHost() { PVV("'LOCALHOST' - TRUE"); - ASSERT(bmqio::ChannelUtil::isLocalHost("localhost")); - ASSERT(bmqio::ChannelUtil::isLocalHost("LoCaLhOsT")); + BMQTST_ASSERT(bmqio::ChannelUtil::isLocalHost("localhost")); + BMQTST_ASSERT(bmqio::ChannelUtil::isLocalHost("LoCaLhOsT")); PVV("'WWW.WIKIPEDIA.ORG' - FALSE") - ASSERT(!bmqio::ChannelUtil::isLocalHost("www.wikipedia.org")); + BMQTST_ASSERT(!bmqio::ChannelUtil::isLocalHost("www.wikipedia.org")); } { @@ -371,7 +371,7 @@ static void test3_isLocalHost() bsl::vector::const_iterator it; for (it = localIPs.begin(); it != localIPs.end(); ++it) { PVV(*it); - ASSERT(bmqio::ChannelUtil::isLocalHost(*it)); + BMQTST_ASSERT(bmqio::ChannelUtil::isLocalHost(*it)); } } } diff --git a/src/groups/bmq/bmqio/bmqio_ntcchannel.t.cpp b/src/groups/bmq/bmqio/bmqio_ntcchannel.t.cpp index 24e459286..29a488054 100644 --- a/src/groups/bmq/bmqio/bmqio_ntcchannel.t.cpp +++ b/src/groups/bmq/bmqio/bmqio_ntcchannel.t.cpp @@ -74,14 +74,14 @@ ntca::InterfaceConfig ntcCreateInterfaceConfig(bslma::Allocator* allocator) void doFail() { - ASSERT(false && "Must not be invoked"); + BMQTST_ASSERT(false && "Must not be invoked"); } void executeOnClosedChannelFunc(bmqio::NtcChannel* channel, const Status& status) { // PRECONDITIONS - ASSERT(channel); + BMQTST_ASSERT(channel); BSLA_MAYBE_UNUSED bslma::Allocator* alloc = channel->allocator(); BSLA_MAYBE_UNUSED int id = channel->channelId(); @@ -289,7 +289,7 @@ void Tester::init() d_listener_sp = d_interface_sp->createListenerSocket(listenerSocketOptions, d_allocator_p); - ASSERT(d_listener_sp); + BMQTST_ASSERT(d_listener_sp); error = d_listener_sp->open(); BMQTST_ASSERT_EQ(error, ntsa::Error::e_OK); @@ -298,8 +298,8 @@ void Tester::init() BMQTST_ASSERT_EQ(error, ntsa::Error::e_OK); const ntsa::Endpoint endpoint = d_listener_sp->sourceEndpoint(); - ASSERT(endpoint.isIp()); - ASSERT(endpoint.ip().host().isV4()); + BMQTST_ASSERT(endpoint.isIp()); + BMQTST_ASSERT(endpoint.ip().host().isV4()); } bsl::shared_ptr Tester::connect() diff --git a/src/groups/bmq/bmqio/bmqio_ntcchannelfactory.t.cpp b/src/groups/bmq/bmqio/bmqio_ntcchannelfactory.t.cpp index 8345c2965..b25f1a5a1 100644 --- a/src/groups/bmq/bmqio/bmqio_ntcchannelfactory.t.cpp +++ b/src/groups/bmq/bmqio/bmqio_ntcchannelfactory.t.cpp @@ -502,7 +502,8 @@ void Tester::channelReadCb(const bsl::string& channelName, if (!status) { if (status.category() != StatusCategory::e_CANCELED && status.category() != StatusCategory::e_CONNECTION) { - ASSERT_D(channelName.c_str() << ", " << status.category(), false); + BMQTST_ASSERT_D(channelName.c_str() << ", " << status.category(), + false); return; // RETURN } return; // RETURN @@ -721,7 +722,7 @@ void Tester::cancelHandle(int line, const bslstl::StringRef& handleName) bslmt::LockGuard guard(&d_mutex); // LOCK HandleInfo& info = d_handleMap[handleName]; if (!info.d_handle) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } @@ -734,7 +735,7 @@ void Tester::closeChannel(int line, const bslstl::StringRef& channelName) ChannelInfo& info = d_channelMap[channelName]; if (!info.d_channel) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } @@ -749,7 +750,7 @@ void Tester::blockChannelIo(int line, const bslstl::StringRef& channelName) info = &d_channelMap[channelName]; if (!info->d_channel) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } } @@ -764,7 +765,7 @@ void Tester::unblockChannelIo(int line, const bslstl::StringRef& channelName) info = &d_channelMap[channelName]; if (!info->d_channel) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } } @@ -785,7 +786,7 @@ void Tester::writeChannel(int line, ChannelInfo& info = d_channelMap[channelName]; if (!info.d_channel) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } @@ -802,7 +803,7 @@ void Tester::readChannel(int line, ChannelInfo& info = d_channelMap[channelName]; if (!info.d_channel) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } @@ -816,7 +817,7 @@ void Tester::readChannel(int line, if (info.d_readData.length() < static_cast(data.length())) { PRINT(bdlbb::BlobUtilHexDumper(&info.d_readData)); - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } @@ -861,7 +862,7 @@ void Tester::checkResultCallback(int line, } if (info.d_resultCbCalls.empty()) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } @@ -928,7 +929,7 @@ void Tester::checkNoResultCallback(int line, bslmt::LockGuard guard(&d_mutex); // LOCK HandleInfo& info = d_handleMap[handleName]; - ASSERT_D(line, info.d_resultCbCalls.empty()); + BMQTST_ASSERT_D(line, info.d_resultCbCalls.empty()); } void Tester::checkChannelClose(int line, @@ -968,7 +969,8 @@ void Tester::checkChannelWatermark(int line, } if (info.d_watermarkEvents.empty()) { - ASSERT_D("line: " << line << ", no watermark events received", false); + BMQTST_ASSERT_D("line: " << line << ", no watermark events received", + false); return; // RETURN } @@ -983,7 +985,7 @@ void Tester::checkNoChannelWatermark(int line, bslmt::LockGuard guard(&d_mutex); ChannelInfo& info = d_channelMap[channelName]; if (!info.d_watermarkEvents.empty()) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } } @@ -995,7 +997,7 @@ void Tester::checkChannelUri(int line, bslmt::LockGuard guard(&d_mutex); ChannelInfo& info = d_channelMap[channelName]; if (!info.d_channel) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } @@ -1027,7 +1029,7 @@ void Tester::startFilteringLogs(const bsl::string& messageSubstring) void Tester::checkFilteredLogs(int line, int expected) { if (!d_ballObserver) { - ASSERT_D(line, false); + BMQTST_ASSERT_D(line, false); return; // RETURN } diff --git a/src/groups/bmq/bmqio/bmqio_reconnectingchannelfactory.t.cpp b/src/groups/bmq/bmqio/bmqio_reconnectingchannelfactory.t.cpp index 0874047db..494d2aba8 100644 --- a/src/groups/bmq/bmqio/bmqio_reconnectingchannelfactory.t.cpp +++ b/src/groups/bmq/bmqio/bmqio_reconnectingchannelfactory.t.cpp @@ -251,8 +251,8 @@ Tester::Tester() Tester::~Tester() { // Some invariants checking - ASSERT(d_connectResultItems.empty()); - ASSERT(d_baseFactory.connectCalls().empty()); + BMQTST_ASSERT(d_connectResultItems.empty()); + BMQTST_ASSERT(d_baseFactory.connectCalls().empty()); obj().stop(); d_reconnectingFactory.object() @@ -315,7 +315,7 @@ void Tester::connect(const ConnectOptions& options) bdlf::PlaceHolders::_1, bdlf::PlaceHolders::_2, bdlf::PlaceHolders::_3)); - ASSERT(status); + BMQTST_ASSERT(status); } void Tester::closeChannel() @@ -411,7 +411,7 @@ BMQTST_TEST_F(Tester, SingleHost) // Advance by less than the reconnect interval, and verify no connect // were called yet advanceSchedulerTime(k_RECONNECT_INTERVAL - 1); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); // Advance time to trigger the reconnect advanceSchedulerTime(1); @@ -422,7 +422,7 @@ BMQTST_TEST_F(Tester, SingleHost) // No more events expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } { @@ -431,7 +431,7 @@ BMQTST_TEST_F(Tester, SingleHost) // No connect should have happened yet advanceSchedulerTime(k_RECONNECT_INTERVAL - 1); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); // Connect Attempt Failed [1/3] advanceSchedulerTime(1); @@ -457,7 +457,7 @@ BMQTST_TEST_F(Tester, SingleHost) // NumAttempt exhausted, no more connection expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } BMQTST_TEST_F(Tester, MultipleHosts) @@ -499,7 +499,7 @@ BMQTST_TEST_F(Tester, MultipleHosts) // Advance by less than the reconnect interval, and verify no connect // were called yet advanceSchedulerTime(k_RECONNECT_INTERVAL - 1); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); // Advance time to trigger the reconnect advanceSchedulerTime(1); @@ -516,7 +516,7 @@ BMQTST_TEST_F(Tester, MultipleHosts) // No more events expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } { @@ -525,7 +525,7 @@ BMQTST_TEST_F(Tester, MultipleHosts) // No connect should have happened yet advanceSchedulerTime(k_RECONNECT_INTERVAL - 1); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); // Connect Attempt Failed [1/3] advanceSchedulerTime(1); @@ -575,7 +575,7 @@ BMQTST_TEST_F(Tester, MultipleHosts) // NumAttempt exhausted, no more connection expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } BMQTST_TEST_F(Tester, EmptyAndChangingResolvingList) @@ -654,11 +654,11 @@ BMQTST_TEST_F(Tester, EmptyAndChangingResolvingList) advanceSchedulerTime(1); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); checkResult(L_, ChannelFactoryEvent::e_CONNECT_ATTEMPT_FAILED); advanceSchedulerTime(k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); checkResult(L_, ChannelFactoryEvent::e_CONNECT_ATTEMPT_FAILED); } @@ -740,7 +740,7 @@ BMQTST_TEST_F(Tester, NonReconnecting) // No more events expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } { @@ -765,11 +765,11 @@ BMQTST_TEST_F(Tester, NonReconnecting) checkResult(L_, ChannelFactoryEvent::e_CHANNEL_UP); // Ensure the factory did not register a channel down observer - ASSERT(testChannel().onCloseCalls().empty()); + BMQTST_ASSERT(testChannel().onCloseCalls().empty()); // No more events expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } { @@ -826,7 +826,7 @@ BMQTST_TEST_F(Tester, NonReconnecting) // No more events expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } { @@ -864,11 +864,11 @@ BMQTST_TEST_F(Tester, NonReconnecting) checkResult(L_, ChannelFactoryEvent::e_CHANNEL_UP); // Ensure the factory did not register a channel down observer - ASSERT(testChannel().onCloseCalls().empty()); + BMQTST_ASSERT(testChannel().onCloseCalls().empty()); // No more events expected advanceSchedulerTime(2 * k_RECONNECT_INTERVAL); - ASSERT(baseFactory().connectCalls().empty()); + BMQTST_ASSERT(baseFactory().connectCalls().empty()); } } diff --git a/src/groups/bmq/bmqio/bmqio_resolveutil.t.cpp b/src/groups/bmq/bmqio/bmqio_resolveutil.t.cpp index 5bc4b9fa1..f80c5e22b 100644 --- a/src/groups/bmq/bmqio/bmqio_resolveutil.t.cpp +++ b/src/groups/bmq/bmqio/bmqio_resolveutil.t.cpp @@ -44,7 +44,7 @@ static void test1_breathingTest() bsl::string hostname(bmqtst::TestHelperUtil::allocator()); ntsa::Ipv4Address hostIp; - ASSERT(hostname.empty()); + BMQTST_ASSERT(hostname.empty()); { PVV("GET HOSTNAME"); @@ -52,7 +52,7 @@ static void test1_breathingTest() ntsa::Error error = bmqio::ResolveUtil::getHostname(&hostname); BMQTST_ASSERT_EQ(error.code(), ntsa::Error::e_OK); - ASSERT(!hostname.empty()); + BMQTST_ASSERT(!hostname.empty()); PVV(hostname); } @@ -77,7 +77,7 @@ static void test1_breathingTest() &domainName, ntsa::IpAddress(hostIp)); BMQTST_ASSERT_EQ(error.code(), ntsa::Error::e_OK); - ASSERT(!domainName.empty()); + BMQTST_ASSERT(!domainName.empty()); PVV(domainName); } @@ -124,7 +124,7 @@ static void test1_breathingTest() } } - ASSERT(foundLoopback); + BMQTST_ASSERT(foundLoopback); } } diff --git a/src/groups/bmq/bmqio/bmqio_resolvingchannelfactory.t.cpp b/src/groups/bmq/bmqio/bmqio_resolvingchannelfactory.t.cpp index 9e8915a2d..b4da283e9 100644 --- a/src/groups/bmq/bmqio/bmqio_resolvingchannelfactory.t.cpp +++ b/src/groups/bmq/bmqio/bmqio_resolvingchannelfactory.t.cpp @@ -38,16 +38,16 @@ testResolveFn(bsl::string* domainName, bsl::vector* retHosts, bsl::vector* expectedAddresses) { - ASSERT(!expectedAddresses->empty()); + BMQTST_ASSERT(!expectedAddresses->empty()); if (address != (*expectedAddresses)[0]) { bsl::ostringstream ss; ss << address; - ASSERT_D(ss.str(), false); + BMQTST_ASSERT_D(ss.str(), false); } expectedAddresses->erase(expectedAddresses->begin()); - ASSERT(!retHosts->empty()); + BMQTST_ASSERT(!retHosts->empty()); *domainName = (*retHosts)[0]; retHosts->erase(retHosts->begin()); if (domainName->length() == 0) { @@ -242,7 +242,7 @@ static void test2_channelFactory() execStore[0](); - ASSERT(expectedAddresses.empty()); + BMQTST_ASSERT(expectedAddresses.empty()); BMQTST_ASSERT_EQ(channels[0]->peerUri(), "1.2.3.4~testHost:567"); @@ -258,7 +258,7 @@ static void test2_channelFactory() execStore[1](); - ASSERT(expectedAddresses.empty()); + BMQTST_ASSERT(expectedAddresses.empty()); BMQTST_ASSERT_EQ(channels[1]->peerUri(), "1.2.3.4:567"); diff --git a/src/groups/bmq/bmqma/bmqma_countingallocator.t.cpp b/src/groups/bmq/bmqma/bmqma_countingallocator.t.cpp index 5d9bab895..b67ec9400 100644 --- a/src/groups/bmq/bmqma/bmqma_countingallocator.t.cpp +++ b/src/groups/bmq/bmqma/bmqma_countingallocator.t.cpp @@ -105,7 +105,7 @@ static void test1_breathingTest() bmqma::CountingAllocator obj(k_NAME, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj.context() == 0); + BMQTST_ASSERT(obj.context() == 0); } { @@ -156,19 +156,19 @@ static void test2_allocate() // 1. Allocate with 'size' of 0 and verify the returned address is 0. buf = static_cast(obj.allocate(0)); - ASSERT(buf == 0); + BMQTST_ASSERT(buf == 0); // 2. Allocate non-zero number of bytes and verify the allocation was // successful. buf = static_cast(obj.allocate(k_SIZE_ALLOC)); - ASSERT(buf != 0); + BMQTST_ASSERT(buf != 0); bsl::fill_n(buf, k_SIZE_ALLOC, 33); for (bsls::Types::size_type i = 0; i < k_SIZE_ALLOC; ++i) { BMQTST_ASSERT_EQ_D(i, buf[i], 33); } - ASSERT_SAFE_PASS(obj.deallocate(buf)); + BMQTST_ASSERT_SAFE_PASS(obj.deallocate(buf)); } static void test3_deallocate() @@ -239,19 +239,19 @@ static void test3_deallocate() char* buf = 0; // 1. Deallocate null pointer and verify success and no effect. - ASSERT_SAFE_PASS(obj.deallocate(0)); + BMQTST_ASSERT_SAFE_PASS(obj.deallocate(0)); // 2. Deallocate a previous allocation and verify success buf = static_cast(obj.allocate(k_SIZE_ALLOC)); BSLS_ASSERT_OPT(buf != 0); - ASSERT_SAFE_PASS(obj.deallocate(buf)); + BMQTST_ASSERT_SAFE_PASS(obj.deallocate(buf)); // 3. Deallocate previously deallocated memory and verify failure, as // well as ensure that an error is logged. bmqtst::ScopedLogObserver logObserver(ball::Severity::INFO, bmqtst::TestHelperUtil::allocator()); - ASSERT_SAFE_FAIL(obj.deallocate(buf)); + BMQTST_ASSERT_SAFE_FAIL(obj.deallocate(buf)); BMQTST_ASSERT_EQ(logObserver.records().size(), 1U); } @@ -816,4 +816,4 @@ int main(int argc, char** argv) } // --------------------------------------------------------------------------- -// NOTICE: \ No newline at end of file +// NOTICE: diff --git a/src/groups/bmq/bmqma/bmqma_countingallocatorutil.t.cpp b/src/groups/bmq/bmqma/bmqma_countingallocatorutil.t.cpp index c19e1e6b9..dae45a5af 100644 --- a/src/groups/bmq/bmqma/bmqma_countingallocatorutil.t.cpp +++ b/src/groups/bmq/bmqma/bmqma_countingallocatorutil.t.cpp @@ -61,16 +61,16 @@ static void test1_breathingTest() bmqtst::TestHelper::printTestName("BREATHING TEST"); // Prior to initialization, calling the accessors is undefined behavior. - ASSERT_SAFE_FAIL(bmqma::CountingAllocatorUtil::globalStatContext()); - ASSERT_SAFE_FAIL(bmqma::CountingAllocatorUtil::topAllocatorStore()); + BMQTST_ASSERT_SAFE_FAIL(bmqma::CountingAllocatorUtil::globalStatContext()); + BMQTST_ASSERT_SAFE_FAIL(bmqma::CountingAllocatorUtil::topAllocatorStore()); bmqma::CountingAllocatorUtil::initGlobalAllocators("testStatContext", "testAllocatorName"); - ASSERT_SAFE_FAIL(bmqma::CountingAllocatorUtil::initGlobalAllocators( + BMQTST_ASSERT_SAFE_FAIL(bmqma::CountingAllocatorUtil::initGlobalAllocators( "testStatContext", "testAllocatorName")); - ASSERT(bmqma::CountingAllocatorUtil::globalStatContext() != 0); + BMQTST_ASSERT(bmqma::CountingAllocatorUtil::globalStatContext() != 0); BMQTST_ASSERT_EQ(bmqma::CountingAllocatorUtil::globalStatContext()->name(), "testStatContext"); } @@ -101,7 +101,7 @@ static void test2_initGlobalAllocators() bmqma::CountingAllocatorUtil::initGlobalAllocators("testStatContext", "testAllocatorName"); - ASSERT(bmqma::CountingAllocatorUtil::globalStatContext() != 0); + BMQTST_ASSERT(bmqma::CountingAllocatorUtil::globalStatContext() != 0); BMQTST_ASSERT_EQ(bmqma::CountingAllocatorUtil::globalStatContext()->name(), "testStatContext"); @@ -116,8 +116,8 @@ static void test2_initGlobalAllocators() bslma::Allocator* defaultAlloc = topAllocatorStore.get( "Default Allocator"); - ASSERT(dynamic_cast(globalAlloc) != 0); - ASSERT(dynamic_cast(defaultAlloc) != 0); + BMQTST_ASSERT(dynamic_cast(globalAlloc) != 0); + BMQTST_ASSERT(dynamic_cast(defaultAlloc) != 0); BMQTST_ASSERT_EQ(globalAlloc, bslma::Default::globalAllocator()); BMQTST_ASSERT_EQ(defaultAlloc, bslma::Default::defaultAllocator()); @@ -130,7 +130,7 @@ static void test2_initGlobalAllocators() const bmqst::StatContext* topAllocatorStatContext = bmqma::CountingAllocatorUtil::globalStatContext()->getSubcontext( "testAllocatorName"); - ASSERT(topAllocatorStatContext != 0); + BMQTST_ASSERT(topAllocatorStatContext != 0); BMQTST_ASSERT_EQ(topAllocatorStatContext->numSubcontexts(), 2); BMQTST_ASSERT_EQ( diff --git a/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp index 8fe84b501..fbdbea1f6 100644 --- a/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp @@ -258,7 +258,7 @@ static void test4_capacity() while (maxMsgCount--) { rc = obj.appendMessage(0, 0, bmqt::MessageGUID(), 0); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); + BMQTST_ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); } BMQTST_ASSERT_EQ(obj.messageCount(), obj.maxMessageCount()); @@ -269,7 +269,7 @@ static void test4_capacity() BMQTST_ASSERT_EQ( rc, static_cast(bmqt::EventBuilderResult::e_EVENT_TOO_BIG)); - ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); + BMQTST_ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); } static void testN1_decodeFromFile() diff --git a/src/groups/bmq/bmqp/bmqp_ackmessageiterator.t.cpp b/src/groups/bmq/bmqp/bmqp_ackmessageiterator.t.cpp index cb804edd4..f7a91093b 100644 --- a/src/groups/bmq/bmqp/bmqp_ackmessageiterator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_ackmessageiterator.t.cpp @@ -432,7 +432,7 @@ static void test3_nextMethod() // Create valid iterator bmqp::AckMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Iterate and verify BMQTST_ASSERT_EQ(iter.next(), 1); @@ -465,7 +465,7 @@ static void test3_nextMethod() // Create iterator bmqp::AckMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Iterate and verify BMQTST_ASSERT_LT(iter.next(), 0); // rc_NOT_ENOUGH_BYTES @@ -530,12 +530,12 @@ static void test4_resetMethod() // Create iterator bmqp::AckMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_INVALID_EVENTHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } // NOTE: as long as AckHeader::k_MIN_HEADER_SIZE = 1, there is no possible @@ -566,12 +566,12 @@ static void test4_resetMethod() // Create iterator bmqp::AckMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_NOT_ENOUGH_BYTES - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } } @@ -624,7 +624,7 @@ static void test5_dumpBlob() // Create and check iterator blob layout { bmqp::AckMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Dump blob iter.dumpBlob(stream); diff --git a/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp index 53753f277..7958cfad2 100644 --- a/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp @@ -256,7 +256,7 @@ static void test4_capacity() while (maxMsgCount--) { rc = obj.appendMessage(0, 0, bmqt::MessageGUID()); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); + BMQTST_ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); } BMQTST_ASSERT_EQ(obj.messageCount(), obj.maxMessageCount()); @@ -267,7 +267,7 @@ static void test4_capacity() BMQTST_ASSERT_EQ( rc, static_cast(bmqt::EventBuilderResult::e_EVENT_TOO_BIG)); - ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); + BMQTST_ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); } static void testN1_decodeFromFile() diff --git a/src/groups/bmq/bmqp/bmqp_confirmmessageiterator.t.cpp b/src/groups/bmq/bmqp/bmqp_confirmmessageiterator.t.cpp index f1d3c924b..3e2c6ec6e 100644 --- a/src/groups/bmq/bmqp/bmqp_confirmmessageiterator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_confirmmessageiterator.t.cpp @@ -376,7 +376,7 @@ static void test3_nextMethod() // Create valid iterator bmqp::ConfirmMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Iterate and verify BMQTST_ASSERT_EQ(iter.next(), 1); @@ -403,7 +403,7 @@ static void test3_nextMethod() // Create iterator bmqp::ConfirmMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Iterate and verify BMQTST_ASSERT_LT(iter.next(), 0); // rc_NOT_ENOUGH_BYTES @@ -457,12 +457,12 @@ static void test4_resetMethod() // Create iterator bmqp::ConfirmMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_INVALID_EVENTHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } // NOTE: as far as ConfirmHeader::k_MIN_HEADER_SIZE = 1, there is no @@ -487,12 +487,12 @@ static void test4_resetMethod() // Create iterator bmqp::ConfirmMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_NOT_ENOUGH_BYTES - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } } @@ -536,7 +536,7 @@ static void test5_dumpBlob() // Create and check iterator blob layout { bmqp::ConfirmMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Dump blob iter.dumpBlob(stream); diff --git a/src/groups/bmq/bmqp/bmqp_event.t.cpp b/src/groups/bmq/bmqp/bmqp_event.t.cpp index 1b2f5cb84..585dca022 100644 --- a/src/groups/bmq/bmqp/bmqp_event.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_event.t.cpp @@ -456,19 +456,19 @@ static void test3_eventTypes() BMQTST_ASSERT_EQ(event.isValid(), test.d_isValid); if (bmqp::EventType::e_UNDEFINED == test.d_type) { - ASSERT_SAFE_FAIL(event.type()); - ASSERT_SAFE_FAIL(event.isControlEvent()); - ASSERT_SAFE_FAIL(event.isPutEvent()); - ASSERT_SAFE_FAIL(event.isConfirmEvent()); - ASSERT_SAFE_FAIL(event.isPushEvent()); - ASSERT_SAFE_FAIL(event.isAckEvent()); - ASSERT_SAFE_FAIL(event.isClusterStateEvent()); - ASSERT_SAFE_FAIL(event.isElectorEvent()); - ASSERT_SAFE_FAIL(event.isStorageEvent()); - ASSERT_SAFE_FAIL(event.isRecoveryEvent()); - ASSERT_SAFE_FAIL(event.isPartitionSyncEvent()); - ASSERT_SAFE_FAIL(event.isHeartbeatReqEvent()); - ASSERT_SAFE_FAIL(event.isHeartbeatRspEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.type()); + BMQTST_ASSERT_SAFE_FAIL(event.isControlEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isPutEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isConfirmEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isPushEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isAckEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isClusterStateEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isElectorEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isStorageEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isRecoveryEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isPartitionSyncEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isHeartbeatReqEvent()); + BMQTST_ASSERT_SAFE_FAIL(event.isHeartbeatRspEvent()); continue; } BMQTST_ASSERT_EQ(event.type(), test.d_type); @@ -581,7 +581,7 @@ static void test4_eventLoading() rc = ctrlEvent.loadControlEvent(&decodedCtrlMsg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(decodedCtrlMsg.choice().isStatusValue()); + BMQTST_ASSERT(decodedCtrlMsg.choice().isStatusValue()); BMQTST_ASSERT_EQ(decodedCtrlMsg.choice().status().code(), status.code()); BMQTST_ASSERT_EQ(decodedCtrlMsg.choice().status().message(), @@ -624,7 +624,7 @@ static void test4_eventLoading() rc = electorEvent.loadElectorEvent(&decodedElectorMsg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(decodedElectorMsg.choice().isElectionProposalValue()); + BMQTST_ASSERT(decodedElectorMsg.choice().isElectionProposalValue()); PVV(L_ << ": Reset"); @@ -720,28 +720,29 @@ static void test5_iteratorLoading() event.loadAckMessageIterator(&ackIter); } else { - ASSERT_SAFE_FAIL(event.loadAckMessageIterator(&ackIter)); + BMQTST_ASSERT_SAFE_FAIL(event.loadAckMessageIterator(&ackIter)); } if (bmqp::EventType::e_CONFIRM == test.d_type) { event.loadConfirmMessageIterator(&confirmIter); } else { - ASSERT_SAFE_FAIL(event.loadConfirmMessageIterator(&confirmIter)); + BMQTST_ASSERT_SAFE_FAIL( + event.loadConfirmMessageIterator(&confirmIter)); } if (bmqp::EventType::e_PUSH == test.d_type) { event.loadPushMessageIterator(&pushIter); } else { - ASSERT_SAFE_FAIL(event.loadPushMessageIterator(&pushIter)); + BMQTST_ASSERT_SAFE_FAIL(event.loadPushMessageIterator(&pushIter)); } if (bmqp::EventType::e_PUT == test.d_type) { event.loadPutMessageIterator(&putIter); } else { - ASSERT_SAFE_FAIL(event.loadPutMessageIterator(&putIter)); + BMQTST_ASSERT_SAFE_FAIL(event.loadPutMessageIterator(&putIter)); } if (bmqp::EventType::e_STORAGE == test.d_type || @@ -749,14 +750,16 @@ static void test5_iteratorLoading() event.loadStorageMessageIterator(&storageIter); } else { - ASSERT_SAFE_FAIL(event.loadStorageMessageIterator(&storageIter)); + BMQTST_ASSERT_SAFE_FAIL( + event.loadStorageMessageIterator(&storageIter)); } if (bmqp::EventType::e_RECOVERY == test.d_type) { event.loadRecoveryMessageIterator(&recoveryIter); } else { - ASSERT_SAFE_FAIL(event.loadRecoveryMessageIterator(&recoveryIter)); + BMQTST_ASSERT_SAFE_FAIL( + event.loadRecoveryMessageIterator(&recoveryIter)); } BMQTST_ASSERT_EQ(ackIter.isValid(), false); @@ -838,7 +841,7 @@ static void test6_printing() bmqp::Event obj(&blob, bmqtst::TestHelperUtil::allocator(), false); if (test.d_type == bmqp::EventType::e_UNDEFINED) { - ASSERT_SAFE_FAIL(obj.print(out, 0, -1)); + BMQTST_ASSERT_SAFE_FAIL(obj.print(out, 0, -1)); } else { expected << test.d_expected; diff --git a/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp b/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp index 8e3b7a8d8..315e0ca63 100644 --- a/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp @@ -361,7 +361,7 @@ static void test1_breathingTest() const unsigned int subcriptionId = bmqp::Protocol::k_DEFAULT_SUBSCRIPTION_ID; - ASSERT(find(eventInfos[0], id, subcriptionId)); + BMQTST_ASSERT(find(eventInfos[0], id, subcriptionId)); continue; // CONTINUE } @@ -406,7 +406,7 @@ static void test1_breathingTest() const int id = D.d_qid; const unsigned int subcriptionId = subQueueInfos[0].id(); - ASSERT(find(eventInfos[0], id, subcriptionId)); + BMQTST_ASSERT(find(eventInfos[0], id, subcriptionId)); } } @@ -646,7 +646,7 @@ static void test2_flattenExplodesEvent() const int qId = data[idx].d_qid; const unsigned int subcriptionId = data[idx].d_subQueueInfos[idx].id(); - ASSERT(find(eventInfos[1], qId, subcriptionId)); + BMQTST_ASSERT(find(eventInfos[1], qId, subcriptionId)); } // Verify that 'eventInfo' contains the queueId (queueId, subQueueId) @@ -788,7 +788,7 @@ static void test3_flattenWithMessageProperties() // payload and corresponding to the respective SubQueueIds. bmqp::Event flattenedEvent(&(eventInfos[0].d_blob), bmqtst::TestHelperUtil::allocator()); - ASSERT(flattenedEvent.isPushEvent()); + BMQTST_ASSERT(flattenedEvent.isPushEvent()); bmqp::PushMessageIterator msgIterator(&bufferFactory, bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqp/bmqp_messageguidgenerator.t.cpp b/src/groups/bmq/bmqp/bmqp_messageguidgenerator.t.cpp index a04f38197..23fd20008 100644 --- a/src/groups/bmq/bmqp/bmqp_messageguidgenerator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_messageguidgenerator.t.cpp @@ -887,8 +887,8 @@ static void test5_print() bmqt::MessageGUID guid1 = bmqp::MessageGUIDGenerator::testGUID(); bmqt::MessageGUID guid2 = bmqp::MessageGUIDGenerator::testGUID(); - ASSERT(!guid1.isUnset()); - ASSERT(!guid2.isUnset()); + BMQTST_ASSERT(!guid1.isUnset()); + BMQTST_ASSERT(!guid2.isUnset()); // Print and compare const char k_EXPECTED_1[] = "1-0-0-000000000001"; diff --git a/src/groups/bmq/bmqp/bmqp_messageproperties.t.cpp b/src/groups/bmq/bmqp/bmqp_messageproperties.t.cpp index a04735210..013c93493 100644 --- a/src/groups/bmq/bmqp/bmqp_messageproperties.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_messageproperties.t.cpp @@ -577,16 +577,16 @@ static void test1_breathingTest() bmqp::MessagePropertiesIterator objIt; - ASSERT_SAFE_FAIL(objIt.hasNext()); - ASSERT_SAFE_FAIL(objIt.name()); - ASSERT_SAFE_FAIL(objIt.type()); - ASSERT_SAFE_FAIL(objIt.getAsBool()); - ASSERT_SAFE_FAIL(objIt.getAsChar()); - ASSERT_SAFE_FAIL(objIt.getAsShort()); - ASSERT_SAFE_FAIL(objIt.getAsInt32()); - ASSERT_SAFE_FAIL(objIt.getAsInt64()); - ASSERT_SAFE_FAIL(objIt.getAsString()); - ASSERT_SAFE_FAIL(objIt.getAsBinary()); + BMQTST_ASSERT_SAFE_FAIL(objIt.hasNext()); + BMQTST_ASSERT_SAFE_FAIL(objIt.name()); + BMQTST_ASSERT_SAFE_FAIL(objIt.type()); + BMQTST_ASSERT_SAFE_FAIL(objIt.getAsBool()); + BMQTST_ASSERT_SAFE_FAIL(objIt.getAsChar()); + BMQTST_ASSERT_SAFE_FAIL(objIt.getAsShort()); + BMQTST_ASSERT_SAFE_FAIL(objIt.getAsInt32()); + BMQTST_ASSERT_SAFE_FAIL(objIt.getAsInt64()); + BMQTST_ASSERT_SAFE_FAIL(objIt.getAsString()); + BMQTST_ASSERT_SAFE_FAIL(objIt.getAsBinary()); } static void test2_setPropertyTest() @@ -1235,7 +1235,7 @@ static void test10_empty() const bdlbb::Blob& out = p.streamOut(&bufferFactory, logic); BMQTST_ASSERT_EQ(0, out.length()); - ASSERT(!p.hasProperty("z")); + BMQTST_ASSERT(!p.hasProperty("z")); } // ============================================================================ diff --git a/src/groups/bmq/bmqp/bmqp_optionsview.t.cpp b/src/groups/bmq/bmqp/bmqp_optionsview.t.cpp index 1adae837a..52545bbca 100644 --- a/src/groups/bmq/bmqp/bmqp_optionsview.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_optionsview.t.cpp @@ -51,8 +51,9 @@ namespace { void verifySubQueueInfos(const bmqp::OptionsView& view, const bsl::vector& subQueueInfos) { - ASSERT(view.isValid()); - ASSERT(view.find(bmqp::OptionType::e_SUB_QUEUE_INFOS) != view.end()); + BMQTST_ASSERT(view.isValid()); + BMQTST_ASSERT(view.find(bmqp::OptionType::e_SUB_QUEUE_INFOS) != + view.end()); bmqp::Protocol::SubQueueInfosArray retrievedSubQueueInfos( bmqtst::TestHelperUtil::allocator()); @@ -71,8 +72,9 @@ void verifySubQueueIdsOld( const bmqp::OptionsView& view, const bsl::vector& subQueueIdsOld) { - ASSERT(view.isValid()); - ASSERT(view.find(bmqp::OptionType::e_SUB_QUEUE_IDS_OLD) != view.end()); + BMQTST_ASSERT(view.isValid()); + BMQTST_ASSERT(view.find(bmqp::OptionType::e_SUB_QUEUE_IDS_OLD) != + view.end()); const size_t numSubQueueIds = subQueueIdsOld.size(); @@ -1245,30 +1247,30 @@ void test5_iteratorTest() optionsAreaPosition, optionsAreaSize, bmqtst::TestHelperUtil::allocator()); - ASSERT(view.isValid()); + BMQTST_ASSERT(view.isValid()); bmqp::OptionsView::const_iterator iter = view.begin(); bmqp::OptionsView::const_iterator iter2 = iter; - ASSERT(iter2 != view.end()); - ASSERT(iter == iter2); - ASSERT(*iter == bmqp::OptionType::e_MSG_GROUP_ID); - ASSERT(*iter2 == bmqp::OptionType::e_MSG_GROUP_ID); + BMQTST_ASSERT(iter2 != view.end()); + BMQTST_ASSERT(iter == iter2); + BMQTST_ASSERT(*iter == bmqp::OptionType::e_MSG_GROUP_ID); + BMQTST_ASSERT(*iter2 == bmqp::OptionType::e_MSG_GROUP_ID); ++iter2; - ASSERT(iter2 != view.end()); - ASSERT(iter2 != iter); - ASSERT(*iter2 == bmqp::OptionType::e_SUB_QUEUE_INFOS); + BMQTST_ASSERT(iter2 != view.end()); + BMQTST_ASSERT(iter2 != iter); + BMQTST_ASSERT(*iter2 == bmqp::OptionType::e_SUB_QUEUE_INFOS); ++(iter.imp()); - ASSERT(iter == iter2); - ASSERT(*iter == bmqp::OptionType::e_SUB_QUEUE_INFOS); - ASSERT(iter != view.end()); + BMQTST_ASSERT(iter == iter2); + BMQTST_ASSERT(*iter == bmqp::OptionType::e_SUB_QUEUE_INFOS); + BMQTST_ASSERT(iter != view.end()); ++iter2; - ASSERT(iter2 == view.end()); + BMQTST_ASSERT(iter2 == view.end()); ++(iter.imp()); - ASSERT(iter == view.end()); + BMQTST_ASSERT(iter == view.end()); } void test6_iteratorTestSubQueueIdsOld() @@ -1325,30 +1327,30 @@ void test6_iteratorTestSubQueueIdsOld() optionsAreaPosition, optionsAreaSize, bmqtst::TestHelperUtil::allocator()); - ASSERT(view.isValid()); + BMQTST_ASSERT(view.isValid()); bmqp::OptionsView::const_iterator iter = view.begin(); bmqp::OptionsView::const_iterator iter2 = iter; - ASSERT(iter2 != view.end()); - ASSERT(iter == iter2); - ASSERT(*iter == bmqp::OptionType::e_SUB_QUEUE_IDS_OLD); - ASSERT(*iter2 == bmqp::OptionType::e_SUB_QUEUE_IDS_OLD); + BMQTST_ASSERT(iter2 != view.end()); + BMQTST_ASSERT(iter == iter2); + BMQTST_ASSERT(*iter == bmqp::OptionType::e_SUB_QUEUE_IDS_OLD); + BMQTST_ASSERT(*iter2 == bmqp::OptionType::e_SUB_QUEUE_IDS_OLD); ++iter2; - ASSERT(iter2 != view.end()); - ASSERT(iter2 != iter); - ASSERT(*iter2 == bmqp::OptionType::e_MSG_GROUP_ID); + BMQTST_ASSERT(iter2 != view.end()); + BMQTST_ASSERT(iter2 != iter); + BMQTST_ASSERT(*iter2 == bmqp::OptionType::e_MSG_GROUP_ID); ++(iter.imp()); - ASSERT(iter == iter2); - ASSERT(*iter == bmqp::OptionType::e_MSG_GROUP_ID); - ASSERT(iter != view.end()); + BMQTST_ASSERT(iter == iter2); + BMQTST_ASSERT(*iter == bmqp::OptionType::e_MSG_GROUP_ID); + BMQTST_ASSERT(iter != view.end()); ++iter2; - ASSERT(iter2 == view.end()); + BMQTST_ASSERT(iter2 == view.end()); ++(iter.imp()); - ASSERT(iter == view.end()); + BMQTST_ASSERT(iter == view.end()); } void test7_dumpBlob() diff --git a/src/groups/bmq/bmqp/bmqp_optionutil.t.cpp b/src/groups/bmq/bmqp/bmqp_optionutil.t.cpp index 03fb78976..7fa7f3095 100644 --- a/src/groups/bmq/bmqp/bmqp_optionutil.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_optionutil.t.cpp @@ -170,7 +170,7 @@ static void test1_basicOptionMetaProperties() { for (int size = 0; size < 10; ++size) { if (0 != size % bmqp::Protocol::k_WORD_SIZE) { - ASSERT_SAFE_FAIL(OptionMeta::forOption(type, size)); + BMQTST_ASSERT_SAFE_FAIL(OptionMeta::forOption(type, size)); } else { const OptionMeta meta = OptionMeta::forOption(type, size); @@ -206,11 +206,11 @@ static void test1_basicOptionMetaProperties() const OptionMeta meta = OptionMeta::forNullOption(); BMQTST_ASSERT_EQ(true, meta.isNull()); - ASSERT_SAFE_FAIL(meta.payloadSize()); - ASSERT_SAFE_FAIL(meta.payloadEffectiveSize()); - ASSERT_SAFE_FAIL(meta.size()); - ASSERT_SAFE_FAIL(meta.padding()); - ASSERT_SAFE_FAIL(meta.type()); + BMQTST_ASSERT_SAFE_FAIL(meta.payloadSize()); + BMQTST_ASSERT_SAFE_FAIL(meta.payloadEffectiveSize()); + BMQTST_ASSERT_SAFE_FAIL(meta.size()); + BMQTST_ASSERT_SAFE_FAIL(meta.padding()); + BMQTST_ASSERT_SAFE_FAIL(meta.type()); } } diff --git a/src/groups/bmq/bmqp/bmqp_protocol.t.cpp b/src/groups/bmq/bmqp/bmqp_protocol.t.cpp index bbcd22c40..9d4236749 100644 --- a/src/groups/bmq/bmqp/bmqp_protocol.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_protocol.t.cpp @@ -404,7 +404,7 @@ static void test1_breathingTest() BMQTST_ASSERT_EQ(numWords, ph.headerWords()); BMQTST_ASSERT_EQ(0, ph.queueId()); - ASSERT(ph.messageGUID().isUnset()); + BMQTST_ASSERT(ph.messageGUID().isUnset()); // Set some values const int msgNumWords = 5; @@ -1110,7 +1110,8 @@ static void test3_flagUtils() int flags = 0; // 1. Check that the flag is not 'isSet'. - ASSERT(!bmqp::PutHeaderFlagUtil::isSet(flags, test.d_value)); + BMQTST_ASSERT( + !bmqp::PutHeaderFlagUtil::isSet(flags, test.d_value)); // 2. Set the flag. Verify that it is set, and that no other // flag is set. @@ -1118,7 +1119,7 @@ static void test3_flagUtils() << test.d_value << ")"); bmqp::PutHeaderFlagUtil::setFlag(&flags, test.d_value); - ASSERT(bmqp::PutHeaderFlagUtil::isSet(flags, test.d_value)); + BMQTST_ASSERT(bmqp::PutHeaderFlagUtil::isSet(flags, test.d_value)); bmqu::MemOutStream out(bmqtst::TestHelperUtil::allocator()); bmqp::PutHeaderFlagUtil::prettyPrint(out, flags); @@ -1149,7 +1150,8 @@ static void test3_flagUtils() // 4. Unset flag and verify that it is unset. bmqp::PutHeaderFlagUtil::unsetFlag(&flags, test.d_value); - ASSERT(!bmqp::PutHeaderFlagUtil::isSet(flags, test.d_value)); + BMQTST_ASSERT( + !bmqp::PutHeaderFlagUtil::isSet(flags, test.d_value)); } } @@ -1175,7 +1177,8 @@ static void test3_flagUtils() int flags = 0; // 1. Check that the flag is not 'isSet'. - ASSERT(!bmqp::PushHeaderFlagUtil::isSet(flags, test.d_value)); + BMQTST_ASSERT( + !bmqp::PushHeaderFlagUtil::isSet(flags, test.d_value)); // 2. Set the flag. Verify that it is set, and that no other // flag is set. @@ -1183,7 +1186,8 @@ static void test3_flagUtils() << test.d_value << ")"); bmqp::PushHeaderFlagUtil::setFlag(&flags, test.d_value); - ASSERT(bmqp::PushHeaderFlagUtil::isSet(flags, test.d_value)); + BMQTST_ASSERT( + bmqp::PushHeaderFlagUtil::isSet(flags, test.d_value)); bmqu::MemOutStream out(bmqtst::TestHelperUtil::allocator()); bmqp::PushHeaderFlagUtil::prettyPrint(out, flags); @@ -1214,7 +1218,8 @@ static void test3_flagUtils() // 4. Unset flag and verify that it is unset. bmqp::PushHeaderFlagUtil::unsetFlag(&flags, test.d_value); - ASSERT(!bmqp::PushHeaderFlagUtil::isSet(flags, test.d_value)); + BMQTST_ASSERT( + !bmqp::PushHeaderFlagUtil::isSet(flags, test.d_value)); } } @@ -1241,7 +1246,7 @@ static void test3_flagUtils() int flags = 0; // 1. Check that the flag is not 'isSet'. - ASSERT(!bmqp::StorageHeaderFlagUtil::isSet( + BMQTST_ASSERT(!bmqp::StorageHeaderFlagUtil::isSet( static_cast(flags), test.d_value)); @@ -1251,7 +1256,7 @@ static void test3_flagUtils() << test.d_value << ")"); bmqp::StorageHeaderFlagUtil::setFlag(&flags, test.d_value); - ASSERT(bmqp::StorageHeaderFlagUtil::isSet( + BMQTST_ASSERT(bmqp::StorageHeaderFlagUtil::isSet( static_cast(flags), test.d_value)); @@ -1290,7 +1295,7 @@ static void test3_flagUtils() // 4. Unset flag and verify that it is unset. bmqp::StorageHeaderFlagUtil::unsetFlag(&flags, test.d_value); - ASSERT(!bmqp::StorageHeaderFlagUtil::isSet( + BMQTST_ASSERT(!bmqp::StorageHeaderFlagUtil::isSet( static_cast(flags), test.d_value)); } diff --git a/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp b/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp index 3da437468..443a93e26 100644 --- a/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp @@ -78,16 +78,16 @@ static void test1_initializeShutdown() bmqtst::TestHelper::printTestName("INITIALIZE / SHUTDOWN"); // 1. Calling 'shutdown' without a call to 'initialize' should assert. - ASSERT_SAFE_FAIL(bmqp::ProtocolUtil::shutdown()); + BMQTST_ASSERT_SAFE_FAIL(bmqp::ProtocolUtil::shutdown()); // 2. Should be able to call 'initialize()' after the instance has already // started and have no effect. // Initialize the 'ProtocolUtil' - ASSERT_SAFE_PASS( + BMQTST_ASSERT_SAFE_PASS( bmqp::ProtocolUtil::initialize(bmqtst::TestHelperUtil::allocator())); // 'initialize' should be a no-op - ASSERT_SAFE_PASS( + BMQTST_ASSERT_SAFE_PASS( bmqp::ProtocolUtil::initialize(bmqtst::TestHelperUtil::allocator())); // 3. Should be able to call 'shutdown' after already calling 'shutdown' @@ -95,20 +95,20 @@ static void test1_initializeShutdown() // does not exceed to number of calls to 'initialize' without a // corresponding call to 'shutdown'. // 'shutdown' should be a no-op - ASSERT_SAFE_PASS(bmqp::ProtocolUtil::shutdown()); + BMQTST_ASSERT_SAFE_PASS(bmqp::ProtocolUtil::shutdown()); // Shut down the 'ProtocolUtil' - ASSERT_SAFE_PASS(bmqp::ProtocolUtil::shutdown()); + BMQTST_ASSERT_SAFE_PASS(bmqp::ProtocolUtil::shutdown()); // 'shutdown' again should assert - ASSERT_SAFE_FAIL(bmqp::ProtocolUtil::shutdown()); + BMQTST_ASSERT_SAFE_FAIL(bmqp::ProtocolUtil::shutdown()); // 4. It is safe to call 'initialize' after calling 'shutdown'. - ASSERT_SAFE_PASS( + BMQTST_ASSERT_SAFE_PASS( bmqp::ProtocolUtil::initialize(bmqtst::TestHelperUtil::allocator())); // Finally, shutdown the 'ProtocolUtil' - ASSERT_SAFE_PASS(bmqp::ProtocolUtil::shutdown()); + BMQTST_ASSERT_SAFE_PASS(bmqp::ProtocolUtil::shutdown()); } static void test2_hexBinaryConversions() @@ -675,9 +675,9 @@ static void test9_loadFieldValues() bsl::vector field1Values( bmqtst::TestHelperUtil::allocator()); - ASSERT(bmqp::ProtocolUtil::loadFieldValues(&field1Values, - field1, - featureSet)); + BMQTST_ASSERT(bmqp::ProtocolUtil::loadFieldValues(&field1Values, + field1, + featureSet)); BMQTST_ASSERT_EQ(field1NumVal, field1Values.size()); BMQTST_ASSERT_EQ(val1, field1Values[0]); BMQTST_ASSERT_EQ(val2, field1Values[1]); @@ -686,9 +686,9 @@ static void test9_loadFieldValues() bsl::vector field2Values( bmqtst::TestHelperUtil::allocator()); - ASSERT(bmqp::ProtocolUtil::loadFieldValues(&field2Values, - field2, - featureSet)); + BMQTST_ASSERT(bmqp::ProtocolUtil::loadFieldValues(&field2Values, + field2, + featureSet)); BMQTST_ASSERT_EQ(field2NumVal, field2Values.size()); BMQTST_ASSERT_EQ(val4, field2Values[0]); @@ -696,10 +696,10 @@ static void test9_loadFieldValues() bsl::vector emptyFieldValues( bmqtst::TestHelperUtil::allocator()); - ASSERT(bmqp::ProtocolUtil::loadFieldValues(&emptyFieldValues, - emptyField, - featureSet)); - ASSERT(emptyFieldValues.empty()); + BMQTST_ASSERT(bmqp::ProtocolUtil::loadFieldValues(&emptyFieldValues, + emptyField, + featureSet)); + BMQTST_ASSERT(emptyFieldValues.empty()); } PV("Load invalid field"); @@ -709,10 +709,10 @@ static void test9_loadFieldValues() const bsl::string invalidField("invalidField", bmqtst::TestHelperUtil::allocator()); - ASSERT(!bmqp::ProtocolUtil::loadFieldValues(&invalidFieldValues, - invalidField, - featureSet)); - ASSERT(invalidFieldValues.empty()); + BMQTST_ASSERT(!bmqp::ProtocolUtil::loadFieldValues(&invalidFieldValues, + invalidField, + featureSet)); + BMQTST_ASSERT(invalidFieldValues.empty()); } PV("Load from malformed feature set"); @@ -723,10 +723,11 @@ static void test9_loadFieldValues() field1 + ":", bmqtst::TestHelperUtil::allocator()); - ASSERT(!bmqp::ProtocolUtil::loadFieldValues(&field1Values, - field1, - malformedFeatureSet)); - ASSERT(field1Values.empty()); + BMQTST_ASSERT( + !bmqp::ProtocolUtil::loadFieldValues(&field1Values, + field1, + malformedFeatureSet)); + BMQTST_ASSERT(field1Values.empty()); } } diff --git a/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp index 78e154d6d..4686451a4 100644 --- a/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_puteventbuilder.t.cpp @@ -106,9 +106,9 @@ void setMsgGroupId(bmqp::PutEventBuilder* peb, const size_t iteration) void validateGroupId(const size_t iteration, const bmqp::PutMessageIterator& putIter) { - ASSERT(putIter.hasMsgGroupId()); + BMQTST_ASSERT(putIter.hasMsgGroupId()); bmqp::Protocol::MsgGroupId msgGroupId; - ASSERT(putIter.extractMsgGroupId(&msgGroupId)); + BMQTST_ASSERT(putIter.extractMsgGroupId(&msgGroupId)); bmqu::MemOutStream oss(bmqtst::TestHelperUtil::allocator()); oss << "gid:" << iteration; BMQTST_ASSERT_EQ(oss.str(), msgGroupId); @@ -1931,7 +1931,7 @@ static void test3_eventTooBig() BMQTST_ASSERT_EQ(compareResult, 0); #ifdef BMQ_ENABLE_MSG_GROUPID - ASSERT(putIter.hasMsgGroupId()); + BMQTST_ASSERT(putIter.hasMsgGroupId()); bmqp::Protocol::MsgGroupId msgGroupId(bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(putIter.extractMsgGroupId(&msgGroupId), true); @@ -2132,14 +2132,15 @@ static void test6_emptyBuilder() bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(obj.unpackedMessageSize(), 0); - ASSERT_SAFE_FAIL(obj.setFlags(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.setFlags(0)); #ifdef BMQ_ENABLE_MSG_GROUPID - ASSERT_SAFE_FAIL(obj.setMsgGroupId(k_MSG_GROUP_ID)); + BMQTST_ASSERT_SAFE_FAIL(obj.setMsgGroupId(k_MSG_GROUP_ID)); #endif - ASSERT_SAFE_FAIL(obj.setMessageGUID(zeroGuid)); - ASSERT_SAFE_FAIL(obj.setCrc32c(0)); - ASSERT_SAFE_FAIL(obj.setMessagePayload(k_PAYLOAD, bsl::strlen(k_PAYLOAD))); - ASSERT_SAFE_FAIL(obj.setMessagePayload(NULL)); + BMQTST_ASSERT_SAFE_FAIL(obj.setMessageGUID(zeroGuid)); + BMQTST_ASSERT_SAFE_FAIL(obj.setCrc32c(0)); + BMQTST_ASSERT_SAFE_FAIL( + obj.setMessagePayload(k_PAYLOAD, bsl::strlen(k_PAYLOAD))); + BMQTST_ASSERT_SAFE_FAIL(obj.setMessagePayload(NULL)); obj.startMessage(); @@ -2154,7 +2155,7 @@ static void test6_emptyBuilder() BMQTST_ASSERT_EQ(obj.flags(), 0); BMQTST_ASSERT_EQ(obj.messageCount(), 0); - ASSERT_SAFE_FAIL(obj.setMessagePayload(k_PAYLOAD, -1)); + BMQTST_ASSERT_SAFE_FAIL(obj.setMessagePayload(k_PAYLOAD, -1)); obj.setMessageGUID(onesGuid); @@ -2305,14 +2306,14 @@ static void test7_multiplePackMessage() bmqp::Event rawEvent(obj.blob().get(), bmqtst::TestHelperUtil::allocator()); - ASSERT(rawEvent.isValid()); - ASSERT(rawEvent.isPutEvent()); + BMQTST_ASSERT(rawEvent.isValid()); + BMQTST_ASSERT(rawEvent.isPutEvent()); bmqp::PutMessageIterator putIter(&bufferFactory, bmqtst::TestHelperUtil::allocator()); rawEvent.loadPutMessageIterator(&putIter, true); - ASSERT(putIter.isValid()); + BMQTST_ASSERT(putIter.isValid()); bdlbb::Blob payloadBlob(bmqtst::TestHelperUtil::allocator()); // check for the 2 packed messages diff --git a/src/groups/bmq/bmqp/bmqp_putmessageiterator.t.cpp b/src/groups/bmq/bmqp/bmqp_putmessageiterator.t.cpp index 95dcc1f38..7fa59685f 100644 --- a/src/groups/bmq/bmqp/bmqp_putmessageiterator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_putmessageiterator.t.cpp @@ -271,7 +271,7 @@ static void test1_breathingTest() retrievedPayloadBlob.removeAll(); BMQTST_ASSERT_EQ(0, iter.loadApplicationData(&retrievedPayloadBlob)); - ASSERT(retrievedPayloadBlob.length() > 0); + BMQTST_ASSERT(retrievedPayloadBlob.length() > 0); BMQTST_ASSERT_EQ(false, iter.hasMsgGroupId()); BMQTST_ASSERT_EQ(true, iter.isValid()); diff --git a/src/groups/bmq/bmqp/bmqp_queueutil.t.cpp b/src/groups/bmq/bmqp/bmqp_queueutil.t.cpp index 4266155dd..e4d99f67b 100644 --- a/src/groups/bmq/bmqp/bmqp_queueutil.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_queueutil.t.cpp @@ -373,16 +373,16 @@ static void test5_isValidFanoutConsumerSubId() using namespace bmqp; - ASSERT(!QueueUtil::isValidFanoutConsumerSubQueueId( + BMQTST_ASSERT(!QueueUtil::isValidFanoutConsumerSubQueueId( bmqp::QueueId::k_RESERVED_SUBQUEUE_ID)); - ASSERT(!QueueUtil::isValidFanoutConsumerSubQueueId( + BMQTST_ASSERT(!QueueUtil::isValidFanoutConsumerSubQueueId( bmqp::QueueId::k_UNASSIGNED_SUBQUEUE_ID)); - ASSERT(!QueueUtil::isValidFanoutConsumerSubQueueId( + BMQTST_ASSERT(!QueueUtil::isValidFanoutConsumerSubQueueId( bmqp::QueueId::k_DEFAULT_SUBQUEUE_ID)); - ASSERT(QueueUtil::isValidFanoutConsumerSubQueueId(123)); - ASSERT(QueueUtil::isValidFanoutConsumerSubQueueId(99999)); - ASSERT(QueueUtil::isValidFanoutConsumerSubQueueId(987654321)); + BMQTST_ASSERT(QueueUtil::isValidFanoutConsumerSubQueueId(123)); + BMQTST_ASSERT(QueueUtil::isValidFanoutConsumerSubQueueId(99999)); + BMQTST_ASSERT(QueueUtil::isValidFanoutConsumerSubQueueId(987654321)); } // ============================================================================ diff --git a/src/groups/bmq/bmqp/bmqp_recoverymessageiterator.t.cpp b/src/groups/bmq/bmqp/bmqp_recoverymessageiterator.t.cpp index 4e736090f..4788b5f43 100644 --- a/src/groups/bmq/bmqp/bmqp_recoverymessageiterator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_recoverymessageiterator.t.cpp @@ -638,7 +638,7 @@ static void test6_nextMethod() // Create valid iterator bmqp::RecoveryMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Iterate and verify BMQTST_ASSERT_EQ(iter.next(), 1); @@ -666,9 +666,9 @@ static void test6_nextMethod() // Create iterator bmqp::RecoveryMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); BMQTST_ASSERT_LT(iter.next(), 0); // rc_NO_RECOVERYHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } // Next method. No recovery header. @@ -691,9 +691,9 @@ static void test6_nextMethod() // Create iterator bmqp::RecoveryMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); BMQTST_ASSERT_LT(iter.next(), 0); // rc_NO_RECOVERYHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } // Next method. Not enough bytes case. @@ -719,11 +719,11 @@ static void test6_nextMethod() // Create iterator bmqp::RecoveryMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); BMQTST_ASSERT_EQ(iter.next(), 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); BMQTST_ASSERT_LT(iter.next(), 0); // rc_NOT_ENOUGH_BYTES - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } } @@ -769,12 +769,12 @@ static void test7_resetMethod() // Create iterator bmqp::RecoveryMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_INVALID_EVENTHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } } @@ -815,7 +815,7 @@ static void test8_dumpBlob() // Create iterator over blob { bmqp::RecoveryMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Dump blob iter.dumpBlob(stream); diff --git a/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp index 0df4b46e2..f64e44fb8 100644 --- a/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp @@ -102,13 +102,13 @@ static void verifyContent(const bmqp::RejectEventBuilder& builder, bmqp::Event event(builder.blob().get(), bmqtst::TestHelperUtil::allocator()); - ASSERT(event.isValid()); - ASSERT(event.isRejectEvent()); + BMQTST_ASSERT(event.isValid()); + BMQTST_ASSERT(event.isRejectEvent()); bmqp::RejectMessageIterator iter; event.loadRejectMessageIterator(&iter); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); size_t idx = 0; while (iter.next() == 1 && idx < data.size()) { @@ -256,7 +256,7 @@ static void test4_capacity() while (maxMsgCount--) { rc = obj.appendMessage(0, 0, bmqt::MessageGUID()); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); + BMQTST_ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); } BMQTST_ASSERT_EQ(obj.messageCount(), obj.maxMessageCount()); @@ -267,7 +267,7 @@ static void test4_capacity() BMQTST_ASSERT_EQ( rc, static_cast(bmqt::EventBuilderResult::e_EVENT_TOO_BIG)); - ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); + BMQTST_ASSERT(obj.eventSize() <= bmqp::EventHeader::k_MAX_SIZE_SOFT); } static void testN1_decodeFromFile() @@ -355,15 +355,15 @@ static void testN1_decodeFromFile() // Decode event bmqp::Event event(&outBlob, bmqtst::TestHelperUtil::allocator()); - ASSERT(event.isValid()); - ASSERT(event.isRejectEvent()); + BMQTST_ASSERT(event.isValid()); + BMQTST_ASSERT(event.isRejectEvent()); PVV("Iterating over messages"); bmqp::RejectMessageIterator iter; event.loadRejectMessageIterator(&iter); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); size_t idx = 0; while (iter.next() == 1 && idx < messages.size()) { diff --git a/src/groups/bmq/bmqp/bmqp_rejectmessageiterator.t.cpp b/src/groups/bmq/bmqp/bmqp_rejectmessageiterator.t.cpp index b49b95704..49f72dd63 100644 --- a/src/groups/bmq/bmqp/bmqp_rejectmessageiterator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_rejectmessageiterator.t.cpp @@ -373,7 +373,7 @@ static void test3_nextMethod() // Create valid iterator bmqp::RejectMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Iterate and verify BMQTST_ASSERT_EQ(iter.next(), 1); @@ -400,7 +400,7 @@ static void test3_nextMethod() // Create iterator bmqp::RejectMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Iterate and verify BMQTST_ASSERT_LT(iter.next(), 0); // rc_NOT_ENOUGH_BYTES @@ -454,12 +454,12 @@ static void test4_resetMethod() // Create iterator bmqp::RejectMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_INVALID_EVENTHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } // NOTE: as far as RejectHeader::k_MIN_HEADER_SIZE = 1, there is no @@ -484,12 +484,12 @@ static void test4_resetMethod() // Create iterator bmqp::RejectMessageIterator iter(&blob, eventHeader); blob.setLength(enoughSize - 1); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_NOT_ENOUGH_BYTES - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } } @@ -533,7 +533,7 @@ static void test5_dumpBlob() // Create and check iterator blob layout { bmqp::RejectMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Dump blob iter.dumpBlob(stream); diff --git a/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp b/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp index 275849fa0..6c0e71bdd 100644 --- a/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp @@ -302,10 +302,10 @@ Mes TestContext::createResponseCancel() Mes TestContext::getNextRequest() { - ASSERT(d_testChannel.waitFor(1, true, bsls::TimeInterval(1))); + BMQTST_ASSERT(d_testChannel.waitFor(1, true, bsls::TimeInterval(1))); bmqio::TestChannel::WriteCall wc = d_testChannel.popWriteCall(); bmqp::Event ev(&wc.d_blob, d_allocator_p); - ASSERT(ev.isControlEvent()); + BMQTST_ASSERT(ev.isControlEvent()); Mes controlMessage(d_allocator_p); BMQTST_ASSERT_EQ(0, ev.loadControlEvent(&controlMessage)); return controlMessage; @@ -396,11 +396,12 @@ static void test1_creatorsTest() bdlmt::EventScheduler scheduler(bsls::SystemClockType::e_REALTIME, bmqtst::TestHelperUtil::allocator()); - ASSERT_SAFE_FAIL(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, - &scheduler, - false, // late response mode is off - bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_SAFE_FAIL( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobSpPool, + &scheduler, + false, // late response mode is off + bmqtst::TestHelperUtil::allocator())); } { @@ -408,26 +409,29 @@ static void test1_creatorsTest() bdlmt::EventScheduler scheduler(bsls::SystemClockType::e_MONOTONIC, bmqtst::TestHelperUtil::allocator()); - ASSERT_PASS(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, - &scheduler, - false, // late response mode is off - bmqtst::TestHelperUtil::allocator())); - - ASSERT_PASS(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, - &scheduler, - false, // late response mode is off - bmqex::SystemExecutor(), - bmqtst::TestHelperUtil::allocator())); - - ASSERT_PASS(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobSpPool, - &scheduler, - false, // late response mode is off - bmqex::SystemExecutor(), - ReqManagerType::DTContextSp(), - bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_PASS( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobSpPool, + &scheduler, + false, // late response mode is off + bmqtst::TestHelperUtil::allocator())); + + BMQTST_ASSERT_PASS( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobSpPool, + &scheduler, + false, // late response mode is off + bmqex::SystemExecutor(), + bmqtst::TestHelperUtil::allocator())); + + BMQTST_ASSERT_PASS( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobSpPool, + &scheduler, + false, // late response mode is off + bmqex::SystemExecutor(), + ReqManagerType::DTContextSp(), + bmqtst::TestHelperUtil::allocator())); } } @@ -442,7 +446,8 @@ static void test2_setExecutorTest() { // set SystemExecutor TestContext context(false, bmqtst::TestHelperUtil::allocator()); - ASSERT_PASS(context.manager().setExecutor(bmqex::SystemExecutor())); + BMQTST_ASSERT_PASS( + context.manager().setExecutor(bmqex::SystemExecutor())); } } @@ -458,7 +463,7 @@ static void test3_createRequestTest() // Check that RequestManager really creates request TestContext context(false, bmqtst::TestHelperUtil::allocator()); ReqSp request = context.createRequest(); - ASSERT(request); + BMQTST_ASSERT(request); } } @@ -480,7 +485,7 @@ static void test4_sendRequestTest() { *called = true; bmqp::Event ev(blob_sp.get(), bmqtst::TestHelperUtil::allocator()); - ASSERT(ev.isControlEvent()); + BMQTST_ASSERT(ev.isControlEvent()); Mes controlMessage(bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(0, ev.loadControlEvent(&controlMessage)); BMQTST_ASSERT_EQ(request->request(), controlMessage); @@ -496,7 +501,7 @@ static void test4_sendRequestTest() context.sendChannelRequest(request); // checking, RequestManager has really sent the request to testChannel - ASSERT(request->request().rId().has_value()); + BMQTST_ASSERT(request->request().rId().has_value()); Mes controlMessage = context.getNextRequest(); BMQTST_ASSERT_EQ(request->request(), controlMessage); } @@ -545,7 +550,7 @@ static void test4_sendRequestTest() &called, bdlf::PlaceHolders::_1, request)); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -613,14 +618,14 @@ static void test4_sendRequestTest() Mes controlMes = context.getNextRequest(); ReqChoice& choice = controlMes.choice(); ReqChoiceSet::iterator it = requestsWithoutId.find(choice); - ASSERT(it != requestsWithoutId.end()); + BMQTST_ASSERT(it != requestsWithoutId.end()); if (it != requestsWithoutId.end()) { BMQTST_ASSERT_EQ(choice, *it); requestsWithoutId.erase(it); } } - ASSERT(requestsWithoutId.empty()); + BMQTST_ASSERT(requestsWithoutId.empty()); } } @@ -685,7 +690,7 @@ static void test5_processResponseTest() context.advanceTime(SEND_REQUEST_TIMEOUT); BMQTST_ASSERT_EQ(request->result(), bmqt::GenericResult::e_SUCCESS); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -708,7 +713,7 @@ static void test5_processResponseTest() BMQTST_ASSERT_NE(context.manager().processResponse(response), 0); BMQTST_ASSERT_EQ(request->result(), bmqt::GenericResult::e_TIMEOUT); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -731,7 +736,7 @@ static void test5_processResponseTest() BMQTST_ASSERT_EQ(context.manager().processResponse(response), 0); BMQTST_ASSERT_EQ(request->result(), bmqt::GenericResult::e_SUCCESS); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -936,24 +941,24 @@ static void test7_requestBreathingTest() { // Create request and check its initial state ReqSp request; - ASSERT_PASS( + BMQTST_ASSERT_PASS( request.createInplace(bmqtst::TestHelperUtil::allocator(), bmqtst::TestHelperUtil::allocator())); - ASSERT(request); - ASSERT(!request->isLateResponse()); - ASSERT(!request->isLocalTimeout()); - ASSERT(!request->isError()); - ASSERT(typeid(request->request()) == typeid(Mes)); + BMQTST_ASSERT(request); + BMQTST_ASSERT(!request->isLateResponse()); + BMQTST_ASSERT(!request->isLocalTimeout()); + BMQTST_ASSERT(!request->isError()); + BMQTST_ASSERT(typeid(request->request()) == typeid(Mes)); Mes& req = request->request(); - ASSERT(!req.rId().has_value()); - ASSERT(typeid(request->response()) == typeid(Mes)); + BMQTST_ASSERT(!req.rId().has_value()); + BMQTST_ASSERT(typeid(request->response()) == typeid(Mes)); Mes& res = request->response(); - ASSERT(!res.rId().has_value()); - ASSERT(!static_cast(request->responseCb())); + BMQTST_ASSERT(!res.rId().has_value()); + BMQTST_ASSERT(!static_cast(request->responseCb())); BMQTST_ASSERT_EQ(request->result(), bmqt::GenericResult::e_SUCCESS); - ASSERT(request->nodeDescription().empty()); + BMQTST_ASSERT(request->nodeDescription().empty()); BMQTST_ASSERT_EQ(request->groupId(), -1); // Req::k_NO_GROUP_ID - ASSERT(request->userData().isNull()); + BMQTST_ASSERT(request->userData().isNull()); } { @@ -970,7 +975,7 @@ static void test7_requestBreathingTest() &request)); request->responseCb()(request); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -985,7 +990,7 @@ static void test7_requestBreathingTest() bdlf::PlaceHolders::_1, &request)); request->signal(); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -1009,7 +1014,7 @@ static void test7_requestBreathingTest() bmqtst::TestHelperUtil::allocator()); request->adoptUserData(datum); const bdld::Datum& new_datum = request->userData(); - ASSERT(new_datum.isString()); + BMQTST_ASSERT(new_datum.isString()); BMQTST_ASSERT_EQ(test, new_datum.theString()); } } @@ -1037,7 +1042,7 @@ static void test8_requestSignalWaitTest() // Wait for signal in separate thread bool worked = false; ReqSp request; - ASSERT_PASS( + BMQTST_ASSERT_PASS( request.createInplace(bmqtst::TestHelperUtil::allocator(), bmqtst::TestHelperUtil::allocator())); @@ -1052,13 +1057,13 @@ static void test8_requestSignalWaitTest() bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(rc, 0); bslmt::ThreadUtil::yield(); - ASSERT(!worked); + BMQTST_ASSERT(!worked); request->signal(); // Here we don't know if 'wait()' is already executing in the separate // thread or not. But we can guarantee that it is not finished yet. rc = bslmt::ThreadUtil::join(handle); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(worked); + BMQTST_ASSERT(worked); } } diff --git a/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp index fa8212c15..41c287056 100644 --- a/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp @@ -110,7 +110,7 @@ static void test1_breathingTest() rc = event.loadControlEvent(&decoded); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(decoded.choice().isStatusValue()); + BMQTST_ASSERT(decoded.choice().isStatusValue()); BMQTST_ASSERT_EQ(decoded.choice().status().code(), status.code()); BMQTST_ASSERT_EQ(decoded.choice().status().message(), status.message()); @@ -328,7 +328,7 @@ static void testN1_decodeFromFile() "status", &bufferFactory); - ASSERT(decoded.choice().isStatusValue()); + BMQTST_ASSERT(decoded.choice().isStatusValue()); BMQTST_ASSERT_EQ(decoded.choice().status().code(), status.code()); BMQTST_ASSERT_EQ(decoded.choice().status().message(), status.message()); @@ -522,12 +522,12 @@ static void testN1_decodeFromFile() "open_queue", &bufferFactory); - ASSERT(decoded.choice().isOpenQueueValue()); + BMQTST_ASSERT(decoded.choice().isOpenQueueValue()); bmqp_ctrlmsg::OpenQueue& decOpenQueue = decoded.choice().openQueue(); - ASSERT(decOpenQueue == openQueue); + BMQTST_ASSERT(decOpenQueue == openQueue); } PVV(test.d_line << ": OpenQueueResponse message"); @@ -570,7 +570,7 @@ static void testN1_decodeFromFile() bmqp_ctrlmsg::OpenQueueResponse& decOpenQueueResponse = decoded.choice().openQueueResponse(); - ASSERT(decOpenQueueResponse == openQueueResponse); + BMQTST_ASSERT(decOpenQueueResponse == openQueueResponse); } } } diff --git a/src/groups/bmq/bmqp/bmqp_schemagenerator.t.cpp b/src/groups/bmq/bmqp/bmqp_schemagenerator.t.cpp index 5ac3f5d3f..4ff783524 100644 --- a/src/groups/bmq/bmqp/bmqp_schemagenerator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_schemagenerator.t.cpp @@ -146,12 +146,12 @@ static void test1_breathingTest() BMQTST_ASSERT_NE(schemaId, NO_SCHEMA); ids[schemaId] = count; - ASSERT(logic.isRecycled()); // either first use or recycled + BMQTST_ASSERT(logic.isRecycled()); // either first use or recycled // Call 'getSchema' again logic = theGenerator.getSchemaId(&mps); BMQTST_ASSERT_EQ(schemaId, logic.schemaId()); - ASSERT(!logic.isRecycled()); // second use + BMQTST_ASSERT(!logic.isRecycled()); // second use } } // Some number of first test combinations (65) got recycled. @@ -169,13 +169,13 @@ static void test1_breathingTest() BMQTST_ASSERT_NE(ids[i + 1], i); // 'i + 1' was recycled bmqp::MessagePropertiesInfo logic = theGenerator.getSchemaId(&mps); - ASSERT(logic.isRecycled()); + BMQTST_ASSERT(logic.isRecycled()); // We continue recycling BMQTST_ASSERT_EQ(logic.schemaId(), SchemaIdType(i + 1 + NUM_RECYCLED)); // Call again to make number of hits equal to the rest (2) logic = theGenerator.getSchemaId(&mps); - ASSERT(!logic.isRecycled()); + BMQTST_ASSERT(!logic.isRecycled()); // We continue recycling BMQTST_ASSERT_EQ(logic.schemaId(), SchemaIdType(i + 1 + NUM_RECYCLED)); } diff --git a/src/groups/bmq/bmqp/bmqp_schemalearner.t.cpp b/src/groups/bmq/bmqp/bmqp_schemalearner.t.cpp index 38982ed71..94c8927f7 100644 --- a/src/groups/bmq/bmqp/bmqp_schemalearner.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_schemalearner.t.cpp @@ -56,7 +56,7 @@ static void test1_multiplexingTest() bmqp::MessagePropertiesInfo out = theLearner.multiplex(clientSession1, in); - ASSERT(in == out); + BMQTST_ASSERT(in == out); } bmqp::MessagePropertiesInfo info(true, 1, false); @@ -148,25 +148,25 @@ static void test2_readingTest() BMQTST_ASSERT_NE(schema1, schema2); // ...unless the input is recycled - ASSERT(schema1); - ASSERT(schema2); + BMQTST_ASSERT(schema1); + BMQTST_ASSERT(schema2); int index; for (int i = 0; i < num; ++i) { bsl::string name = bsl::to_string(i); - ASSERT(schema1->loadIndex(&index, name)); + BMQTST_ASSERT(schema1->loadIndex(&index, name)); } - ASSERT(!schema1->loadIndex(&index, "a")); + BMQTST_ASSERT(!schema1->loadIndex(&index, "a")); for (int i = 0; i < num; ++i) { bsl::string name = bsl::to_string(i); - ASSERT(schema2->loadIndex(&index, name)); + BMQTST_ASSERT(schema2->loadIndex(&index, name)); } - ASSERT(!schema2->loadIndex(&index, "a")); + BMQTST_ASSERT(!schema2->loadIndex(&index, "a")); } static void test3_observingTest() @@ -235,17 +235,17 @@ static void test4_demultiplexingTest() bmqp::MessagePropertiesInfo demuxOut; demuxOut = theLearner.demultiplex(queueHandle, muxIn); - ASSERT(demuxOut.isRecycled()); + BMQTST_ASSERT(demuxOut.isRecycled()); BMQTST_ASSERT_EQ(muxIn.schemaId(), demuxOut.schemaId()); demuxOut = theLearner.demultiplex(queueHandle, muxIn); - ASSERT(!demuxOut.isRecycled()); + BMQTST_ASSERT(!demuxOut.isRecycled()); BMQTST_ASSERT_EQ(muxIn.schemaId(), demuxOut.schemaId()); demuxOut = theLearner.demultiplex(queueHandle, recycledMuxIn); - ASSERT(demuxOut.isRecycled()); + BMQTST_ASSERT(demuxOut.isRecycled()); BMQTST_ASSERT_EQ(muxIn.schemaId(), demuxOut.schemaId()); } @@ -274,7 +274,7 @@ static void test5_emptyMPs() const bdlbb::Blob& out = p.streamOut(&bufferFactory, logic); BMQTST_ASSERT_EQ(0, out.length()); - ASSERT(!p.hasProperty("z")); + BMQTST_ASSERT(!p.hasProperty("z")); } static void test6_partialRead() @@ -334,11 +334,11 @@ static void test6_partialRead() bmqp::MessagePropertiesIterator it(&out3); - ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); BMQTST_ASSERT_EQ(it.getAsString(), x); - ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); BMQTST_ASSERT_EQ(it.getAsString(), mod); - ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); BMQTST_ASSERT_EQ(it.getAsString(), z); } @@ -405,17 +405,17 @@ static void test7_removeBeforeRead() out2.totalSize()); } } - ASSERT(out2.remove(current)); + BMQTST_ASSERT(out2.remove(current)); BMQTST_ASSERT_EQ(out1.totalSize() - sizeof(bmqp::MessagePropertyHeader) - bsl::strlen(current) - bsl::strlen(current), out2.totalSize()); - ASSERT(!out2.hasProperty(current)); + BMQTST_ASSERT(!out2.hasProperty(current)); for (int i = 0; i < numProps; ++i) { if (i == iProperty) { - ASSERT(!out2.hasProperty(name[i])); + BMQTST_ASSERT(!out2.hasProperty(name[i])); } else { BMQTST_ASSERT_EQ(out2.getPropertyAsString(name[i]), @@ -431,9 +431,9 @@ static void test7_removeBeforeRead() { bmqp::MessagePropertiesIterator it(&out2); - ASSERT(it.hasNext()); - ASSERT(it.hasNext()); - ASSERT(!it.hasNext()); + BMQTST_ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); + BMQTST_ASSERT(!it.hasNext()); } // Add the property back @@ -456,10 +456,10 @@ static void test7_removeBeforeRead() { bmqp::MessagePropertiesIterator it(&out2); - ASSERT(it.hasNext()); - ASSERT(it.hasNext()); - ASSERT(it.hasNext()); - ASSERT(!it.hasNext()); + BMQTST_ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); + BMQTST_ASSERT(it.hasNext()); + BMQTST_ASSERT(!it.hasNext()); } } } diff --git a/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp b/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp index b613b5849..def80c804 100644 --- a/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp @@ -692,7 +692,7 @@ static void test5_packMessageRaw_emptyMessage() bdlbb::Blob emptyBlob(&bufferFactory, bmqtst::TestHelperUtil::allocator()); BSLS_ASSERT_OPT(emptyBlob.length() == 0); - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( seb.packMessageRaw(emptyBlob, bmqu::BlobPosition(0, 0), 0)); BMQTST_ASSERT_EQ( seb.packMessageRaw(emptyBlob, bmqu::BlobPosition(0, 0), 10), diff --git a/src/groups/bmq/bmqp/bmqp_storagemessageiterator.t.cpp b/src/groups/bmq/bmqp/bmqp_storagemessageiterator.t.cpp index c5a9abb17..6c9f5373a 100644 --- a/src/groups/bmq/bmqp/bmqp_storagemessageiterator.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_storagemessageiterator.t.cpp @@ -642,9 +642,9 @@ static void test5_corruptedStorageEvent_part3() // Create iterator bmqp::StorageMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); BMQTST_ASSERT_LT(iter.next(), 0); // rc_NO_RECOVERYHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } } static void test6_resetMethod() @@ -685,7 +685,7 @@ static void test6_resetMethod() // Create iterator bmqp::StorageMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Invalidate the blob blob.setLength(enoughSize - 1); @@ -693,7 +693,7 @@ static void test6_resetMethod() // Reset and verify BMQTST_ASSERT_LT(iter.reset(&blob, eventHeader), 0); // rc_INVALID_EVENTHEADER - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.isValid()); } } @@ -734,7 +734,7 @@ static void test7_dumpBlob() // Create iterator over blob { bmqp::StorageMessageIterator iter(&blob, eventHeader); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.isValid()); // Dump blob iter.dumpBlob(stream); diff --git a/src/groups/bmq/bmqpi/bmqpi_dtcontext.t.cpp b/src/groups/bmq/bmqpi/bmqpi_dtcontext.t.cpp index 9e087be73..1f5655dc3 100644 --- a/src/groups/bmq/bmqpi/bmqpi_dtcontext.t.cpp +++ b/src/groups/bmq/bmqpi/bmqpi_dtcontext.t.cpp @@ -94,13 +94,13 @@ static void test1_breathingTest() bsls::ProtocolTest context; PV("Verify that the protocol is abstract"); - ASSERT(context.testAbstract()); + BMQTST_ASSERT(context.testAbstract()); PV("Verify that there are no data members"); - ASSERT(context.testNoDataMembers()); + BMQTST_ASSERT(context.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(context.testVirtualDestructor()); + BMQTST_ASSERT(context.testVirtualDestructor()); PV("Verify that all methods are public and virtual"); diff --git a/src/groups/bmq/bmqpi/bmqpi_dtspan.t.cpp b/src/groups/bmq/bmqpi/bmqpi_dtspan.t.cpp index 2539557c4..e2353b963 100644 --- a/src/groups/bmq/bmqpi/bmqpi_dtspan.t.cpp +++ b/src/groups/bmq/bmqpi/bmqpi_dtspan.t.cpp @@ -82,13 +82,13 @@ static void test1_breathingTest() bsls::ProtocolTest span; PV("Verify that the protocol is abstract"); - ASSERT(span.testAbstract()); + BMQTST_ASSERT(span.testAbstract()); PV("Verify that there are no data members"); - ASSERT(span.testNoDataMembers()); + BMQTST_ASSERT(span.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(span.testVirtualDestructor()); + BMQTST_ASSERT(span.testVirtualDestructor()); PV("Verify that all methods are public and virtual"); diff --git a/src/groups/bmq/bmqpi/bmqpi_dttracer.t.cpp b/src/groups/bmq/bmqpi/bmqpi_dttracer.t.cpp index f67e2e008..51355d652 100644 --- a/src/groups/bmq/bmqpi/bmqpi_dttracer.t.cpp +++ b/src/groups/bmq/bmqpi/bmqpi_dttracer.t.cpp @@ -91,13 +91,13 @@ static void test1_breathingTest() bsls::ProtocolTest tracer; PV("Verify that the protocol is abstract"); - ASSERT(tracer.testAbstract()); + BMQTST_ASSERT(tracer.testAbstract()); PV("Verify that there are no data members"); - ASSERT(tracer.testNoDataMembers()); + BMQTST_ASSERT(tracer.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(tracer.testVirtualDestructor()); + BMQTST_ASSERT(tracer.testVirtualDestructor()); PV("Verify that all methods are public and virtual"); bmqpi::DTSpan::Baggage empty; diff --git a/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.t.cpp b/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.t.cpp index 3202ce493..d8c114c3f 100644 --- a/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.t.cpp +++ b/src/groups/bmq/bmqpi/bmqpi_hosthealthmonitor.t.cpp @@ -97,13 +97,13 @@ static void test1_breathingTest() bsls::ProtocolTest monitor; PV("Verify that the protocol is abstract"); - ASSERT(monitor.testAbstract()); + BMQTST_ASSERT(monitor.testAbstract()); PV("Verify that there are no data members"); - ASSERT(monitor.testNoDataMembers()); + BMQTST_ASSERT(monitor.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(monitor.testVirtualDestructor()); + BMQTST_ASSERT(monitor.testVirtualDestructor()); PV("Verify that all methods are public and virtual"); diff --git a/src/groups/bmq/bmqst/bmqst_printutil.t.cpp b/src/groups/bmq/bmqst/bmqst_printutil.t.cpp index 95a9e3af6..8da0b33d3 100644 --- a/src/groups/bmq/bmqst/bmqst_printutil.t.cpp +++ b/src/groups/bmq/bmqst/bmqst_printutil.t.cpp @@ -67,7 +67,7 @@ void checkStreamOutput(int line, const TYPE& obj, const char* expected) bsl::ostringstream ss; ss << bmqst::Printer(&obj); - LOOP_BMQTST_ASSERT_EQUALS(line, ss.str(), expected); + LOOP_ASSERT_EQUALS(line, ss.str(), expected); } template @@ -80,7 +80,7 @@ void checkPrintOutput(int line, bsl::ostringstream ss; bmqst::Printer printer(&obj); printer.print(ss, level, spacesPerLevel); - LOOP_BMQTST_ASSERT_EQUALS(line, ss.str(), expected); + LOOP_ASSERT_EQUALS(line, ss.str(), expected); } //============================================================================= @@ -168,7 +168,7 @@ int main(int argc, char* argv[]) bsl::ostringstream ss; PrintUtil::printOrdinal(ss, data.d_num); - LOOP_BMQTST_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); + LOOP_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); } } break; @@ -225,8 +225,8 @@ int main(int argc, char* argv[]) data.d_interval, data.d_precision); - LOOP_BMQTST_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); - LOOP_BMQTST_ASSERT_EQUALS(LINE, printedLength, expectedLength); + LOOP_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); + LOOP_ASSERT_EQUALS(LINE, printedLength, expectedLength); } } break; @@ -283,8 +283,8 @@ int main(int argc, char* argv[]) data.d_precision, data.d_groupSize); - LOOP_BMQTST_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); - LOOP_BMQTST_ASSERT_EQUALS(LINE, expectedLength, calculatedLength); + LOOP_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); + LOOP_ASSERT_EQUALS(LINE, expectedLength, calculatedLength); } } break; @@ -335,7 +335,7 @@ int main(int argc, char* argv[]) data.d_groupSize, data.d_separator); - LOOP_BMQTST_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); + LOOP_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); } } break; @@ -400,10 +400,10 @@ int main(int argc, char* argv[]) int expectedLength = PrintUtil::printedMemoryLength(data.d_arg, data.d_precision); - LOOP_BMQTST_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); - LOOP_BMQTST_ASSERT_EQUALS(LINE, - static_cast(ss.str().length()), - expectedLength); + LOOP_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); + LOOP_ASSERT_EQUALS(LINE, + static_cast(ss.str().length()), + expectedLength); } #undef TO_I64 diff --git a/src/groups/bmq/bmqst/bmqst_statcontext.t.cpp b/src/groups/bmq/bmqst/bmqst_statcontext.t.cpp index 9acde204e..4ba82cf6e 100644 --- a/src/groups/bmq/bmqst/bmqst_statcontext.t.cpp +++ b/src/groups/bmq/bmqst/bmqst_statcontext.t.cpp @@ -142,7 +142,7 @@ static bool checkSnapshot(const StatValue& value, bsl::vector expectedValues = bmqst::TestUtil::int64Vector(snapshotDesc); - BMQTST_ASSERT_EQUALS(expectedValues, snapshotValues); + ASSERT_EQUALS(expectedValues, snapshotValues); return expectedValues == snapshotValues; } @@ -894,7 +894,7 @@ static void testUpdates(bslma::Allocator* /*allocator*/) bmqstm::StatContextUpdate fullUpdate; c1.loadFullUpdate(&fullUpdate); - BMQTST_ASSERT_EQUALS(u1, fullUpdate); + ASSERT_EQUALS(u1, fullUpdate); ASSERT(2 == u1.directValues().size()); ASSERT(hasField(u1, 0, Fields::E_ABSOLUTE_MIN)); @@ -906,13 +906,13 @@ static void testUpdates(bslma::Allocator* /*allocator*/) ASSERT(hasField(u1, 0, Fields::E_DECREMENTS)); ASSERT(!hasField(u1, 0, Fields::E_EVENTS)); ASSERT(!hasField(u1, 0, Fields::E_SUM)); - BMQTST_ASSERT_EQUALS(0, field(u1, 0, Fields::E_ABSOLUTE_MIN)); - BMQTST_ASSERT_EQUALS(9, field(u1, 0, Fields::E_ABSOLUTE_MAX)); - BMQTST_ASSERT_EQUALS(0, field(u1, 0, Fields::E_MIN)); - BMQTST_ASSERT_EQUALS(9, field(u1, 0, Fields::E_MAX)); - BMQTST_ASSERT_EQUALS(9, field(u1, 0, Fields::E_VALUE)); - BMQTST_ASSERT_EQUALS(2, field(u1, 0, Fields::E_INCREMENTS)); - BMQTST_ASSERT_EQUALS(0, field(u1, 0, Fields::E_DECREMENTS)); + ASSERT_EQUALS(0, field(u1, 0, Fields::E_ABSOLUTE_MIN)); + ASSERT_EQUALS(9, field(u1, 0, Fields::E_ABSOLUTE_MAX)); + ASSERT_EQUALS(0, field(u1, 0, Fields::E_MIN)); + ASSERT_EQUALS(9, field(u1, 0, Fields::E_MAX)); + ASSERT_EQUALS(9, field(u1, 0, Fields::E_VALUE)); + ASSERT_EQUALS(2, field(u1, 0, Fields::E_INCREMENTS)); + ASSERT_EQUALS(0, field(u1, 0, Fields::E_DECREMENTS)); ASSERT(hasField(u1, 1, Fields::E_ABSOLUTE_MIN)); ASSERT(hasField(u1, 1, Fields::E_ABSOLUTE_MAX)); @@ -923,15 +923,15 @@ static void testUpdates(bslma::Allocator* /*allocator*/) ASSERT(!hasField(u1, 1, Fields::E_DECREMENTS)); ASSERT(hasField(u1, 1, Fields::E_EVENTS)); ASSERT(hasField(u1, 1, Fields::E_SUM)); - BMQTST_ASSERT_EQUALS(4, field(u1, 1, Fields::E_ABSOLUTE_MIN)); - BMQTST_ASSERT_EQUALS(5, field(u1, 1, Fields::E_ABSOLUTE_MAX)); - BMQTST_ASSERT_EQUALS(4, field(u1, 1, Fields::E_MIN)); - BMQTST_ASSERT_EQUALS(5, field(u1, 1, Fields::E_MAX)); - BMQTST_ASSERT_EQUALS(2, field(u1, 1, Fields::E_EVENTS)); - BMQTST_ASSERT_EQUALS(9, field(u1, 1, Fields::E_SUM)); + ASSERT_EQUALS(4, field(u1, 1, Fields::E_ABSOLUTE_MIN)); + ASSERT_EQUALS(5, field(u1, 1, Fields::E_ABSOLUTE_MAX)); + ASSERT_EQUALS(4, field(u1, 1, Fields::E_MIN)); + ASSERT_EQUALS(5, field(u1, 1, Fields::E_MAX)); + ASSERT_EQUALS(2, field(u1, 1, Fields::E_EVENTS)); + ASSERT_EQUALS(9, field(u1, 1, Fields::E_SUM)); StatContext c2(StatContextConfiguration(u1).enableUpdateCollection(&u2)); - BMQTST_ASSERT_EQUALS(u1, u2); + ASSERT_EQUALS(u1, u2); ASSERT(checkSnapshot(direct(c2, 0), 0, 0, "9 0 9 2 0")); ASSERT(checkSnapshot(direct(c2, 0), 0, 1, "0 0 0 0 0")); ASSERT(checkSnapshot(direct(c2, 0), 1, 0, "0 0 0 0 0")); @@ -956,11 +956,11 @@ static void testUpdates(bslma::Allocator* /*allocator*/) ASSERT(hasField(u2, 0, Fields::E_DECREMENTS)); ASSERT(!hasField(u2, 0, Fields::E_EVENTS)); ASSERT(!hasField(u2, 0, Fields::E_SUM)); - BMQTST_ASSERT_EQUALS(8, field(u2, 0, Fields::E_MIN)); - BMQTST_ASSERT_EQUALS(10, field(u2, 0, Fields::E_MAX)); - BMQTST_ASSERT_EQUALS(8, field(u2, 0, Fields::E_VALUE)); - BMQTST_ASSERT_EQUALS(3, field(u2, 0, Fields::E_INCREMENTS)); - BMQTST_ASSERT_EQUALS(1, field(u2, 0, Fields::E_DECREMENTS)); + ASSERT_EQUALS(8, field(u2, 0, Fields::E_MIN)); + ASSERT_EQUALS(10, field(u2, 0, Fields::E_MAX)); + ASSERT_EQUALS(8, field(u2, 0, Fields::E_VALUE)); + ASSERT_EQUALS(3, field(u2, 0, Fields::E_INCREMENTS)); + ASSERT_EQUALS(1, field(u2, 0, Fields::E_DECREMENTS)); ASSERT(!hasField(u2, 1, Fields::E_ABSOLUTE_MIN)); ASSERT(!hasField(u2, 1, Fields::E_ABSOLUTE_MAX)); @@ -971,13 +971,13 @@ static void testUpdates(bslma::Allocator* /*allocator*/) ASSERT(!hasField(u2, 1, Fields::E_DECREMENTS)); ASSERT(hasField(u2, 1, Fields::E_EVENTS)); ASSERT(hasField(u2, 1, Fields::E_SUM)); - BMQTST_ASSERT_EQUALS(10, field(u2, 1, Fields::E_MIN)); - BMQTST_ASSERT_EQUALS(10, field(u2, 1, Fields::E_MAX)); - BMQTST_ASSERT_EQUALS(3, field(u2, 1, Fields::E_EVENTS)); - BMQTST_ASSERT_EQUALS(19, field(u2, 1, Fields::E_SUM)); + ASSERT_EQUALS(10, field(u2, 1, Fields::E_MIN)); + ASSERT_EQUALS(10, field(u2, 1, Fields::E_MAX)); + ASSERT_EQUALS(3, field(u2, 1, Fields::E_EVENTS)); + ASSERT_EQUALS(19, field(u2, 1, Fields::E_SUM)); c1.snapshotFromUpdate(u2); - BMQTST_ASSERT_EQUALS(u1, u2); + ASSERT_EQUALS(u1, u2); ASSERT(checkSnapshot(direct(c1, 0), 0, 0, "8 8 10 3 1")); ASSERT(checkSnapshot(direct(c1, 0), 0, 1, "9 0 9 2 0")); @@ -1002,11 +1002,11 @@ static void testUpdates(bslma::Allocator* /*allocator*/) ASSERT(!hasField(u1, 1, Fields::E_DECREMENTS)); ASSERT(!hasField(u1, 1, Fields::E_EVENTS)); ASSERT(!hasField(u1, 1, Fields::E_SUM)); - BMQTST_ASSERT_EQUALS(MAX_INT, field(u1, 1, Fields::E_MIN)); - BMQTST_ASSERT_EQUALS(MIN_INT, field(u1, 1, Fields::E_MAX)); + ASSERT_EQUALS(MAX_INT, field(u1, 1, Fields::E_MIN)); + ASSERT_EQUALS(MIN_INT, field(u1, 1, Fields::E_MAX)); c2.snapshotFromUpdate(u1); - BMQTST_ASSERT_EQUALS(u1, u2); + ASSERT_EQUALS(u1, u2); ASSERT(checkSnapshot(direct(c2, 0), 0, 0, "11 8 11 4 1")); ASSERT(checkSnapshot(direct(c2, 0), 0, 1, "8 8 10 3 1")); @@ -1031,7 +1031,7 @@ static void testUpdatesWithUsageExample(bslma::Allocator* allocator) usageExample(nstream, allocator); usageExampleUpdate(ustream, allocator); - BMQTST_ASSERT_EQUALS(nstream.str(), ustream.str()); + ASSERT_EQUALS(nstream.str(), ustream.str()); nstream.reset(); ustream.reset(); @@ -1040,7 +1040,7 @@ static void testUpdatesWithUsageExample(bslma::Allocator* allocator) tableUsageExample(nstream, allocator); tableUsageExampleUpdate(ustream, allocator); - BMQTST_ASSERT_EQUALS(nstream.str(), ustream.str()); + ASSERT_EQUALS(nstream.str(), ustream.str()); nstream.reset(); ustream.reset(); @@ -1049,7 +1049,7 @@ static void testUpdatesWithUsageExample(bslma::Allocator* allocator) subcontextUsageExample(nstream, allocator); subcontextUsageExampleUpdate(ustream, allocator); - BMQTST_ASSERT_EQUALS(nstream.str(), ustream.str()); + ASSERT_EQUALS(nstream.str(), ustream.str()); nstream.reset(); ustream.reset(); @@ -1058,7 +1058,7 @@ static void testUpdatesWithUsageExample(bslma::Allocator* allocator) valueLevelUsageExample(nstream, allocator); valueLevelUsageExampleUpdate(ustream, allocator); - BMQTST_ASSERT_EQUALS(nstream.str(), ustream.str()); + ASSERT_EQUALS(nstream.str(), ustream.str()); } static void testDatum(bslma::Allocator* allocator) @@ -1198,8 +1198,8 @@ int main(int argc, char** argv) } // Ensure no memory was allocated from the default or global allocator - BMQTST_ASSERT_EQUALS(gam.isTotalSame(), true); - BMQTST_ASSERT_EQUALS(dam.isTotalSame(), true); + ASSERT_EQUALS(gam.isTotalSame(), true); + ASSERT_EQUALS(dam.isTotalSame(), true); // The standard return values are 0 on success, a positive value // to indicate the number of assertion failures, or a negative diff --git a/src/groups/bmq/bmqst/bmqst_tableutil.t.cpp b/src/groups/bmq/bmqst/bmqst_tableutil.t.cpp index 622d1ea8b..634124517 100644 --- a/src/groups/bmq/bmqst/bmqst_tableutil.t.cpp +++ b/src/groups/bmq/bmqst/bmqst_tableutil.t.cpp @@ -219,7 +219,7 @@ int main(int argc, char* argv[]) bmqu::MemOutStream stream; bmqst::TableUtil::printCsv(stream, tip); - BMQTST_ASSERT_EQUALS(stream.str(), data.d_expected); + ASSERT_EQUALS(stream.str(), data.d_expected); } } break; @@ -292,8 +292,8 @@ case 3: { bsl::ostringstream output; int ret = TableUtil::printCsv(output, tip); - BMQTST_ASSERT_EQUALS(ret, 0); - BMQTST_ASSERT_EQUALS(output.str(), expected); + ASSERT_EQUALS(ret, 0); + ASSERT_EQUALS(output.str(), expected); } } break; */ @@ -344,8 +344,8 @@ case 3: { bsl::vector > output; int ret = bmqst::TableUtil::outputToVector(&output, tip); - BMQTST_ASSERT_EQUALS(ret, 0); - BMQTST_ASSERT_EQUALS(output, expected); + ASSERT_EQUALS(ret, 0); + ASSERT_EQUALS(output, expected); } } break; diff --git a/src/groups/bmq/bmqst/bmqst_testutil.h b/src/groups/bmq/bmqst/bmqst_testutil.h index 8a64b5147..f3acef433 100644 --- a/src/groups/bmq/bmqst/bmqst_testutil.h +++ b/src/groups/bmq/bmqst/bmqst_testutil.h @@ -57,7 +57,7 @@ } // Asserts that X == Y -#define BMQTST_ASSERT_EQUALS_SKIP(X, Y, SKIP) \ +#define ASSERT_EQUALS_SKIP(X, Y, SKIP) \ { \ if (!((X) == (Y))) { \ bsl::cout << "Error " << __FILE__ << "(" << __LINE__ \ @@ -70,7 +70,7 @@ ++testStatus; \ } \ } -#define BMQTST_ASSERT_EQUALS(X, Y) BMQTST_ASSERT_EQUALS_SKIP(X, Y, false) +#define ASSERT_EQUALS(X, Y) ASSERT_EQUALS_SKIP(X, Y, false) // Asserts that X != Y #define ASSERT_NOT_EQUALS_SKIP(X, Y, SKIP) \ @@ -88,8 +88,8 @@ } #define ASSERT_NOT_EQUALS(X, Y) ASSERT_NOT_EQUALS_SKIP(X, Y, false) -// Loop version of BMQTST_ASSERT_EQUALS -#define LOOP_BMQTST_ASSERT_EQUALS_SKIP(I, X, Y, SKIP) \ +// Loop version of ASSERT_EQUALS +#define LOOP_ASSERT_EQUALS_SKIP(I, X, Y, SKIP) \ { \ if (!((X) == (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -103,8 +103,7 @@ ++testStatus; \ } \ } -#define LOOP_BMQTST_ASSERT_EQUALS(I, X, Y) \ - LOOP_BMQTST_ASSERT_EQUALS_SKIP(I, X, Y, false) +#define LOOP_ASSERT_EQUALS(I, X, Y) LOOP_ASSERT_EQUALS_SKIP(I, X, Y, false) // Loop version of ASSERT_NOT_EQUALS #define LOOP_ASSERT_NOT_EQUALS(I, X, Y) \ @@ -119,7 +118,7 @@ ++testStatus; \ } \ } -#define LOOP2_BMQTST_ASSERT_EQUALS(I, J, X, Y) \ +#define LOOP2_ASSERT_EQUALS(I, J, X, Y) \ { \ if (!((X) == (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -134,7 +133,7 @@ } // Asserts that X < Y -#define BMQTST_ASSERT_LESS_SKIP(X, Y, SKIP) \ +#define ASSERT_LESS_SKIP(X, Y, SKIP) \ { \ if (!((X) < (Y))) { \ bsl::cout << "Error " << __FILE__ << "(" << __LINE__ \ @@ -147,10 +146,10 @@ ++testStatus; \ } \ } -#define BMQTST_ASSERT_LESS(X, Y) BMQTST_ASSERT_LESS_SKIP(X, Y, false) +#define ASSERT_LESS(X, Y) ASSERT_LESS_SKIP(X, Y, false) -// Loop version of BMQTST_ASSERT_LESS -#define LOOP_BMQTST_ASSERT_LESS_SKIP(I, X, Y, SKIP) \ +// Loop version of ASSERT_LESS +#define LOOP_ASSERT_LESS_SKIP(I, X, Y, SKIP) \ { \ if (!((X) < (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -164,7 +163,7 @@ ++testStatus; \ } \ } -#define LOOP2_BMQTST_ASSERT_LESS_SKIP(I, J, X, Y, SKIP) \ +#define LOOP2_ASSERT_LESS_SKIP(I, J, X, Y, SKIP) \ { \ if (!((X) < (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -179,13 +178,11 @@ ++testStatus; \ } \ } -#define LOOP_BMQTST_ASSERT_LESS(I, X, Y) \ - LOOP_BMQTST_ASSERT_LESS_SKIP(I, X, Y, false) -#define LOOP2_BMQTST_ASSERT_LESS(I, J, X, Y) \ - LOOP2_BMQTST_ASSERT_LESS_SKIP(I, J, X, Y, false) +#define LOOP_ASSERT_LESS(I, X, Y) LOOP_ASSERT_LESS_SKIP(I, X, Y, false) +#define LOOP2_ASSERT_LESS(I, J, X, Y) LOOP2_ASSERT_LESS_SKIP(I, J, X, Y, false) // Asserts that X <= Y -#define BMQTST_ASSERT_LE_SKIP(X, Y, SKIP) \ +#define ASSERT_LE_SKIP(X, Y, SKIP) \ { \ if (!((X) <= (Y))) { \ bsl::cout << "Error " << __FILE__ << "(" << __LINE__ \ @@ -198,10 +195,10 @@ ++testStatus; \ } \ } -#define BMQTST_ASSERT_LE(X, Y) BMQTST_ASSERT_LE_SKIP(X, Y, false) +#define ASSERT_LE(X, Y) ASSERT_LE_SKIP(X, Y, false) -// Loop version of BMQTST_ASSERT_LE -#define LOOP_BMQTST_ASSERT_LE_SKIP(I, X, Y, SKIP) \ +// Loop version of ASSERT_LE +#define LOOP_ASSERT_LE_SKIP(I, X, Y, SKIP) \ { \ if (!((X) <= (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -215,7 +212,7 @@ ++testStatus; \ } \ } -#define LOOP2_BMQTST_ASSERT_LE_SKIP(I, J, X, Y, SKIP) \ +#define LOOP2_ASSERT_LE_SKIP(I, J, X, Y, SKIP) \ { \ if (!((X) <= (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -230,13 +227,11 @@ ++testStatus; \ } \ } -#define LOOP_BMQTST_ASSERT_LE(I, X, Y) \ - LOOP_BMQTST_ASSERT_LE_SKIP(I, X, Y, false) -#define LOOP2_BMQTST_ASSERT_LE(I, J, X, Y) \ - LOOP2_BMQTST_ASSERT_LE_SKIP(I, J, X, Y, false) +#define LOOP_ASSERT_LE(I, X, Y) LOOP_ASSERT_LE_SKIP(I, X, Y, false) +#define LOOP2_ASSERT_LE(I, J, X, Y) LOOP2_ASSERT_LE_SKIP(I, J, X, Y, false) // Asserts that X >= Y -#define BMQTST_ASSERT_GE_SKIP(X, Y, SKIP) \ +#define ASSERT_GE_SKIP(X, Y, SKIP) \ { \ if (!((X) >= (Y))) { \ bsl::cout << "Error " << __FILE__ << "(" << __LINE__ \ @@ -249,10 +244,10 @@ ++testStatus; \ } \ } -#define BMQTST_ASSERT_GE(X, Y) BMQTST_ASSERT_GE_SKIP(X, Y, false) +#define ASSERT_GE(X, Y) ASSERT_GE_SKIP(X, Y, false) -// Loop version of BMQTST_ASSERT_LE -#define LOOP_BMQTST_ASSERT_GE_SKIP(I, X, Y, SKIP) \ +// Loop version of ASSERT_LE +#define LOOP_ASSERT_GE_SKIP(I, X, Y, SKIP) \ { \ if (!((X) >= (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -266,7 +261,7 @@ ++testStatus; \ } \ } -#define LOOP2_BMQTST_ASSERT_GE_SKIP(I, J, X, Y, SKIP) \ +#define LOOP2_ASSERT_GE_SKIP(I, J, X, Y, SKIP) \ { \ if (!((X) >= (Y))) { \ cout << #I << ": " << bmqu::PrintUtil::printer(I) << "\n" \ @@ -281,10 +276,8 @@ ++testStatus; \ } \ } -#define LOOP_BMQTST_ASSERT_GE(I, X, Y) \ - LOOP_BMQTST_ASSERT_GE_SKIP(I, X, Y, false) -#define LOOP2_BMQTST_ASSERT_GE(I, J, X, Y) \ - LOOP2_BMQTST_ASSERT_GE_SKIP(I, J, X, Y, false) +#define LOOP_ASSERT_GE(I, X, Y) LOOP_ASSERT_GE_SKIP(I, X, Y, false) +#define LOOP2_ASSERT_GE(I, J, X, Y) LOOP2_ASSERT_GE_SKIP(I, J, X, Y, false) //============================================================================= // OTHER MACROS diff --git a/src/groups/bmq/bmqsys/bmqsys_statmonitor.t.cpp b/src/groups/bmq/bmqsys/bmqsys_statmonitor.t.cpp index 7e92067b8..aab356316 100644 --- a/src/groups/bmq/bmqsys/bmqsys_statmonitor.t.cpp +++ b/src/groups/bmq/bmqsys/bmqsys_statmonitor.t.cpp @@ -256,21 +256,21 @@ static void test1_breathingTest() bmqsys::StatMonitor obj(k_HISTORY_SIZE, bmqtst::TestHelperUtil::allocator()); - ASSERT(obj.isStarted() == false); - ASSERT(obj.statContext() != 0); - ASSERT_SAFE_FAIL(obj.snapshot()); - - ASSERT_SAFE_PASS(obj.uptime()); - ASSERT_SAFE_FAIL(obj.cpuSystem(0)); - ASSERT_SAFE_FAIL(obj.cpuUser(0)); - ASSERT_SAFE_FAIL(obj.cpuAll(0)); - ASSERT_SAFE_FAIL(obj.memResident(0)); - ASSERT_SAFE_FAIL(obj.memVirtual(0)); - ASSERT_SAFE_FAIL(obj.minorPageFaults(0)); - ASSERT_SAFE_FAIL(obj.majorPageFaults(0)); - ASSERT_SAFE_FAIL(obj.numSwaps(0)); - ASSERT_SAFE_FAIL(obj.voluntaryContextSwitches(0)); - ASSERT_SAFE_FAIL(obj.involuntaryContextSwitches(0)); + BMQTST_ASSERT(obj.isStarted() == false); + BMQTST_ASSERT(obj.statContext() != 0); + BMQTST_ASSERT_SAFE_FAIL(obj.snapshot()); + + BMQTST_ASSERT_SAFE_PASS(obj.uptime()); + BMQTST_ASSERT_SAFE_FAIL(obj.cpuSystem(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.cpuUser(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.cpuAll(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.memResident(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.memVirtual(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.minorPageFaults(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.majorPageFaults(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.numSwaps(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.voluntaryContextSwitches(0)); + BMQTST_ASSERT_SAFE_FAIL(obj.involuntaryContextSwitches(0)); } } @@ -310,11 +310,11 @@ static void test2_start() // Given BSLS_ASSERT_OPT(obj.isStarted() == false); - BSLS_ASSERTTEST_ASSERT_SAFE_FAIL(obj.snapshot()); + BMQTST_ASSERT_SAFE_FAIL(obj.snapshot()); BMQTST_ASSERT_EQ(obj.start(errorDesc), 0); BMQTST_ASSERT_EQ(obj.isStarted(), true); - ASSERT_SAFE_PASS(obj.snapshot()); + BMQTST_ASSERT_SAFE_PASS(obj.snapshot()); BMQTST_ASSERT_GE(obj.uptime(), 0); BMQTST_ASSERT_GE(obj.cpuSystem(0), 0.0); @@ -329,7 +329,7 @@ static void test2_start() BMQTST_ASSERT_GE(obj.involuntaryContextSwitches(0), 0LL); // After 'start' was called, calls to 'snapshot' should always succeed - ASSERT_SAFE_PASS(obj.snapshot()); + BMQTST_ASSERT_SAFE_PASS(obj.snapshot()); } static void test3_stop() @@ -366,7 +366,7 @@ static void test3_stop() BSLS_ASSERT_OPT(obj.start(errorDesc) == 0); BSLS_ASSERT_OPT(obj.isStarted() == true); // Ensure accessors are created - ASSERT_SAFE_PASS(obj.snapshot()); + BMQTST_ASSERT_SAFE_PASS(obj.snapshot()); BMQTST_ASSERT_GE(obj.uptime(), 0); BMQTST_ASSERT_GE(obj.cpuSystem(0), 0.0); @@ -397,7 +397,7 @@ static void test3_stop() BMQTST_ASSERT_GE(obj.involuntaryContextSwitches(0), 0LL); // Verify that capacity to take snapshots is disabled - ASSERT_SAFE_FAIL(obj.snapshot()); + BMQTST_ASSERT_SAFE_FAIL(obj.snapshot()); // Should be able to start after stopping BMQTST_ASSERT_EQ(obj.start(errorDesc), 0); diff --git a/src/groups/bmq/bmqsys/bmqsys_time.t.cpp b/src/groups/bmq/bmqsys/bmqsys_time.t.cpp index 32526de3b..72580a26d 100644 --- a/src/groups/bmq/bmqsys/bmqsys_time.t.cpp +++ b/src/groups/bmq/bmqsys/bmqsys_time.t.cpp @@ -143,19 +143,19 @@ static void test2_defaultInitializeShutdown() bmqtst::TestHelper::printTestName("DEFAULT INITIALIZE & SHUTDOWN"); // Initialize the 'Time'. - ASSERT_SAFE_PASS(bmqsys::Time::initialize()); + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::initialize()); // Initialize should be a no-op. - ASSERT_SAFE_PASS(bmqsys::Time::initialize()); + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::initialize()); // Shutdown the Time is a no-op. - ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); // Shutdown the Time. - ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); // Shutdown again should assert - ASSERT_SAFE_FAIL(bmqsys::Time::shutdown()); + BMQTST_ASSERT_SAFE_FAIL(bmqsys::Time::shutdown()); } static void test3_customInitializeShutdown() @@ -179,25 +179,25 @@ static void test3_customInitializeShutdown() TestClock testClock; // Initialize the 'Time'. - ASSERT_SAFE_PASS(bmqsys::Time::initialize( + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::initialize( bdlf::BindUtil::bind(&TestClock::realtimeClock, &testClock), bdlf::BindUtil::bind(&TestClock::monotonicClock, &testClock), bdlf::BindUtil::bind(&TestClock::highResTimer, &testClock))); // Initialize should be a no-op. - ASSERT_SAFE_PASS(bmqsys::Time::initialize( + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::initialize( bdlf::BindUtil::bind(&TestClock::realtimeClock, &testClock), bdlf::BindUtil::bind(&TestClock::monotonicClock, &testClock), bdlf::BindUtil::bind(&TestClock::highResTimer, &testClock))); // Shutdown the Time is a no-op. - ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); // Shutdown the Time. - ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); + BMQTST_ASSERT_SAFE_PASS(bmqsys::Time::shutdown()); // Shutdown again should assert - ASSERT_SAFE_FAIL(bmqsys::Time::shutdown()); + BMQTST_ASSERT_SAFE_FAIL(bmqsys::Time::shutdown()); } // ============================================================================ diff --git a/src/groups/bmq/bmqt/bmqt_messageguid.t.cpp b/src/groups/bmq/bmqt/bmqt_messageguid.t.cpp index 9ec993dbf..5cafa0b31 100644 --- a/src/groups/bmq/bmqt/bmqt_messageguid.t.cpp +++ b/src/groups/bmq/bmqt/bmqt_messageguid.t.cpp @@ -302,13 +302,13 @@ static void test5_comparisonOperators() obj3.fromHex(k_HEX_G2); PV("EQUAL TO OPERATOR CHECK"); - ASSERT(obj1 != obj2); + BMQTST_ASSERT(obj1 != obj2); PV("NOT EQUAL TO OPERATOR CHECK"); - ASSERT(obj2 == obj3); + BMQTST_ASSERT(obj2 == obj3); PV("LESSER THAN OPERATOR CHECK"); - ASSERT(obj1 < obj2); + BMQTST_ASSERT(obj1 < obj2); } // ============================================================================ diff --git a/src/groups/bmq/bmqt/bmqt_queueflags.t.cpp b/src/groups/bmq/bmqt/bmqt_queueflags.t.cpp index a643c070d..bbeb95e78 100644 --- a/src/groups/bmq/bmqt/bmqt_queueflags.t.cpp +++ b/src/groups/bmq/bmqt/bmqt_queueflags.t.cpp @@ -100,8 +100,8 @@ static void test1_breathingTest() flags2 = 0; rc = bmqt::QueueFlagsUtil::fromString(errorOs, &flags2, "READ"); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(bmqt::QueueFlagsUtil::isReader(flags2)); - ASSERT(!bmqt::QueueFlagsUtil::isWriter(flags2)); + BMQTST_ASSERT(bmqt::QueueFlagsUtil::isReader(flags2)); + BMQTST_ASSERT(!bmqt::QueueFlagsUtil::isWriter(flags2)); bsl::string flagsStr("WRITE,INVALID,READ,INVALID2", bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqt/bmqt_queueoptions.t.cpp b/src/groups/bmq/bmqt/bmqt_queueoptions.t.cpp index 3c3347095..b6d6411e0 100644 --- a/src/groups/bmq/bmqt/bmqt_queueoptions.t.cpp +++ b/src/groups/bmq/bmqt/bmqt_queueoptions.t.cpp @@ -132,10 +132,10 @@ static void test2_defaultsTest() PVV("Step 1. Construct default instance and test its values"); bmqt::QueueOptions options(bmqtst::TestHelperUtil::allocator()); - ASSERT(!options.hasMaxUnconfirmedBytes()); - ASSERT(!options.hasMaxUnconfirmedMessages()); - ASSERT(!options.hasConsumerPriority()); - ASSERT(!options.hasSuspendsOnBadHostHealth()); + BMQTST_ASSERT(!options.hasMaxUnconfirmedBytes()); + BMQTST_ASSERT(!options.hasMaxUnconfirmedMessages()); + BMQTST_ASSERT(!options.hasConsumerPriority()); + BMQTST_ASSERT(!options.hasSuspendsOnBadHostHealth()); BMQTST_ASSERT_EQ(options.maxUnconfirmedMessages(), bmqt::QueueOptions::k_DEFAULT_MAX_UNCONFIRMED_MESSAGES); BMQTST_ASSERT_EQ(options.maxUnconfirmedBytes(), @@ -148,13 +148,13 @@ static void test2_defaultsTest() PVV("Step 2. Explicitly override a field with the default value"); options.setMaxUnconfirmedMessages(654321); - ASSERT(options.hasMaxUnconfirmedMessages()); + BMQTST_ASSERT(options.hasMaxUnconfirmedMessages()); BMQTST_ASSERT_EQ(options.maxUnconfirmedMessages(), 654321); - ASSERT(!options.hasMaxUnconfirmedBytes()); + BMQTST_ASSERT(!options.hasMaxUnconfirmedBytes()); PVV("Step 3. Set a different field with a different value"); options.setMaxUnconfirmedBytes(9876); - ASSERT(options.hasMaxUnconfirmedBytes()); + BMQTST_ASSERT(options.hasMaxUnconfirmedBytes()); BMQTST_ASSERT_EQ(options.maxUnconfirmedBytes(), 9876); } @@ -179,25 +179,25 @@ static void test3_mergeTest() PVV("Step 1. Construct two objects"); bmqt::QueueOptions options(bmqtst::TestHelperUtil::allocator()); options.setMaxUnconfirmedMessages(54321).setMaxUnconfirmedBytes(0); - ASSERT(options.hasMaxUnconfirmedMessages()); - ASSERT(options.hasMaxUnconfirmedBytes()); - ASSERT(!options.hasConsumerPriority()); + BMQTST_ASSERT(options.hasMaxUnconfirmedMessages()); + BMQTST_ASSERT(options.hasMaxUnconfirmedBytes()); + BMQTST_ASSERT(!options.hasConsumerPriority()); bmqt::QueueOptions diff(bmqtst::TestHelperUtil::allocator()); diff.setMaxUnconfirmedBytes(7890).setConsumerPriority(42); - ASSERT(!diff.hasMaxUnconfirmedMessages()); - ASSERT(diff.hasMaxUnconfirmedBytes()); - ASSERT(diff.hasConsumerPriority()); + BMQTST_ASSERT(!diff.hasMaxUnconfirmedMessages()); + BMQTST_ASSERT(diff.hasMaxUnconfirmedBytes()); + BMQTST_ASSERT(diff.hasConsumerPriority()); PVV("Step 2. Merge them together"); options.merge(diff); - ASSERT(options.hasMaxUnconfirmedMessages()); + BMQTST_ASSERT(options.hasMaxUnconfirmedMessages()); BMQTST_ASSERT_EQ(options.maxUnconfirmedMessages(), 54321); - ASSERT(options.hasMaxUnconfirmedBytes()); + BMQTST_ASSERT(options.hasMaxUnconfirmedBytes()); BMQTST_ASSERT_EQ(options.maxUnconfirmedBytes(), 7890); - ASSERT(options.hasConsumerPriority()); + BMQTST_ASSERT(options.hasConsumerPriority()); BMQTST_ASSERT_EQ(options.consumerPriority(), 42); - ASSERT(!options.hasSuspendsOnBadHostHealth()); + BMQTST_ASSERT(!options.hasSuspendsOnBadHostHealth()); BMQTST_ASSERT_EQ( options.suspendsOnBadHostHealth(), bmqt::QueueOptions::k_DEFAULT_SUSPENDS_ON_BAD_HOST_HEALTH); @@ -232,11 +232,12 @@ static void test4_subscriptionsTest() .setExpression(expression); bsl::string error; - ASSERT(obj.addOrUpdateSubscription(&error, handle, subscription)); - ASSERT(error.empty()); + BMQTST_ASSERT( + obj.addOrUpdateSubscription(&error, handle, subscription)); + BMQTST_ASSERT(error.empty()); // Assert handle uniqueness - ASSERT(handles.emplace(handle).second); + BMQTST_ASSERT(handles.emplace(handle).second); } // Subscription expression validation @@ -250,8 +251,9 @@ static void test4_subscriptionsTest() subscription.setExpression(expression); bsl::string error; - ASSERT(!obj.addOrUpdateSubscription(&error, handle, subscription)); - ASSERT(!error.empty()); + BMQTST_ASSERT( + !obj.addOrUpdateSubscription(&error, handle, subscription)); + BMQTST_ASSERT(!error.empty()); } bmqt::QueueOptions::SubscriptionsSnapshot snapshot( @@ -264,11 +266,11 @@ static void test4_subscriptionsTest() ++citOut) { bsl::set::const_iterator citIn = handles.find(citOut->first); - ASSERT(citIn != handles.end()); + BMQTST_ASSERT(citIn != handles.end()); BMQTST_ASSERT_EQ(citOut->first.correlationId(), citIn->correlationId()); - ASSERT(citOut->first == *citIn); + BMQTST_ASSERT(citOut->first == *citIn); BMQTST_ASSERT_EQ(msgs, citOut->second.maxUnconfirmedMessages()); BMQTST_ASSERT_EQ(bytes, citOut->second.maxUnconfirmedBytes()); diff --git a/src/groups/bmq/bmqt/bmqt_uri.t.cpp b/src/groups/bmq/bmqt/bmqt_uri.t.cpp index 7ec45681b..7f891f070 100644 --- a/src/groups/bmq/bmqt/bmqt_uri.t.cpp +++ b/src/groups/bmq/bmqt/bmqt_uri.t.cpp @@ -547,7 +547,7 @@ static void test4_initializeShutdown() bmqt::UriParser::shutdown(); // Shutdown again should assert - ASSERT_SAFE_FAIL(bmqt::UriParser::shutdown()); + BMQTST_ASSERT_SAFE_FAIL(bmqt::UriParser::shutdown()); } /// Test Uri print method. @@ -663,7 +663,7 @@ static void test7_testLongUri() BMQTST_ASSERT_EQ(observer.records()[0].fixedFields().severity(), ball::Severity::ERROR); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[0], pathStr.data(), bmqtst::TestHelperUtil::allocator())); diff --git a/src/groups/bmq/bmqtsk/bmqtsk_logcontroller.t.cpp b/src/groups/bmq/bmqtsk/bmqtsk_logcontroller.t.cpp index f37acd651..bf2e79ce7 100644 --- a/src/groups/bmq/bmqtsk/bmqtsk_logcontroller.t.cpp +++ b/src/groups/bmq/bmqtsk/bmqtsk_logcontroller.t.cpp @@ -111,7 +111,7 @@ static void test1_logControllerConfigFromDatum() config.fromDatum(errorDesc, datum); bdld::Datum::destroy(datum, bmqtst::TestHelperUtil::allocator()); - ASSERT_D(errorDesc.str(), errorDesc.str().empty()); + BMQTST_ASSERT_D(errorDesc.str(), errorDesc.str().empty()); BMQTST_ASSERT_EQ(config.fileMaxAgeDays(), 8); BMQTST_ASSERT_EQ(config.rotationBytes(), 2048); diff --git a/src/groups/bmq/bmqtst/bmqtst_scopedlogobserver.t.cpp b/src/groups/bmq/bmqtst/bmqtst_scopedlogobserver.t.cpp index 89a138c78..ef888f6cc 100644 --- a/src/groups/bmq/bmqtst/bmqtst_scopedlogobserver.t.cpp +++ b/src/groups/bmq/bmqtst/bmqtst_scopedlogobserver.t.cpp @@ -56,14 +56,14 @@ static void test1_breathingTest() bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(observer.severityThreshold(), ball::Severity::OFF); - ASSERT(!observer.isEnabled()); - ASSERT(observer.records().empty()); + BMQTST_ASSERT(!observer.isEnabled()); + BMQTST_ASSERT(observer.records().empty()); observer.setSeverityThreshold(ball::Severity::WARN); BMQTST_ASSERT_EQ(observer.severityThreshold(), ball::Severity::WARN); - ASSERT(observer.isEnabled()); - ASSERT(observer.records().empty()); + BMQTST_ASSERT(observer.isEnabled()); + BMQTST_ASSERT(observer.records().empty()); } static void test2_publish() @@ -95,24 +95,24 @@ static void test2_publish() bmqtst::TestHelperUtil::allocator()); BMQTST_ASSERT_EQ(observer.severityThreshold(), ball::Severity::ERROR); - ASSERT(observer.isEnabled()); - ASSERT(observer.records().empty()); + BMQTST_ASSERT(observer.isEnabled()); + BMQTST_ASSERT(observer.records().empty()); record1.fixedFields().setSeverity(ball::Severity::ERROR); observer.publish(record1, context1); BMQTST_ASSERT_EQ(observer.severityThreshold(), ball::Severity::ERROR); - ASSERT(observer.isEnabled()); - ASSERT(observer.records().size() == 1); - ASSERT(observer.records()[0] == record1); + BMQTST_ASSERT(observer.isEnabled()); + BMQTST_ASSERT(observer.records().size() == 1); + BMQTST_ASSERT(observer.records()[0] == record1); record2.fixedFields().setSeverity(ball::Severity::WARN); observer.publish(record2, context2); BMQTST_ASSERT_EQ(observer.severityThreshold(), ball::Severity::ERROR); - ASSERT(observer.isEnabled()); - ASSERT(observer.records().size() == 1); - ASSERT(observer.records()[0] == record1); + BMQTST_ASSERT(observer.isEnabled()); + BMQTST_ASSERT(observer.records().size() == 1); + BMQTST_ASSERT(observer.records()[0] == record1); } static void test3_recordMessageMatch() @@ -198,7 +198,7 @@ static void test4_usageExample() BALL_LOG_ERROR << "MySampleError"; BMQTST_ASSERT_EQ(observer.records().size(), 1U); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[0], ".*Sample.*", bmqtst::TestHelperUtil::allocator())); diff --git a/src/groups/bmq/bmqtst/bmqtst_testhelper.h b/src/groups/bmq/bmqtst/bmqtst_testhelper.h index 6146c20fb..40b76b7b6 100644 --- a/src/groups/bmq/bmqtst/bmqtst_testhelper.h +++ b/src/groups/bmq/bmqtst/bmqtst_testhelper.h @@ -66,7 +66,7 @@ ///---------- // The following macros are provided to perform checks: //: o Comparison macros -//: o !ASSERT(X)!: 'X' +//: o !BMQTST_ASSERT(X)!: 'X' //: o !BMQTST_ASSERT_EQ(X, Y)!: 'X == Y' //: o !BMQTST_ASSERT_NE(X, Y)!: 'X != Y' //: o !BMQTST_ASSERT_LT(X, Y)!: 'X < Y' @@ -82,12 +82,12 @@ // evaluated upfront). // //: o Negative testing macros -//: o !ASSERT_SAFE_PASS(E)!: no assertion in safe mode is expected -//: o !ASSERT_SAFE_FAIL(E)!: an assertion in safe mode is expected -//: o !ASSERT_PASS(E)!: no assertion in default mode is expected -//: o !ASSERT_FAIL(E)!: an assertion in default mode is expected -//: o !ASSERT_OPT_PASS(E)!: no assertion in opt mode is expected -//: o !ASSERT_OPT_FAIL(E)!: an assertion in opt mode is expected +//: o !BMQTST_ASSERT_SAFE_PASS(E)!: no assertion in safe mode is expected +//: o !BMQTST_ASSERT_SAFE_FAIL(E)!: an assertion in safe mode is expected +//: o !BMQTST_ASSERT_PASS(E)!: no assertion in default mode is expected +//: o !BMQTST_ASSERT_FAIL(E)!: an assertion in default mode is expected +//: o !BMQTST_ASSERT_OPT_PASS(E)!: no assertion in opt mode is expected +//: o !BMQTST_ASSERT_OPT_FAIL(E)!: an assertion in opt mode is expected // /// PRINTING ///-------- @@ -201,7 +201,7 @@ // bmqtst::TestHelper::printTestName("BREATHING TEST"); // // grppkg::MyComponent myComponent("name", TestHelperUtil::allocator()); -// ASSERT(myComponent.isValid()); +// BMQTST_ASSERT(myComponent.isValid()); // BMQTST_ASSERT_EQ(myComponent.name(), "name"); // } // @@ -260,7 +260,7 @@ // BMQTST_TEST_F(FunctionalTest, breathingTest) // { // grppkg::MyComponent myComponent("name", config, mock, -// TestHelperUtil::allocator()); ASSERT(myComponent.isValid()); +// TestHelperUtil::allocator()); BMQTST_ASSERT(myComponent.isValid()); // BMQTST_ASSERT_EQ(myComponent.name(), "name"); // } // @@ -359,6 +359,9 @@ } \ } +// An alias to the required BDE ASSERT macro +#define BMQTST_ASSERT(X) ASSERT(X) + #define BMQTST_ASSERT_EQ(X, Y) \ { \ _assertCompareEquals("", X, Y, #X, #Y, __FILE__, __LINE__); \ @@ -386,7 +389,7 @@ // '_D' variants, allowing to specify a 'description' that will be printed in // case of failure. -#define ASSERT_D(D, X) \ +#define BMQTST_ASSERT_D(D, X) \ { \ bdlsb::MemOutStreamBuf _buf(bmqtst::TestHelperUtil::allocator()); \ bsl::ostream _os(&_buf); \ @@ -481,12 +484,12 @@ // ============================================================================ // NEGATIVE-TEST MACROS ABBREVIATIONS // ---------------------------------------------------------------------------- -#define ASSERT_SAFE_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_PASS(EXPR) -#define ASSERT_SAFE_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_FAIL(EXPR) -#define ASSERT_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_PASS(EXPR) -#define ASSERT_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_FAIL(EXPR) -#define ASSERT_OPT_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_OPT_PASS(EXPR) -#define ASSERT_OPT_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_OPT_FAIL(EXPR) +#define BMQTST_ASSERT_SAFE_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_PASS(EXPR) +#define BMQTST_ASSERT_SAFE_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_FAIL(EXPR) +#define BMQTST_ASSERT_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_PASS(EXPR) +#define BMQTST_ASSERT_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_FAIL(EXPR) +#define BMQTST_ASSERT_OPT_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_OPT_PASS(EXPR) +#define BMQTST_ASSERT_OPT_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_OPT_FAIL(EXPR) // ============================================================================ // PRINT MACROS diff --git a/src/groups/bmq/bmqu/bmqu_atomicvalidator.t.cpp b/src/groups/bmq/bmqu/bmqu_atomicvalidator.t.cpp index 7c40545ed..4b28e72a0 100644 --- a/src/groups/bmq/bmqu/bmqu_atomicvalidator.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_atomicvalidator.t.cpp @@ -110,21 +110,21 @@ static void test1_breathingTest() bmqu::AtomicValidator obj; // Acquire - ASSERT(obj.acquire()); + BMQTST_ASSERT(obj.acquire()); // Release and acquire obj.release(); - ASSERT(obj.acquire()); + BMQTST_ASSERT(obj.acquire()); // Release and invalidate -> cannot acquire - ASSERT_PASS(obj.release()); - ASSERT_PASS(obj.invalidate()); - ASSERT(!obj.acquire()); + BMQTST_ASSERT_PASS(obj.release()); + BMQTST_ASSERT_PASS(obj.invalidate()); + BMQTST_ASSERT(!obj.acquire()); // Reset -> can acquire again - ASSERT_PASS(obj.reset()); - ASSERT(obj.acquire()); - ASSERT_PASS(obj.release()) + BMQTST_ASSERT_PASS(obj.reset()); + BMQTST_ASSERT(obj.acquire()); + BMQTST_ASSERT_PASS(obj.release()) } { @@ -133,9 +133,9 @@ static void test1_breathingTest() PVV("- VALIDATOR NULL"); { bmqu::AtomicValidatorGuard obj0(0); - ASSERT(obj0.isValid()); - ASSERT(obj0.release() == 0); - ASSERT(obj0.isValid()); + BMQTST_ASSERT(obj0.isValid()); + BMQTST_ASSERT(obj0.release() == 0); + BMQTST_ASSERT(obj0.isValid()); } bmqu::AtomicValidator validator; @@ -144,13 +144,13 @@ static void test1_breathingTest() { bmqu::AtomicValidatorGuard obj(&validator); // ACQUIRE #1 - ASSERT(obj.isValid()); + BMQTST_ASSERT(obj.isValid()); bmqu::AtomicValidator* releaseRC = obj.release(); - ASSERT(releaseRC == &validator); - ASSERT(obj.isValid()); + BMQTST_ASSERT(releaseRC == &validator); + BMQTST_ASSERT(obj.isValid()); - ASSERT_PASS(releaseRC->release()); // RELEASE #1 + BMQTST_ASSERT_PASS(releaseRC->release()); // RELEASE #1 } PVV("- VALIDATOR INVALID"); @@ -159,9 +159,9 @@ static void test1_breathingTest() bmqu::AtomicValidatorGuard obj(&validator); - ASSERT(!obj.isValid()); - ASSERT(obj.release() == 0); - ASSERT(obj.isValid()); + BMQTST_ASSERT(!obj.isValid()); + BMQTST_ASSERT(obj.release() == 0); + BMQTST_ASSERT(obj.isValid()); } PVV("- VALIDATOR VALID, PRE-ACQUIRED"); @@ -170,19 +170,19 @@ static void test1_breathingTest() validator.acquire(); // ACQUIRE #2 bmqu::AtomicValidatorGuard obj(&validator, 1); // no acquisition - ASSERT(obj.isValid()); + BMQTST_ASSERT(obj.isValid()); // obj.~AtomicValidatorGuard() // RELEASE #2 } - ASSERT_SAFE_FAIL(validator.release()); + BMQTST_ASSERT_SAFE_FAIL(validator.release()); // Verifies release occurred in the destructor above PVV("- VALIDATOR VALID, NOT PRE-ACQUIRED"); { bmqu::AtomicValidatorGuard obj(&validator, 0); // ACQUIRE #3 - ASSERT(obj.isValid()); + BMQTST_ASSERT(obj.isValid()); // obj.~AtomicValidatorGuard() // RELEASE #3 } - ASSERT_SAFE_FAIL(validator.release()); + BMQTST_ASSERT_SAFE_FAIL(validator.release()); // Verifies release occurred in the destructor above } } @@ -245,12 +245,12 @@ static void test2_atomicValidatorMultiThreaded() BMQTST_ASSERT_EQ(numRunningThreads, 0); // Any further 'acquire' fails - ASSERT(!validator.acquire()); + BMQTST_ASSERT(!validator.acquire()); // After we reset, acquire starts working again validator.reset(); - ASSERT(validator.acquire()); + BMQTST_ASSERT(validator.acquire()); } //============================================================================= diff --git a/src/groups/bmq/bmqu/bmqu_blob.t.cpp b/src/groups/bmq/bmqu/bmqu_blob.t.cpp index 1f0734466..9f9abb406 100644 --- a/src/groups/bmq/bmqu/bmqu_blob.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_blob.t.cpp @@ -1440,7 +1440,7 @@ static void test17_getAlignedSection() if (test.d_res == Test::e_NULL) { PVVV("null result") - ASSERT_D("line " << test.d_line, !resSafe); + BMQTST_ASSERT_D("line " << test.d_line, !resSafe); continue; } @@ -1559,7 +1559,7 @@ static void test18_getAlignedObject() if (!test.d_resData) { PVVV("null result") - ASSERT_D("line " << test.d_line, !resSafe); + BMQTST_ASSERT_D("line " << test.d_line, !resSafe); continue; } diff --git a/src/groups/bmq/bmqu/bmqu_blobiterator.t.cpp b/src/groups/bmq/bmqu/bmqu_blobiterator.t.cpp index d7be75e84..f78a34d8e 100644 --- a/src/groups/bmq/bmqu/bmqu_blobiterator.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_blobiterator.t.cpp @@ -72,7 +72,7 @@ static void test1_breathingTest() BMQTST_ASSERT_EQ(true, obj.atEnd()); BMQTST_ASSERT_EQ(0, obj.remaining()); BMQTST_ASSERT_EQ(bmqu::BlobPosition(), obj.position()); - ASSERT(!obj.blob()); + BMQTST_ASSERT(!obj.blob()); } { diff --git a/src/groups/bmq/bmqu/bmqu_blobobjectproxy.t.cpp b/src/groups/bmq/bmqu/bmqu_blobobjectproxy.t.cpp index 6350e40ba..d46464158 100644 --- a/src/groups/bmq/bmqu/bmqu_blobobjectproxy.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_blobobjectproxy.t.cpp @@ -122,11 +122,11 @@ static void test1_breathingTest() bdlbb::BlobUtil::append(&blob, ptr, sizeof(hdr)); bmqu::BlobObjectProxy pxy(&blob); - ASSERT(pxy.isInBlob()); + BMQTST_ASSERT(pxy.isInBlob()); BMQTST_ASSERT_EQ(pxy->d_member1, 1u); BMQTST_ASSERT_EQ(pxy->d_member2, 2u); - ASSERT(pxy.hasMember(&TestHeader::d_length)); - ASSERT(pxy.hasMember(&TestHeader::d_member2)); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_length)); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_member2)); } { @@ -137,11 +137,11 @@ static void test1_breathingTest() bdlbb::BlobUtil::append(&blob, ptr, sizeof(hdr)); bmqu::BlobObjectProxy pxy(&blob, 9); - ASSERT(!pxy.isInBlob()); + BMQTST_ASSERT(!pxy.isInBlob()); BMQTST_ASSERT_EQ(pxy->d_member1, 1u); BMQTST_ASSERT_EQ(pxy->d_member2, 0u); - ASSERT(pxy.hasMember(&TestHeader::d_member1)); - ASSERT(!pxy.hasMember(&TestHeader::d_member2)); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_member1)); + BMQTST_ASSERT(!pxy.hasMember(&TestHeader::d_member2)); } { @@ -152,16 +152,16 @@ static void test1_breathingTest() bdlbb::BlobUtil::append(&blob, ptr, sizeof(hdr)); bmqu::BlobObjectProxy pxy(&blob, -1); - ASSERT(pxy.isInBlob()); + BMQTST_ASSERT(pxy.isInBlob()); pxy.resize(128); - ASSERT(pxy.isInBlob()); - ASSERT(pxy.hasMember(&TestHeader::d_member2)); + BMQTST_ASSERT(pxy.isInBlob()); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_member2)); pxy.resize(8); - ASSERT(!pxy.isInBlob()); - ASSERT(pxy.hasMember(&TestHeader::d_member1)); - ASSERT(!pxy.hasMember(&TestHeader::d_member2)); + BMQTST_ASSERT(!pxy.isInBlob()); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_member1)); + BMQTST_ASSERT(!pxy.hasMember(&TestHeader::d_member2)); BMQTST_ASSERT_EQ(pxy->d_member1, 1u); } @@ -174,30 +174,30 @@ static void test1_breathingTest() // Modify without 'write' mode bmqu::BlobObjectProxy pxy(&blob, 8); - ASSERT(!pxy.isInBlob()); - ASSERT(pxy.hasMember(&TestHeader::d_member1)); - ASSERT(!pxy.hasMember(&TestHeader::d_member2)); + BMQTST_ASSERT(!pxy.isInBlob()); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_member1)); + BMQTST_ASSERT(!pxy.hasMember(&TestHeader::d_member2)); pxy->reset(8, 11, 22); pxy.reset(); - ASSERT(!pxy.isSet()); + BMQTST_ASSERT(!pxy.isSet()); // Modify with 'write' mode pxy.reset(&blob, 8, true, true); - ASSERT(pxy.isSet()); - ASSERT(!pxy.isInBlob()); + BMQTST_ASSERT(pxy.isSet()); + BMQTST_ASSERT(!pxy.isInBlob()); BMQTST_ASSERT_EQ(size_t(pxy->d_length), sizeof(hdr)); BMQTST_ASSERT_EQ(pxy->d_member1, 1u); BMQTST_ASSERT_EQ(pxy->d_member2, 0u); pxy->reset(17, 11, 22); pxy.reset(); - ASSERT(!pxy.isSet()); + BMQTST_ASSERT(!pxy.isSet()); // Verify that only the proxied fields were written out pxy.reset(&blob); - ASSERT(pxy.isSet()); - ASSERT(pxy.isInBlob()); + BMQTST_ASSERT(pxy.isSet()); + BMQTST_ASSERT(pxy.isInBlob()); BMQTST_ASSERT_EQ(pxy->d_length, 17); BMQTST_ASSERT_EQ(pxy->d_member1, 11u); BMQTST_ASSERT_EQ(pxy->d_member2, 2u); @@ -325,10 +325,10 @@ static void test2_usageExample1() // contained at the beginning of 'blob' and access its fields. //.. bmqu::BlobObjectProxy pxy(&blob); - ASSERT(pxy.isSet()); - ASSERT(pxy->d_length == sizeof(hdr)); - ASSERT(pxy->d_member1 == 1); - ASSERT(pxy->d_member2 == 2); + BMQTST_ASSERT(pxy.isSet()); + BMQTST_ASSERT(pxy->d_length == sizeof(hdr)); + BMQTST_ASSERT(pxy->d_member1 == 1); + BMQTST_ASSERT(pxy->d_member2 == 2); //.. // Now, suppose we know that our blob only contains up to 'd_member1' of // our 'TestHeader'. We can reset (or construct) a 'BlobObjectProxy' with @@ -339,23 +339,23 @@ static void test2_usageExample1() // allow us to read up to 'd_member1' of our structure. //.. pxy.reset(&blob, 8); - ASSERT(pxy->d_length == sizeof(hdr)); - ASSERT(pxy->d_member1 == 1); + BMQTST_ASSERT(pxy->d_length == sizeof(hdr)); + BMQTST_ASSERT(pxy->d_member1 == 1); //.. // When configured this way, the 'BlobObjectProxy' will zero out the // remaining fields in its internal buffer (the 'blob' is not modified in // any way). //.. - ASSERT(pxy->d_member2 == 0); + BMQTST_ASSERT(pxy->d_member2 == 0); //.. // In most cases, having the extraneous members return a value of '0' // should be enough, however in some cases it might be desirable to // explicitly check whether a field is actually present in the proxied // object. This can be accomplished using 'hasMember' as follows: //.. - ASSERT(pxy.hasMember(&TestHeader::d_length)); - ASSERT(pxy.hasMember(&TestHeader::d_member1)); - ASSERT(!pxy.hasMember(&TestHeader::d_member2)); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_length)); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_member1)); + BMQTST_ASSERT(!pxy.hasMember(&TestHeader::d_member2)); //.. // Finally, we will demonstrate the proper way of reading a blob object // whose length is one of its members and can't be known until the object @@ -372,7 +372,7 @@ static void test2_usageExample1() // but we still need to ensure that 'd_length' is one of the proxied fields // (for example, if the blob was only 2 bytes long). //.. - ASSERT(pxy.hasMember(&TestHeader::d_length)); + BMQTST_ASSERT(pxy.hasMember(&TestHeader::d_length)); //.. // Now we can safely access 'd_length' in our object, and update the // proxied object's size appropriately. @@ -445,7 +445,7 @@ static void test3_usageExample2() hdr.d_member1 = 17; hdr.d_member2 = 32; bdlbb::BlobUtil::append(&expectedBlob, ptr, sizeof(hdr)); - ASSERT(!bdlbb::BlobUtil::compare(blob, expectedBlob)); + BMQTST_ASSERT(!bdlbb::BlobUtil::compare(blob, expectedBlob)); //.. } diff --git a/src/groups/bmq/bmqu/bmqu_memoutstream.t.cpp b/src/groups/bmq/bmqu/bmqu_memoutstream.t.cpp index 092a511d7..45d1e4316 100644 --- a/src/groups/bmq/bmqu/bmqu_memoutstream.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_memoutstream.t.cpp @@ -62,7 +62,7 @@ static void test1_breathingTest() { PV("Test reset"); obj.reset(); - ASSERT(obj.str().isEmpty()); + BMQTST_ASSERT(obj.str().isEmpty()); BMQTST_ASSERT_EQ(alloc.numBlocksInUse(), 0); BMQTST_ASSERT_EQ(obj.isEmpty(), true); BMQTST_ASSERT_EQ(obj.length(), static_cast(0)); diff --git a/src/groups/bmq/bmqu/bmqu_operationchain.t.cpp b/src/groups/bmq/bmqu/bmqu_operationchain.t.cpp index 1e705a7e5..535fc9b2a 100644 --- a/src/groups/bmq/bmqu/bmqu_operationchain.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_operationchain.t.cpp @@ -885,7 +885,7 @@ static void test8_chain_popBack(bdlmt::ThreadPool* threadPool) // try extract link int rc = chain.popBack(); - ASSERT(rc != 0); + BMQTST_ASSERT(rc != 0); // the operation had no effect BMQTST_ASSERT_EQ(chain.numLinks(), 0u); @@ -896,7 +896,7 @@ static void test8_chain_popBack(bdlmt::ThreadPool* threadPool) link.insert(NullOperation()); rc = chain.popBack(&link); - ASSERT(rc != 0); + BMQTST_ASSERT(rc != 0); // the operation had no effect BMQTST_ASSERT_EQ(chain.numLinks(), 0u); @@ -930,7 +930,7 @@ static void test8_chain_popBack(bdlmt::ThreadPool* threadPool) // try extract link int rc = chain.popBack(); - ASSERT(rc != 0); + BMQTST_ASSERT(rc != 0); // link not removed from the chain BMQTST_ASSERT_EQ(chain.numLinks(), 1u); @@ -941,7 +941,7 @@ static void test8_chain_popBack(bdlmt::ThreadPool* threadPool) bmqu::OperationChainLink link(chain.allocator()); link.insert(NullOperation()); rc = chain.popBack(&link); - ASSERT(rc != 0); + BMQTST_ASSERT(rc != 0); // link not removed from the chain BMQTST_ASSERT_EQ(chain.numLinks(), 1u); diff --git a/src/groups/bmq/bmqu/bmqu_printutil.t.cpp b/src/groups/bmq/bmqu/bmqu_printutil.t.cpp index b2dc14e5c..bbc45d512 100644 --- a/src/groups/bmq/bmqu/bmqu_printutil.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_printutil.t.cpp @@ -110,9 +110,9 @@ static void test1_prettyNumberInt64() PV("Ensure assertion when group size <= 0"); { - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( bmqu::PrintUtil::prettyNumber(bsl::cout, 123, 0, ',')); - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( bmqu::PrintUtil::prettyNumber(bsl::cout, 123, -2, ',')); } } @@ -195,9 +195,9 @@ static void test2_prettyNumberDouble() PV("Ensure assertion when group size <= 0"); { - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( bmqu::PrintUtil::prettyNumber(bsl::cout, 123.0, 0, 0, ',')); - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( bmqu::PrintUtil::prettyNumber(bsl::cout, 123.0, 0, -2, ',')); } } diff --git a/src/groups/bmq/bmqu/bmqu_sharedresource.t.cpp b/src/groups/bmq/bmqu/bmqu_sharedresource.t.cpp index e93db50c2..5586fc2b5 100644 --- a/src/groups/bmq/bmqu/bmqu_sharedresource.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_sharedresource.t.cpp @@ -162,41 +162,41 @@ static void test1_resource_creators() // 1. empty resource (default-constructed) { // no memory allocated yet - ASSERT(alloc.numBytesInUse() == 0); + BMQTST_ASSERT(alloc.numBytesInUse() == 0); { // create shared resource bmqu::SharedResource sharedResource(&alloc); // no memory allocated still - ASSERT(alloc.numBytesInUse() == 0); + BMQTST_ASSERT(alloc.numBytesInUse() == 0); // the resource is invalid - ASSERT(!sharedResource.isValid()); + BMQTST_ASSERT(!sharedResource.isValid()); } } // 2. empty resource (nullptr-constructed) { // no memory allocated yet - ASSERT(alloc.numBytesInUse() == 0); + BMQTST_ASSERT(alloc.numBytesInUse() == 0); { // create shared resource bmqu::SharedResource sharedResource(bsl::nullptr_t(), &alloc); // no memory allocated still - ASSERT(alloc.numBytesInUse() == 0); + BMQTST_ASSERT(alloc.numBytesInUse() == 0); // the resource is invalid - ASSERT(!sharedResource.isValid()); + BMQTST_ASSERT(!sharedResource.isValid()); } } // 3. non-empty resource { // no memory allocated yet - ASSERT(alloc.numBytesInUse() == 0); + BMQTST_ASSERT(alloc.numBytesInUse() == 0); { int resource = 42; @@ -205,17 +205,17 @@ static void test1_resource_creators() bmqu::SharedResource sharedResource(&resource, &alloc); // memory allocated - ASSERT(alloc.numBytesInUse() != 0); + BMQTST_ASSERT(alloc.numBytesInUse() != 0); // the resource is valid - ASSERT(sharedResource.isValid() && - *sharedResource.acquire() == 42); + BMQTST_ASSERT(sharedResource.isValid() && + *sharedResource.acquire() == 42); // destroy the shared resource } // memory freed - ASSERT(alloc.numBytesInUse() == 0); + BMQTST_ASSERT(alloc.numBytesInUse() == 0); } // 4. exception safety @@ -249,7 +249,7 @@ static void test1_resource_creators() // allocate a resource int* resource = new (resourceFactory) int(42); - ASSERT(resourceFactory.numBytesInUse() != 0); + BMQTST_ASSERT(resourceFactory.numBytesInUse() != 0); // try to create a 'bmqu::SharedResource', which should fail bool exceptionThrown = false; @@ -264,10 +264,10 @@ static void test1_resource_creators() } // creation failed - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); // resource freed using its factory - ASSERT(resourceFactory.numBytesInUse() == 0); + BMQTST_ASSERT(resourceFactory.numBytesInUse() == 0); } } @@ -302,10 +302,11 @@ static void test2_resource_acquire() // 1. acquire before invalidating { // the resource can be acquired - ASSERT(sharedResource.acquire() && *sharedResource.acquire() == 42); + BMQTST_ASSERT(sharedResource.acquire() && + *sharedResource.acquire() == 42); - ASSERT(sharedResource.acquireWeak().lock() && - *sharedResource.acquireWeak().lock() == 42); + BMQTST_ASSERT(sharedResource.acquireWeak().lock() && + *sharedResource.acquireWeak().lock() == 42); } // 2. acquire while invalidating @@ -326,10 +327,11 @@ static void test2_resource_acquire() bslmt::ThreadUtil::sleep(bsls::TimeInterval(0.2)); // the resource can still be acquired - ASSERT(sharedResource.acquire() && *sharedResource.acquire() == 42); + BMQTST_ASSERT(sharedResource.acquire() && + *sharedResource.acquire() == 42); - ASSERT(sharedResource.acquireWeak().lock() && - *sharedResource.acquireWeak().lock() == 42); + BMQTST_ASSERT(sharedResource.acquireWeak().lock() && + *sharedResource.acquireWeak().lock() == 42); // release the resource resourceSP.reset(); @@ -343,8 +345,8 @@ static void test2_resource_acquire() // NOTE: The resource has been invalidated at this point. // the resource can not be acquired - ASSERT(!sharedResource.acquire()); - ASSERT(!sharedResource.acquireWeak().lock()); + BMQTST_ASSERT(!sharedResource.acquire()); + BMQTST_ASSERT(!sharedResource.acquireWeak().lock()); } } @@ -379,7 +381,7 @@ static void test3_resource_invalidate() sharedResource.invalidate(); // the resource was invalidated - ASSERT(!sharedResource.isValid()); + BMQTST_ASSERT(!sharedResource.isValid()); } // 2. invalidate used resource @@ -394,7 +396,7 @@ static void test3_resource_invalidate() // allocate the resource bslma::TestAllocator resourceFactory; Sleep* sleep = new (resourceFactory) Sleep(); - ASSERT(resourceFactory.numBytesInUse() != 0); + BMQTST_ASSERT(resourceFactory.numBytesInUse() != 0); // create shared resource bmqu::SharedResource sharedResource( @@ -419,10 +421,10 @@ static void test3_resource_invalidate() BSLS_ASSERT(resourceWP.expired()); // the resource was invalidated - ASSERT(!sharedResource.isValid()); + BMQTST_ASSERT(!sharedResource.isValid()); // the resource was freed using the supplied deleter - ASSERT(resourceFactory.numBytesInUse() == 0); + BMQTST_ASSERT(resourceFactory.numBytesInUse() == 0); } } @@ -482,7 +484,7 @@ static void test4_resource_reset() sharedResource.reset(); // memory freed - ASSERT(alloc.numBytesInUse() == 0); + BMQTST_ASSERT(alloc.numBytesInUse() == 0); // resource is empty BSLS_ASSERT(!sharedResource.isValid()); @@ -553,8 +555,8 @@ static void test4_resource_reset() // allocate resources int* resource1 = new (resourceFactory1) int(42); int* resource2 = new (resourceFactory2) int(42); - ASSERT(resourceFactory1.numBytesInUse() != 0); - ASSERT(resourceFactory2.numBytesInUse() != 0); + BMQTST_ASSERT(resourceFactory1.numBytesInUse() != 0); + BMQTST_ASSERT(resourceFactory2.numBytesInUse() != 0); // create a 'bmqu::SharedResource' bmqu::SharedResource sharedResource( @@ -572,14 +574,14 @@ static void test4_resource_reset() } // creation failed - ASSERT(exceptionThrown); + BMQTST_ASSERT(exceptionThrown); // both resources freed using their respective factories - ASSERT(resourceFactory1.numBytesInUse() == 0); - ASSERT(resourceFactory2.numBytesInUse() == 0); + BMQTST_ASSERT(resourceFactory1.numBytesInUse() == 0); + BMQTST_ASSERT(resourceFactory2.numBytesInUse() == 0); // the 'bmqu::SharedResource' is left invalid - ASSERT(!sharedResource.isValid()); + BMQTST_ASSERT(!sharedResource.isValid()); } } @@ -604,7 +606,7 @@ static void test5_factoryDeleter() int* resource = new (factory) int(42); // memory allocated - ASSERT(factory.numBytesInUse() != 0); + BMQTST_ASSERT(factory.numBytesInUse() != 0); // create deleter and free resource bmqu::SharedResourceFactoryDeleter deleter( @@ -612,7 +614,7 @@ static void test5_factoryDeleter() deleter(resource); // memory freed - ASSERT(factory.numBytesInUse() == 0); + BMQTST_ASSERT(factory.numBytesInUse() == 0); } // ============================================================================ diff --git a/src/groups/bmq/bmqu/bmqu_throttledaction.t.cpp b/src/groups/bmq/bmqu/bmqu_throttledaction.t.cpp index ff3a20670..153cb09a9 100644 --- a/src/groups/bmq/bmqu/bmqu_throttledaction.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_throttledaction.t.cpp @@ -331,7 +331,7 @@ static void test3_throttleWithDefaultReset() if (bmqtst::TestHelperUtil::verbosityLevel() >= 1) { BMQTST_ASSERT_EQ(logObserver.records().size(), 1U); PV("Logged during reset: " << logObserver.records()[0]); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( logObserver.records()[0], "'obj'.*2", bmqtst::TestHelperUtil::allocator())); diff --git a/src/groups/bmq/bmqu/bmqu_tlsbool.t.cpp b/src/groups/bmq/bmqu/bmqu_tlsbool.t.cpp index 0f0811023..dbd12c824 100644 --- a/src/groups/bmq/bmqu/bmqu_tlsbool.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_tlsbool.t.cpp @@ -217,8 +217,8 @@ static void test2_isValid() // ASSERT, so skip that check on those platforms. { // Constructor without a value, should assert - ASSERT_OPT_FAIL(bmqu::TLSBool obj); - ASSERT_OPT_FAIL(bmqu::TLSBool obj(true)); + BMQTST_ASSERT_OPT_FAIL(bmqu::TLSBool obj); + BMQTST_ASSERT_OPT_FAIL(bmqu::TLSBool obj(true)); } #endif @@ -236,7 +236,7 @@ static void test2_isValid() BMQTST_ASSERT_EQ(obj.getDefault(true), true); if (!obj) { - ASSERT(false && "operator bool should have said 'true'"); + BMQTST_ASSERT(false && "operator bool should have said 'true'"); } } @@ -254,7 +254,7 @@ static void test2_isValid() BMQTST_ASSERT_EQ(obj.getDefault(true), true); if (obj) { - ASSERT(false && "operator bool should have said 'false'"); + BMQTST_ASSERT(false && "operator bool should have said 'false'"); } } diff --git a/src/groups/bmq/bmqu/bmqu_weakmemfn.t.cpp b/src/groups/bmq/bmqu/bmqu_weakmemfn.t.cpp index 7a7f236bf..1ef136ed7 100644 --- a/src/groups/bmq/bmqu/bmqu_weakmemfn.t.cpp +++ b/src/groups/bmq/bmqu/bmqu_weakmemfn.t.cpp @@ -93,34 +93,38 @@ static void test1_weakMemFn_resultType() typedef Empty C; // void -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same, - bmqu::WeakMemFn::ResultType>::value)); + BMQTST_ASSERT( + (bsl::is_same, + bmqu::WeakMemFn::ResultType>::value)); // R -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same, - bmqu::WeakMemFn::ResultType>::value)); + BMQTST_ASSERT( + (bsl::is_same, + bmqu::WeakMemFn::ResultType>::value)); // const R -> bmqu::WeakMemFnResult - ASSERT( + BMQTST_ASSERT( (bsl::is_same, bmqu::WeakMemFn::ResultType>::value)); // R& -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same, - bmqu::WeakMemFn::ResultType>::value)); + BMQTST_ASSERT( + (bsl::is_same, + bmqu::WeakMemFn::ResultType>::value)); // const R& -> bmqu::WeakMemFnResult - ASSERT( + BMQTST_ASSERT( (bsl::is_same, bmqu::WeakMemFn::ResultType>::value)); // volatile R& -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same< - bmqu::WeakMemFnResult, - bmqu::WeakMemFn::ResultType>::value)); + BMQTST_ASSERT((bsl::is_same< + bmqu::WeakMemFnResult, + bmqu::WeakMemFn::ResultType>::value)); // const volatile R& -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same< + BMQTST_ASSERT( + (bsl::is_same< bmqu::WeakMemFnResult, bmqu::WeakMemFn::ResultType>::value)); } @@ -220,39 +224,42 @@ static void test3_weakMemFnInstance_resultType() typedef Empty C; // void -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same< + BMQTST_ASSERT( + (bsl::is_same< bmqu::WeakMemFnResult, bmqu::WeakMemFnInstance::ResultType>::value)); // R -> bmqu::WeakMemFnResult - ASSERT(( + BMQTST_ASSERT(( bsl::is_same, bmqu::WeakMemFnInstance::ResultType>::value)); // const R -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same< + BMQTST_ASSERT( + (bsl::is_same< bmqu::WeakMemFnResult, bmqu::WeakMemFnInstance::ResultType>::value)); // R& -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same< - bmqu::WeakMemFnResult, - bmqu::WeakMemFnInstance::ResultType>::value)); + BMQTST_ASSERT((bsl::is_same< + bmqu::WeakMemFnResult, + bmqu::WeakMemFnInstance::ResultType>::value)); // const R& -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same< + BMQTST_ASSERT( + (bsl::is_same< bmqu::WeakMemFnResult, bmqu::WeakMemFnInstance::ResultType>::value)); // volatile R& -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same, - bmqu::WeakMemFnInstance::ResultType>::value)); + BMQTST_ASSERT((bsl::is_same, + bmqu::WeakMemFnInstance::ResultType>::value)); // const volatile R& -> bmqu::WeakMemFnResult - ASSERT((bsl::is_same, - bmqu::WeakMemFnInstance::ResultType>::value)); + BMQTST_ASSERT((bsl::is_same, + bmqu::WeakMemFnInstance::ResultType>::value)); } static void test4_weakMemFnInstance_callOperator() diff --git a/src/groups/bmq/bmqvt/bmqvt_propertybag.h b/src/groups/bmq/bmqvt/bmqvt_propertybag.h index 34e7fb2b6..7bee07177 100644 --- a/src/groups/bmq/bmqvt/bmqvt_propertybag.h +++ b/src/groups/bmq/bmqvt/bmqvt_propertybag.h @@ -44,7 +44,7 @@ // .. // int value; // bag.load(&value, "myIntValue"); -// ASSERT(value == 5); +// BMQTST_ASSERT(value == 5); //.. // BDE diff --git a/src/groups/bmq/bmqvt/bmqvt_propertybag.t.cpp b/src/groups/bmq/bmqvt/bmqvt_propertybag.t.cpp index 1ce3a80cb..8e70194bc 100644 --- a/src/groups/bmq/bmqvt/bmqvt_propertybag.t.cpp +++ b/src/groups/bmq/bmqvt/bmqvt_propertybag.t.cpp @@ -46,7 +46,7 @@ void checkValue(int line, bool ret = bag.load(&bagValue, key); if (!ret) { - ASSERT_D("line " << line, false); + BMQTST_ASSERT_D("line " << line, false); return; // RETURN } @@ -65,13 +65,13 @@ static void checkValueSp(int line, bool ret = bag.load(&bagValue, key); if (!ret) { - ASSERT_D("line " << line, false); + BMQTST_ASSERT_D("line " << line, false); return; // RETURN } if (!bagValue->isPtr()) { PRINT(*bagValue); - ASSERT_D("line " << line << ": Not a pointer", false); + BMQTST_ASSERT_D("line " << line << ": Not a pointer", false); return; // RETURN } @@ -115,38 +115,38 @@ static void test1_breathingTest() checkValue(L_, obj, "intVal", 3); // Check accessing an unknown property - ASSERT(!obj.load(static_cast(0), "dummy")); - ASSERT(!obj.load(static_cast(0), "dummy")); + BMQTST_ASSERT(!obj.load(static_cast(0), "dummy")); + BMQTST_ASSERT(!obj.load(static_cast(0), "dummy")); { bslma::ManagedPtr value; - ASSERT(!obj.load(&value, "dummy")); + BMQTST_ASSERT(!obj.load(&value, "dummy")); } // Check unset property obj.unset("intVal"); - ASSERT(!obj.load(static_cast(0), "intVal")); + BMQTST_ASSERT(!obj.load(static_cast(0), "intVal")); // Unset unknown property obj.unset("intVal3"); // Not able to load a string val into an int - ASSERT(!obj.load(static_cast(0), "strVal")); + BMQTST_ASSERT(!obj.load(static_cast(0), "strVal")); // Verify PropertyBagValue accessors { bslma::ManagedPtr bagValue; bool loaded = obj.load(&bagValue, "intVal2"); - ASSERT(loaded); + BMQTST_ASSERT(loaded); BMQTST_ASSERT_EQ(bagValue->name(), "intVal2"); - ASSERT(bagValue->isDatum()); - ASSERT(!bagValue->isPtr()); + BMQTST_ASSERT(bagValue->isDatum()); + BMQTST_ASSERT(!bagValue->isPtr()); loaded = obj.load(&bagValue, "ptrVal"); - ASSERT(loaded); + BMQTST_ASSERT(loaded); BMQTST_ASSERT_EQ(bagValue->name(), "ptrVal"); - ASSERT(!bagValue->isDatum()); - ASSERT(bagValue->isPtr()); + BMQTST_ASSERT(!bagValue->isDatum()); + BMQTST_ASSERT(bagValue->isPtr()); } } @@ -186,7 +186,7 @@ static void test2_copyAndAssignment() // Check "someIntVal" property got removed as part of assignment // operations - ASSERT(!obj3.load(static_cast(0), "someIntVal")); + BMQTST_ASSERT(!obj3.load(static_cast(0), "someIntVal")); } } @@ -310,7 +310,8 @@ static void test5_propertyBagUtil() obj2.load(&str2, "str2"); char* arenaPtr = reinterpret_cast(&arena); - ASSERT(str2.data() >= arenaPtr && str2.data() < arenaPtr + sizeof(arena)); + BMQTST_ASSERT(str2.data() >= arenaPtr && + str2.data() < arenaPtr + sizeof(arena)); } static void test6_valueOverwrite() diff --git a/src/groups/bmq/bmqvt/bmqvt_valueorerror.t.cpp b/src/groups/bmq/bmqvt/bmqvt_valueorerror.t.cpp index 7482956ff..30097e357 100644 --- a/src/groups/bmq/bmqvt/bmqvt_valueorerror.t.cpp +++ b/src/groups/bmq/bmqvt/bmqvt_valueorerror.t.cpp @@ -267,9 +267,9 @@ static void test_ops_generic() PVV("Test ValueOrError(bslma::Allocator *) and operator<<"); T value(bmqtst::TestHelperUtil::allocator()); - ASSERT(value.isUndefined()); - ASSERT(!value.isValue()); - ASSERT(!value.isError()); + BMQTST_ASSERT(value.isUndefined()); + BMQTST_ASSERT(!value.isValue()); + BMQTST_ASSERT(!value.isError()); { bmqu::MemOutStream os(bmqtst::TestHelperUtil::allocator()); os << value; @@ -281,9 +281,9 @@ static void test_ops_generic() Value refValue(makeObject("value")); value.makeValue(refValue); - ASSERT(!value.isUndefined()); - ASSERT(value.isValue()); - ASSERT(!value.isError()); + BMQTST_ASSERT(!value.isUndefined()); + BMQTST_ASSERT(value.isValue()); + BMQTST_ASSERT(!value.isError()); { bmqu::MemOutStream expected(bmqtst::TestHelperUtil::allocator()), actual(bmqtst::TestHelperUtil::allocator()); @@ -300,9 +300,9 @@ static void test_ops_generic() Error refError(makeObject(-5)); value.makeError(refError); - ASSERT(!value.isUndefined()); - ASSERT(!value.isValue()); - ASSERT(value.isError()); + BMQTST_ASSERT(!value.isUndefined()); + BMQTST_ASSERT(!value.isValue()); + BMQTST_ASSERT(value.isError()); { bmqu::MemOutStream expected(bmqtst::TestHelperUtil::allocator()), actual(bmqtst::TestHelperUtil::allocator()); @@ -323,9 +323,9 @@ static void test_ops_generic() BMQTST_ASSERT_EQ(value.error(), makeObject()); PVV("Test reset()"); - ASSERT(!value.isUndefined()); + BMQTST_ASSERT(!value.isUndefined()); value.reset(); - ASSERT(value.isUndefined()); + BMQTST_ASSERT(value.isUndefined()); PVV("Test operator="); @@ -335,9 +335,9 @@ static void test_ops_generic() src.makeValue(srcValue); value = src; } - ASSERT(!value.isUndefined()); - ASSERT(value.isValue()); - ASSERT(!value.isError()); + BMQTST_ASSERT(!value.isUndefined()); + BMQTST_ASSERT(value.isValue()); + BMQTST_ASSERT(!value.isError()); BMQTST_ASSERT_EQ(value.value(), srcValue); PVV("Test copy constructor"); @@ -498,7 +498,7 @@ static void test6_converters() TargetType tt; st.mapValue(&tt, &atoiNoThrowSpec); - ASSERT(tt.isValue()); + BMQTST_ASSERT(tt.isValue()); BMQTST_ASSERT_EQ(tt.value(), 12); BMQTST_ASSERT_EQ(tt.valueOr(15), 12); @@ -514,7 +514,7 @@ static void test6_converters() TargetType tt; st.mapValue(&tt, &atoiNoThrowSpec); - ASSERT(tt.isError()); + BMQTST_ASSERT(tt.isError()); BMQTST_ASSERT_EQ(tt.error(), 'a'); BMQTST_ASSERT_EQ(tt.valueOr(15), 15); @@ -530,7 +530,7 @@ static void test6_converters() TargetType tt; st.mapError(&tt, &atoiNoThrowSpec); - ASSERT(tt.isValue()); + BMQTST_ASSERT(tt.isValue()); BMQTST_ASSERT_EQ(tt.value(), 'a'); BMQTST_ASSERT_EQ(tt.valueOr('i'), 'a'); @@ -546,7 +546,7 @@ static void test6_converters() TargetType tt; st.mapError(&tt, &atoiNoThrowSpec); - ASSERT(tt.isError()); + BMQTST_ASSERT(tt.isError()); BMQTST_ASSERT_EQ(tt.error(), 12); BMQTST_ASSERT_EQ(tt.valueOr('i'), 'i'); @@ -566,10 +566,10 @@ static void test6_converters() st1.map(&tt1, &atoiNoThrowSpec, &toUnsigned); st2.map(&tt2, &atoiNoThrowSpec, &toUnsigned); - ASSERT(tt1.isValue()); + BMQTST_ASSERT(tt1.isValue()); BMQTST_ASSERT_EQ(tt1.value(), 12); - ASSERT(tt2.isError()); + BMQTST_ASSERT(tt2.isError()); BMQTST_ASSERT_EQ(tt2.error(), 3u); } } diff --git a/src/groups/mqb/mqba/mqba_clientsession.t.cpp b/src/groups/mqb/mqba/mqba_clientsession.t.cpp index 45129048d..20de1d76f 100644 --- a/src/groups/mqb/mqba/mqba_clientsession.t.cpp +++ b/src/groups/mqb/mqba/mqba_clientsession.t.cpp @@ -123,7 +123,7 @@ struct TypeOrAny { : d_value() , d_any(any) { - ASSERT(any == e_Any); + BMQTST_ASSERT(any == e_Any); } bool operator==(const T& rhs) const @@ -351,11 +351,11 @@ Spec findSpec(ClientType clientType, current.putAction == putAction && current.ackRequested == ackRequested && current.ackSuccess == ackSuccess) { - ASSERT(matchIndex == -1); // Duplicate match on specs. + BMQTST_ASSERT(matchIndex == -1); // Duplicate match on specs. matchIndex = i; } } - ASSERT(matchIndex != -1); // Exactly one should match + BMQTST_ASSERT(matchIndex != -1); // Exactly one should match return s_spec[matchIndex]; } @@ -374,11 +374,11 @@ InvalidPutSpec findInvalidPutSpec(ClientType clientType, current.atMostOnce == atMostOnce && current.ackRequested == ackRequested && current.invalidPut == invalidPut) { - ASSERT(matchIndex == -1); // Duplicate match on specs. + BMQTST_ASSERT(matchIndex == -1); // Duplicate match on specs. matchIndex = i; } } - ASSERT(matchIndex != -1); // Exactly one should match + BMQTST_ASSERT(matchIndex != -1); // Exactly one should match return s_invalidPutSpec[matchIndex]; } @@ -395,11 +395,11 @@ GuidCollisionSpec findGuidCollisionSpec(ClientType clientType, if (current.clientType == clientType && current.atMostOnce == atMostOnce && current.ackRequested == ackRequested) { - ASSERT(matchIndex == -1); // Duplicate match on specs. + BMQTST_ASSERT(matchIndex == -1); // Duplicate match on specs. matchIndex = i; } } - ASSERT(matchIndex != -1); // Exactly one should match + BMQTST_ASSERT(matchIndex != -1); // Exactly one should match return s_guidCollisionSpec[matchIndex]; } @@ -634,7 +634,7 @@ void createBlob(bdlbb::BlobBufferFactory* bufferFactory, template T assertFail() { - ASSERT(false); + BMQTST_ASSERT(false); return T(); } @@ -937,12 +937,12 @@ class TestBench { /// Asserts that the first event written is an Open Queue Control Event. void assertOpenQueueResponse() { - ASSERT(d_channel->waitFor(1, false)); // isFinal = false + BMQTST_ASSERT(d_channel->waitFor(1, false)); // isFinal = false ConstWriteCall& openQueueCall = d_channel->writeCalls()[0]; bmqp::Event openQueueEvent(&openQueueCall.d_blob, bmqtst::TestHelperUtil::allocator()); PVV("Event 1: " << openQueueEvent); - ASSERT(openQueueEvent.isControlEvent()); + BMQTST_ASSERT(openQueueEvent.isControlEvent()); } /// Depending on the specified `ackResult` it might assert that an ack @@ -959,8 +959,8 @@ class TestBench { if (ackResult == e_AckResultNone) { // If no ack expected we shouldn't have more events than // 'eventIndex'. - ASSERT(d_channel->waitFor(eventIndex)); - ASSERT(d_channel->hasNoMoreWriteCalls()); + BMQTST_ASSERT(d_channel->waitFor(eventIndex)); + BMQTST_ASSERT(d_channel->hasNoMoreWriteCalls()); return; // RETURN } @@ -973,20 +973,20 @@ class TestBench { // If we expect acks, then the event with corresponding number // should exist and be of type Ack. - ASSERT(d_channel->waitFor(eventIndex + 1, isFinal)); + BMQTST_ASSERT(d_channel->waitFor(eventIndex + 1, isFinal)); ConstWriteCall& ackCall = d_channel->writeCalls()[eventIndex]; bmqp::Event ackEvent(&ackCall.d_blob, bmqtst::TestHelperUtil::allocator()); PVV("Event " << eventIndex + 1 << ": " << ackEvent); - ASSERT(ackEvent.isAckEvent()); + BMQTST_ASSERT(ackEvent.isAckEvent()); // The event should have one (Ack) Message in it and it should be // about the queue with the given queue ID. bmqp::AckMessageIterator iter; ackEvent.loadAckMessageIterator(&iter); - ASSERT(iter.next()); - ASSERT(iter.isValid()); + BMQTST_ASSERT(iter.next()); + BMQTST_ASSERT(iter.isValid()); const bmqp::AckMessage& ack = iter.message(); BMQTST_ASSERT_EQ(ack.queueId(), queueId); @@ -996,11 +996,11 @@ class TestBench { const bmqt::AckResult::Enum status = bmqp::ProtocolUtil::ackResultFromCode(ack.status()); BMQTST_ASSERT_EQ(expectedStatus, status); - ASSERT(!iter.next()); - ASSERT(!iter.isValid()); + BMQTST_ASSERT(!iter.next()); + BMQTST_ASSERT(!iter.isValid()); if (isFinal) { - ASSERT(d_channel->hasNoMoreWriteCalls()); + BMQTST_ASSERT(d_channel->hasNoMoreWriteCalls()); } } @@ -1019,17 +1019,17 @@ class TestBench { int last = d_channel->writeCalls().size(); d_cs.flush(); - ASSERT(d_channel->waitFor(last + 1, false)); + BMQTST_ASSERT(d_channel->waitFor(last + 1, false)); bmqp::Event pushEvent(&d_channel->writeCalls()[last].d_blob, bmqtst::TestHelperUtil::allocator()); - ASSERT(pushEvent.isPushEvent()); + BMQTST_ASSERT(pushEvent.isPushEvent()); bmqp::PushMessageIterator pushIt(&d_bufferFactory, d_allocator_p); pushEvent.loadPushMessageIterator(&pushIt, true); - ASSERT(pushIt.next()); + BMQTST_ASSERT(pushIt.next()); BMQTST_ASSERT_EQ(pushIt.loadMessageProperties(properties), 0); BMQTST_ASSERT_EQ(pushIt.header().compressionAlgorithmType(), @@ -1048,10 +1048,11 @@ class TestBench { // This will change once SDK starts advertising new feature. Then // ClientSession will send PUSH in the new style to new client. - ASSERT(bmqp::PushHeaderFlagUtil::isSet( + BMQTST_ASSERT(bmqp::PushHeaderFlagUtil::isSet( pushIt.header().flags(), bmqp::PushHeaderFlags::e_MESSAGE_PROPERTIES)); - ASSERT(!bmqp::MessagePropertiesInfo::hasSchema(pushIt.header())); + BMQTST_ASSERT( + !bmqp::MessagePropertiesInfo::hasSchema(pushIt.header())); bdlbb::Blob payloadBlob(&d_bufferFactory, d_allocator_p); pushIt.loadApplicationData(&payloadBlob); @@ -1063,7 +1064,7 @@ class TestBench { const int msgPropsAreaSize = mpsh->messagePropertiesAreaWords() * bmqp::Protocol::k_WORD_SIZE; - ASSERT(validateData(payloadBlob, msgPropsAreaSize, length)); + BMQTST_ASSERT(validateData(payloadBlob, msgPropsAreaSize, length)); } }; @@ -1135,7 +1136,7 @@ void test(ClientType clientType, if (clientType == e_FirstHopCorrelationIds) { // If PUT message was sent with correlation ID, when GUID was // generated by client session - ASSERT(guid.isUnset()); + BMQTST_ASSERT(guid.isUnset()); guid = postMessages[0].d_putHeader.messageGUID(); } @@ -1233,7 +1234,7 @@ void testInvalidPut(ClientType clientType, // Check no messages were sent const bsl::vector& postMessages = tb.d_domain.d_queueHandle->postedMessages(); - ASSERT(postMessages.empty()); + BMQTST_ASSERT(postMessages.empty()); // Confirm that (if expected) the ack has been sent downstream. tb.assertAckIsSentIfExpected(spec.ackResult, queueId, guid, correlationId); @@ -1392,7 +1393,7 @@ void testFirstHopUnsetGUID(AtMostOnce atMostOnce, AckRequested ackRequested) // Check if a message was sent const bsl::vector& postMessages = tb.d_domain.d_queueHandle->postedMessages(); - ASSERT(postMessages.empty()); + BMQTST_ASSERT(postMessages.empty()); // Check if a NACK was sent tb.assertAckIsSentIfExpected(e_AckResultUnknown, @@ -1600,13 +1601,13 @@ static void test4_ackRequestedNullCorrelationId() BMQTST_ASSERT_EQ(1u, postMessages.size()); // If a message with correlation id was sent upstream, grab the GUID. guid = postMessages[0].d_putHeader.messageGUID(); - ASSERT(!guid.isUnset()); + BMQTST_ASSERT(!guid.isUnset()); // ACK_REQUESTED flag should be set. const bool isAckRequestedSet = bmqp::PutHeaderFlagUtil::isSet( postMessages[0].d_putHeader.flags(), bmqp::PutHeaderFlags::e_ACK_REQUESTED); - ASSERT(isAckRequestedSet); + BMQTST_ASSERT(isAckRequestedSet); // Send an 'Ack' message. tb.sendAck(queueId, guid, bmqt::AckResult::e_SUCCESS); @@ -1665,13 +1666,13 @@ static void test5_ackNotRequestedNotNullCorrelationId() BMQTST_ASSERT_EQ(1u, postMessages.size()); // If a message with correlation id was sent upstream, grab the GUID. guid = postMessages[0].d_putHeader.messageGUID(); - ASSERT(!guid.isUnset()); + BMQTST_ASSERT(!guid.isUnset()); // ACK_REQUESTED flag should be set. const bool isAckRequestedSet = bmqp::PutHeaderFlagUtil::isSet( postMessages[0].d_putHeader.flags(), bmqp::PutHeaderFlags::e_ACK_REQUESTED); - ASSERT(isAckRequestedSet); + BMQTST_ASSERT(isAckRequestedSet); // Send an 'Ack' message. tb.sendAck(queueId, guid, bmqt::AckResult::e_SUCCESS); @@ -1760,7 +1761,7 @@ static void test7_oldStylePut() const bsl::vector& postMessages = tb.d_domain.d_queueHandle->postedMessages(); BMQTST_ASSERT_EQ(1u, postMessages.size()); - ASSERT(bmqp::PutHeaderFlagUtil::isSet( + BMQTST_ASSERT(bmqp::PutHeaderFlagUtil::isSet( postMessages[0].d_putHeader.flags(), bmqp::PutHeaderFlags::e_MESSAGE_PROPERTIES)); @@ -1768,7 +1769,7 @@ static void test7_oldStylePut() const bdlbb::Blob* payloadBlob = postMessages[0].d_appData.get(); const bmqp::MessagePropertiesInfo& logic(postMessages[0].d_putHeader); BMQTST_ASSERT_EQ(0, out.streamIn(*payloadBlob, logic.isExtended())); - ASSERT(!logic.isExtended()); + BMQTST_ASSERT(!logic.isExtended()); verify(out); @@ -1780,7 +1781,8 @@ static void test7_oldStylePut() *payloadBlob, bmqu::BlobPosition()); - ASSERT(tb.validateData(*postMessages[0].d_appData, msgPropsAreaSize)); + BMQTST_ASSERT( + tb.validateData(*postMessages[0].d_appData, msgPropsAreaSize)); // Turn around and send PUSH tb.sendPush(queueId, @@ -1842,7 +1844,7 @@ static void test8_oldStyleCompressedPut() const bsl::vector& postMessages = tb.d_domain.d_queueHandle->postedMessages(); BMQTST_ASSERT_EQ(1u, postMessages.size()); - ASSERT(bmqp::PutHeaderFlagUtil::isSet( + BMQTST_ASSERT(bmqp::PutHeaderFlagUtil::isSet( postMessages[0].d_putHeader.flags(), bmqp::PutHeaderFlags::e_MESSAGE_PROPERTIES)); @@ -1853,7 +1855,7 @@ static void test8_oldStyleCompressedPut() const bdlbb::Blob* payloadBlob = postMessages[0].d_appData.get(); const bmqp::MessagePropertiesInfo& logic(postMessages[0].d_putHeader); - ASSERT(!logic.isExtended()); + BMQTST_ASSERT(!logic.isExtended()); BMQTST_ASSERT_EQ(0, out.streamIn(*payloadBlob, logic.isExtended())); verify(out); @@ -1862,7 +1864,8 @@ static void test8_oldStyleCompressedPut() *payloadBlob, bmqu::BlobPosition()); - ASSERT(tb.validateData(*postMessages[0].d_appData, msgPropsAreaSize)); + BMQTST_ASSERT( + tb.validateData(*postMessages[0].d_appData, msgPropsAreaSize)); // Turn around and send PUSH tb.sendPush(queueId, @@ -1954,10 +1957,10 @@ static void test9_newStylePush() const bsl::vector& postMessages = tb.d_domain.d_queueHandle->postedMessages(); BMQTST_ASSERT_EQ(1u, postMessages.size()); - ASSERT(bmqp::PutHeaderFlagUtil::isSet( + BMQTST_ASSERT(bmqp::PutHeaderFlagUtil::isSet( postMessages[0].d_putHeader.flags(), bmqp::PutHeaderFlags::e_MESSAGE_PROPERTIES)); - ASSERT( + BMQTST_ASSERT( bmqp::MessagePropertiesInfo::hasSchema(postMessages[0].d_putHeader)); BMQTST_ASSERT_EQ(postMessages[0].d_putHeader.compressionAlgorithmType(), bmqt::CompressionAlgorithmType::e_NONE); @@ -1973,7 +1976,8 @@ static void test9_newStylePush() *payloadBlob, bmqu::BlobPosition()); - ASSERT(tb.validateData(*postMessages[0].d_appData, msgPropsAreaSize, 99)); + BMQTST_ASSERT( + tb.validateData(*postMessages[0].d_appData, msgPropsAreaSize, 99)); // Turn around and send PUSH tb.sendPush(queueId, @@ -2066,10 +2070,10 @@ static void test10_newStyleCompressedPush() const bsl::vector& postMessages = tb.d_domain.d_queueHandle->postedMessages(); BMQTST_ASSERT_EQ(1u, postMessages.size()); - ASSERT(bmqp::PutHeaderFlagUtil::isSet( + BMQTST_ASSERT(bmqp::PutHeaderFlagUtil::isSet( postMessages[0].d_putHeader.flags(), bmqp::PutHeaderFlags::e_MESSAGE_PROPERTIES)); - ASSERT( + BMQTST_ASSERT( bmqp::MessagePropertiesInfo::hasSchema(postMessages[0].d_putHeader)); BMQTST_ASSERT_EQ(postMessages[0].d_putHeader.compressionAlgorithmType(), bmqt::CompressionAlgorithmType::e_ZLIB); diff --git a/src/groups/mqb/mqba/mqba_dispatcher.t.cpp b/src/groups/mqb/mqba/mqba_dispatcher.t.cpp index 89381e892..266002cb5 100644 --- a/src/groups/mqb/mqba/mqba_dispatcher.t.cpp +++ b/src/groups/mqb/mqba/mqba_dispatcher.t.cpp @@ -219,7 +219,7 @@ static void test3_executorsSupport() // start the dispatcher bsl::stringstream startErr(bmqtst::TestHelperUtil::allocator()); rc = dispatcher.start(startErr); - ASSERT(rc == 0); + BMQTST_ASSERT(rc == 0); // register first client (of type 'e_SESSION') mqbmock::DispatcherClient client1(bmqtst::TestHelperUtil::allocator()); @@ -237,25 +237,25 @@ static void test3_executorsSupport() { // obtain an executor for first client's processor bmqex::Executor executor1 = dispatcher.executor(&client1); - ASSERT(static_cast(executor1)); + BMQTST_ASSERT(static_cast(executor1)); // obtain executor for second client's processor bmqex::Executor executor2 = dispatcher.executor(&client2); - ASSERT(static_cast(executor2)); + BMQTST_ASSERT(static_cast(executor2)); // executors for the first and the second client do compare equal as // the clients used to obtain them have the same types, and therefore // the same associated processors - ASSERT(executor1 == executor2); + BMQTST_ASSERT(executor1 == executor2); // obtain executor for third client's processor bmqex::Executor executor3 = dispatcher.executor(&client3); - ASSERT(static_cast(executor3)); + BMQTST_ASSERT(static_cast(executor3)); // executors for the second and the third clients do not compare equal // as the clients used to obtain them have different types, and // therefore different associated processors - ASSERT(executor2 != executor3); + BMQTST_ASSERT(executor2 != executor3); // create utility semaphores bslmt::Semaphore startedSignal, // used to sync. with async op. @@ -295,8 +295,8 @@ static void test3_executorsSupport() // both functors were invoked in the same thread that is not this // thread - ASSERT(threadId1 == threadId2); - ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); + BMQTST_ASSERT(threadId1 == threadId2); + BMQTST_ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); // submit a functor on a processor using the executor's 'dispatch' // function, check that 'dispatch' does not block the calling thread @@ -332,8 +332,8 @@ static void test3_executorsSupport() // both functors were invoked in the same thread that is not this // thread - ASSERT(threadId1 == threadId2); - ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); + BMQTST_ASSERT(threadId1 == threadId2); + BMQTST_ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); // reset thread ids threadId1 = bslmt::ThreadUtil::selfId(); @@ -356,29 +356,29 @@ static void test3_executorsSupport() // the nested functor was invoked in-place (we know that because // otherwise the operation above would not complete) - ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); + BMQTST_ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); } // test client executor { // obtain executor for first client bmqex::Executor executor1 = dispatcher.clientExecutor(&client1); - ASSERT(static_cast(executor1)); + BMQTST_ASSERT(static_cast(executor1)); // obtain executor for second client bmqex::Executor executor2 = dispatcher.clientExecutor(&client2); - ASSERT(static_cast(executor2)); + BMQTST_ASSERT(static_cast(executor2)); // executors for the first and the second client do not compare equal // as ther refer to different clients - ASSERT(executor1 != executor2); + BMQTST_ASSERT(executor1 != executor2); // obtain executor for second client again bmqex::Executor executor3 = dispatcher.clientExecutor(&client2); - ASSERT(static_cast(executor3)); + BMQTST_ASSERT(static_cast(executor3)); // executors for the same (second) client do compare equal - ASSERT(executor2 == executor3); + BMQTST_ASSERT(executor2 == executor3); // create utility semaphores bslmt::Semaphore startedSignal, // used to sync. with async op. @@ -418,8 +418,8 @@ static void test3_executorsSupport() // both functors were invoked in the same thread that is not this // thread - ASSERT(threadId1 == threadId2); - ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); + BMQTST_ASSERT(threadId1 == threadId2); + BMQTST_ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); // submit a functor on a processor using the executor's 'dispatch' // function, check that 'dispatch' does not block the calling thread @@ -455,8 +455,8 @@ static void test3_executorsSupport() // both functors were invoked in the same thread that is not this // thread - ASSERT(threadId1 == threadId2); - ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); + BMQTST_ASSERT(threadId1 == threadId2); + BMQTST_ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); // submit a functor that, when invoked, will submit another functor // via the executor's 'dispatch' function and block the calling thread @@ -475,7 +475,7 @@ static void test3_executorsSupport() // the nested functor was invoked in-place (we know that because // otherwise the operation above would not complete) - ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); + BMQTST_ASSERT(threadId1 != bslmt::ThreadUtil::selfId()); } // stop the dispatcher diff --git a/src/groups/mqb/mqbblp/mqbblp_pushstream.t.cpp b/src/groups/mqb/mqbblp/mqbblp_pushstream.t.cpp index 4305d9172..30f93846e 100644 --- a/src/groups/mqb/mqbblp/mqbblp_pushstream.t.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_pushstream.t.cpp @@ -148,19 +148,19 @@ static void test2_iterations() &ps, ps.d_stream.begin()); - ASSERT(!pit.atEnd()); + BMQTST_ASSERT(!pit.atEnd()); BMQTST_ASSERT_EQ(pit.numApps(), 2); BMQTST_ASSERT_EQ(element1, pit.element(0)); BMQTST_ASSERT_EQ(element3, pit.element(1)); - ASSERT(pit.advance()); + BMQTST_ASSERT(pit.advance()); BMQTST_ASSERT_EQ(pit.numApps(), 2); BMQTST_ASSERT_EQ(element2, pit.element(0)); BMQTST_ASSERT_EQ(element4, pit.element(1)); - ASSERT(!pit.advance()); + BMQTST_ASSERT(!pit.advance()); } { @@ -169,21 +169,21 @@ static void test2_iterations() &ps, ps.d_stream.begin()); - ASSERT(!vit.atEnd()); + BMQTST_ASSERT(!vit.atEnd()); BMQTST_ASSERT_EQ(vit.numApps(), 1); BMQTST_ASSERT_EQ(element1, vit.element(0)); vit.advance(); - ASSERT(!vit.atEnd()); + BMQTST_ASSERT(!vit.atEnd()); BMQTST_ASSERT_EQ(vit.numApps(), 1); BMQTST_ASSERT_EQ(element4, vit.element(0)); vit.advance(); - ASSERT(vit.atEnd()); + BMQTST_ASSERT(vit.atEnd()); } ps.remove(element2, true); diff --git a/src/groups/mqb/mqbblp/mqbblp_queueconsumptionmonitor.t.cpp b/src/groups/mqb/mqbblp/mqbblp_queueconsumptionmonitor.t.cpp index 3796daae6..accd4f20d 100644 --- a/src/groups/mqb/mqbblp/mqbblp_queueconsumptionmonitor.t.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_queueconsumptionmonitor.t.cpp @@ -278,7 +278,7 @@ BMQTST_TEST_F(Test, putAliveIdleSendAlive) BMQTST_ASSERT_EQ(d_monitor.state(d_id), QueueConsumptionMonitor::State::e_IDLE); BMQTST_ASSERT_EQ(logObserver.records().size(), ++expectedLogRecords); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( logObserver.records().back(), "ALARM \\[QUEUE_STUCK\\]", bmqtst::TestHelperUtil::allocator())); @@ -294,7 +294,7 @@ BMQTST_TEST_F(Test, putAliveIdleSendAlive) d_monitor.onTimer(3 * k_MAX_IDLE_TIME + 2); BMQTST_ASSERT_EQ(logObserver.records().size(), ++expectedLogRecords); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( logObserver.records().back(), "no longer appears to be stuck", bmqtst::TestHelperUtil::allocator())); @@ -476,7 +476,7 @@ BMQTST_TEST_F(Test, putAliveIdleSendAliveTwoSubstreams) BMQTST_ASSERT_EQ(logObserver.records().size(), expectedLogRecords += 2); for (int i = 0; i < 2; ++i) { - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( logObserver.records().rbegin()[i], "ALARM \\[QUEUE_STUCK\\]", bmqtst::TestHelperUtil::allocator())); @@ -497,7 +497,7 @@ BMQTST_TEST_F(Test, putAliveIdleSendAliveTwoSubstreams) d_monitor.onTimer(3 * k_MAX_IDLE_TIME + 2); BMQTST_ASSERT_EQ(logObserver.records().size(), expectedLogRecords += 1); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( logObserver.records().back(), "Queue 'bmq://bmq.test.local/test_queue\\?id=app1' no longer appears " "to be stuck.", @@ -511,7 +511,7 @@ BMQTST_TEST_F(Test, putAliveIdleSendAliveTwoSubstreams) d_monitor.onMessageSent(id2); d_monitor.onTimer(3 * k_MAX_IDLE_TIME + 3); BMQTST_ASSERT_EQ(logObserver.records().size(), expectedLogRecords += 1); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( logObserver.records().back(), "Queue 'bmq://bmq.test.local/test_queue\\?id=app2' no longer appears " "to be stuck.", diff --git a/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.t.cpp b/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.t.cpp index 5eeb52113..9a5139246 100644 --- a/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.t.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_relayqueueengine.t.cpp @@ -119,7 +119,7 @@ static void test1_breathingTest() // TODO: For each message, verify that it was delivered once to exactly // one handle (and one handle only!) - // ASSERT(tester.wasDeliveredOnce("a,b,c")); + // BMQTST_ASSERT(tester.wasDeliveredOnce("a,b,c")); BMQTST_ASSERT_EQ(C1->_numMessages(), 1); BMQTST_ASSERT_EQ(C2->_numMessages(), 1); BMQTST_ASSERT_EQ(C3->_numMessages(), 1); diff --git a/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.t.cpp b/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.t.cpp index 4d27a9836..6f6bdec67 100644 --- a/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.t.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.t.cpp @@ -341,7 +341,7 @@ struct UnSubscribe : public ClientOperation { // our 'MockQueueHandle's store unconfirmed messages, a call to // ConsumerStatus& status = iter->second; - ASSERT(status.handle); + BMQTST_ASSERT(status.handle); status.handle->_resetUnconfirmed(); // Don't unsubscribe someone you haven't subscribed yet, @@ -391,7 +391,7 @@ struct SetCanDeliver : public ClientOperation { const Iterator iter = findConsumer(model); if (iter != model->end()) { ConsumerStatus& status = iter->second; - ASSERT(status.handle); + BMQTST_ASSERT(status.handle); // If we run without being subscribed, it will segv in // '_setCanDeliver()' where it tries to reference 'queueEngine()'. @@ -488,7 +488,7 @@ MaybeError checkReceivedForConsumers( ++iter) { const ConsumerStatus& status = iter->second; mqbmock::QueueHandle* handle = status.handle; - ASSERT(handle); + BMQTST_ASSERT(handle); if (handle->_numMessages() != status.expectedCount) { bmqu::MemOutStream out; out << "actual messages (" << handle->_numMessages() @@ -564,7 +564,7 @@ void regress(Operations* operations, PVV(L_ << ": Failed on sequence: " << bmqu::PrintUtil::printer(*operations) << " " << rv.value()); - ASSERT(false); + BMQTST_ASSERT(false); return; // RETURN } @@ -739,7 +739,7 @@ static void test2_broadcastConfirmAssertFails() // NOTE: Even if our 'onConfirmMessage()' doesn't abort, the mock // infrastructure is. Thus, some inspection on the cause of abort // would also be useful. - ASSERT_SAFE_FAIL(tester.confirm( + BMQTST_ASSERT_SAFE_FAIL(tester.confirm( "C1", mqbblp::QueueEngineTestUtil::getMessages(C1->_messages(), "0"))); (void)C1; // Compiler happiness @@ -1384,7 +1384,7 @@ static void test8_priorityBreathingTest() // TODO: For each message, verify that it was delivered once to exactly // one handle (and one handle only!) - // ASSERT(tester.wasDeliveredOnce("a,b,c")); + // BMQTST_ASSERT(tester.wasDeliveredOnce("a,b,c")); BMQTST_ASSERT_EQ(C1->_numMessages(), 1); BMQTST_ASSERT_EQ(C2->_numMessages(), 1); BMQTST_ASSERT_EQ(C3->_numMessages(), 1); @@ -1460,7 +1460,7 @@ static void test9_priorityCreateAndConfigure() // 1. Create PriorityQueueEngine tester.create(&queueEngineMp, bmqtst::TestHelperUtil::allocator()); - ASSERT(queueEngineMp.get() != 0); + BMQTST_ASSERT(queueEngineMp.get() != 0); // 2. Verify that the created PriorityQueueEngine is functional by // configuring it successfully @@ -2108,7 +2108,7 @@ static void test15_priorityReleaseActiveConsumerWithoutNullReconfigure() const bsl::string unconfirmedMessages = mqbblp::QueueEngineTestUtil::getMessages(C1->_messages(), "0,1"); - ASSERT(logObserver.records().empty()); + BMQTST_ASSERT(logObserver.records().empty()); tester.releaseHandle("C1 readCount=1"); @@ -2210,7 +2210,7 @@ static void test16_priorityReleaseDormantConsumerWithoutNullReconfigure() const bsl::string unconfirmedMessages = mqbblp::QueueEngineTestUtil::getMessages(C1->_messages(), "0"); - ASSERT(logObserver.records().empty()); + BMQTST_ASSERT(logObserver.records().empty()); BMQTST_ASSERT_EQ(C1->_numActiveSubstreams(), 1U); tester.releaseHandle("C1 readCount=1"); @@ -2787,7 +2787,7 @@ static void test22_createAndConfigure() // 1. Create FanoutQueueEngine tester.create(&queueEngineMp, bmqtst::TestHelperUtil::allocator()); - ASSERT(queueEngineMp.get() != 0); + BMQTST_ASSERT(queueEngineMp.get() != 0); // 2. Verify that the created FanoutQueueEngine is functional by // configuring it successfully @@ -2829,7 +2829,7 @@ static void test23_loadRoutingConfiguration() // 1. { bmqp_ctrlmsg::RoutingConfiguration config; - ASSERT(bmqp::RoutingConfigurationUtils::isClear(config)); + BMQTST_ASSERT(bmqp::RoutingConfigurationUtils::isClear(config)); mqbblp::RootQueueEngine::FanoutConfiguration::loadRoutingConfiguration( &config); @@ -2837,15 +2837,17 @@ static void test23_loadRoutingConfiguration() bdlb::BitUtil::uint64_t flags = config.flags(); int numFlagsSet = bdlb::BitUtil::numBitsSet(flags); BMQTST_ASSERT_EQ(numFlagsSet, 2); - ASSERT(bmqp::RoutingConfigurationUtils::hasMultipleSubStreams(config)); - ASSERT(bmqp::RoutingConfigurationUtils::isDeliverConsumerPriority( - config)); + BMQTST_ASSERT( + bmqp::RoutingConfigurationUtils::hasMultipleSubStreams(config)); + BMQTST_ASSERT( + bmqp::RoutingConfigurationUtils::isDeliverConsumerPriority( + config)); } // 2. { bmqp_ctrlmsg::RoutingConfiguration config; - ASSERT(bmqp::RoutingConfigurationUtils::isClear(config)); + BMQTST_ASSERT(bmqp::RoutingConfigurationUtils::isClear(config)); mqbblp::RootQueueEngine::PriorityConfiguration:: loadRoutingConfiguration(&config); @@ -2853,10 +2855,11 @@ static void test23_loadRoutingConfiguration() bdlb::BitUtil::uint64_t flags = config.flags(); int numFlagsSet = bdlb::BitUtil::numBitsSet(flags); BMQTST_ASSERT_EQ(numFlagsSet, 1); - ASSERT( + BMQTST_ASSERT( !bmqp::RoutingConfigurationUtils::hasMultipleSubStreams(config)); - ASSERT(bmqp::RoutingConfigurationUtils::isDeliverConsumerPriority( - config)); + BMQTST_ASSERT( + bmqp::RoutingConfigurationUtils::isDeliverConsumerPriority( + config)); } } diff --git a/src/groups/mqb/mqbblp/mqbblp_routers.t.cpp b/src/groups/mqb/mqbblp/mqbblp_routers.t.cpp index 107ada044..c698d2f54 100644 --- a/src/groups/mqb/mqbblp/mqbblp_routers.t.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_routers.t.cpp @@ -176,13 +176,13 @@ static void test1_registry() Registry::SharedItem si1 = registry.record(key12, value13); BMQTST_ASSERT_EQ(registry.size(), size_t(1)); - ASSERT(si1->value() == value13); + BMQTST_ASSERT(si1->value() == value13); Registry::SharedItem si2 = registry.record(key12, value14); BMQTST_ASSERT_EQ(registry.size(), size_t(1)); - ASSERT(si2->value() == value13); + BMQTST_ASSERT(si2->value() == value13); } BMQTST_ASSERT_EQ(registry.size(), size_t(0)); } diff --git a/src/groups/mqb/mqbc/mqbc_clusterstateledger.t.cpp b/src/groups/mqb/mqbc/mqbc_clusterstateledger.t.cpp index 02f25b7a5..b1fc64838 100644 --- a/src/groups/mqb/mqbc/mqbc_clusterstateledger.t.cpp +++ b/src/groups/mqb/mqbc/mqbc_clusterstateledger.t.cpp @@ -177,13 +177,13 @@ static void test1_clusterStateLedger_protocol() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); diff --git a/src/groups/mqb/mqbc/mqbc_clusterstateledgeriterator.t.cpp b/src/groups/mqb/mqbc/mqbc_clusterstateledgeriterator.t.cpp index ea3389dc8..9cd927cd4 100644 --- a/src/groups/mqb/mqbc/mqbc_clusterstateledgeriterator.t.cpp +++ b/src/groups/mqb/mqbc/mqbc_clusterstateledgeriterator.t.cpp @@ -150,13 +150,13 @@ static void test1_clusterStateLedgerIterator_protocol() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); diff --git a/src/groups/mqb/mqbc/mqbc_clusterstatemanager.t.cpp b/src/groups/mqb/mqbc/mqbc_clusterstatemanager.t.cpp index fe0bd08fa..a798680e0 100644 --- a/src/groups/mqb/mqbc/mqbc_clusterstatemanager.t.cpp +++ b/src/groups/mqb/mqbc/mqbc_clusterstatemanager.t.cpp @@ -296,11 +296,11 @@ struct Tester { ++cit) { if (cit->first->nodeId() == d_cluster_mp->netCluster().selfNodeId()) { - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); continue; // CONTINUE } - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -333,7 +333,7 @@ struct Tester { ++cit) { if (cit->first->nodeId() == d_cluster_mp->_clusterData()->electorInfo().leaderNodeId()) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -343,7 +343,7 @@ struct Tester { BMQTST_ASSERT_EQ(message, expectedMessage); } else { - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -364,7 +364,7 @@ struct Tester { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == destination.nodeId()) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -374,7 +374,7 @@ struct Tester { BMQTST_ASSERT_EQ(message, expectedMessage); } else { - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -401,7 +401,7 @@ struct Tester { ++cit) { if (cit->first->nodeId() == d_cluster_mp->_clusterData()->electorInfo().leaderNodeId()) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -412,7 +412,7 @@ struct Tester { expectedMessage); } else { - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -435,7 +435,7 @@ struct Tester { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == destination.nodeId()) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -445,7 +445,7 @@ struct Tester { BMQTST_ASSERT_EQ(message, expectedMessage); } else { - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -530,7 +530,7 @@ struct Tester { ++cit) { if (cit->first->nodeId() == d_cluster_mp->_clusterData()->electorInfo().leaderNodeId()) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -540,7 +540,7 @@ struct Tester { BMQTST_ASSERT_EQ(message, expectedMessage); } else { - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -586,7 +586,7 @@ static void test1_breathingTestLeader() BMQTST_ASSERT_EQ(lsnMap.size(), 1U); NodeToLSNMapCIter citer = lsnMap.find(const_cast( tester.d_cluster_mp->netCluster().selfNode())); - ASSERT(citer != lsnMap.cend()); + BMQTST_ASSERT(citer != lsnMap.cend()); BMQTST_ASSERT_LT(citer->second, tester.d_cluster_mp->_clusterData() ->electorInfo() @@ -625,7 +625,7 @@ static void test2_breathingTestFollower() BMQTST_ASSERT_EQ(tester.d_clusterStateManager_mp->healthState(), mqbc::ClusterStateTableState::e_FOL_HEALING); - ASSERT(tester.d_clusterStateManager_mp->nodeToLSNMap().empty()); + BMQTST_ASSERT(tester.d_clusterStateManager_mp->nodeToLSNMap().empty()); tester.verifyRegistrationRequestSent(selfLSN); } @@ -858,7 +858,7 @@ static void test6_registrationRequestHandlingLeader() tester.d_clusterStateManager_mp->nodeToLSNMap(); BMQTST_ASSERT_EQ(lsnMap.size(), 2U); // 2 including self LSN NodeToLSNMapCIter citer = lsnMap.find(source); - ASSERT(citer != lsnMap.cend()); + BMQTST_ASSERT(citer != lsnMap.cend()); BMQTST_ASSERT_EQ(citer->second.electorTerm(), 2U); BMQTST_ASSERT_EQ(citer->second.sequenceNumber(), 5U); } @@ -1209,7 +1209,7 @@ static void test11_leaderHighestLeaderHealed() const Advisories& advisories = tester.d_clusterStateLedger_p->_uncommittedAdvisories(); BMQTST_ASSERT_EQ(advisories.size(), 1U); - ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); const bmqp_ctrlmsg::LeaderAdvisory& advisory = advisories.front().choice().leaderAdvisory(); @@ -1334,7 +1334,7 @@ static void test12_followerHighestLeaderHealed() const Advisories& advisories = tester.d_clusterStateLedger_p->_uncommittedAdvisories(); BMQTST_ASSERT_EQ(advisories.size(), 1U); - ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); const bmqp_ctrlmsg::LeaderAdvisory& advisory = advisories.front().choice().leaderAdvisory(); @@ -1601,7 +1601,7 @@ static void test16_followerClusterStateRespFailureLeaderNext() const Advisories& advisories = tester.d_clusterStateLedger_p->_uncommittedAdvisories(); BMQTST_ASSERT_EQ(advisories.size(), 1U); - ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); const bmqp_ctrlmsg::LeaderAdvisory& advisory = advisories.front().choice().leaderAdvisory(); @@ -1752,7 +1752,7 @@ static void test17_followerClusterStateRespFailureFollowerNext() const Advisories& advisories = tester.d_clusterStateLedger_p->_uncommittedAdvisories(); BMQTST_ASSERT_EQ(advisories.size(), 1U); - ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(advisories.front().choice().isLeaderAdvisoryValue()); const bmqp_ctrlmsg::LeaderAdvisory& advisory = advisories.front().choice().leaderAdvisory(); @@ -2084,7 +2084,7 @@ static void test20_resetUnknownLeader() const NodeToLSNMap& lsnMap = tester.d_clusterStateManager_mp->nodeToLSNMap(); - ASSERT(lsnMap.empty()); + BMQTST_ASSERT(lsnMap.empty()); // 2.a.) Self transitions to Leader Healing Stage 2, after receiving // follower LSN responses from all followers @@ -2114,7 +2114,7 @@ static void test20_resetUnknownLeader() BMQTST_ASSERT_EQ(tester.d_clusterStateManager_mp->healthState(), mqbc::ClusterStateTableState::e_UNKNOWN); - ASSERT(lsnMap.empty()); + BMQTST_ASSERT(lsnMap.empty()); // 3.a.) Self transitions to Leader Healed, after receiving follower LSN // responses from all followers and then upon CSL commit success @@ -2150,7 +2150,7 @@ static void test20_resetUnknownLeader() BMQTST_ASSERT_EQ(tester.d_clusterStateManager_mp->healthState(), mqbc::ClusterStateTableState::e_UNKNOWN); - ASSERT(lsnMap.empty()); + BMQTST_ASSERT(lsnMap.empty()); } static void test21_resetUnknownFollower() diff --git a/src/groups/mqb/mqbc/mqbc_incoreclusterstateledger.t.cpp b/src/groups/mqb/mqbc/mqbc_incoreclusterstateledger.t.cpp index d7e2e940f..e0d3f7758 100644 --- a/src/groups/mqb/mqbc/mqbc_incoreclusterstateledger.t.cpp +++ b/src/groups/mqb/mqbc/mqbc_incoreclusterstateledger.t.cpp @@ -137,7 +137,7 @@ void verifyLeaderAdvisoryCommit( bmqp_ctrlmsg::ClusterMessage msg; const int rc = cslIter.loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isLeaderAdvisoryCommitValue()); + BMQTST_ASSERT(msg.choice().isLeaderAdvisoryCommitValue()); BMQTST_ASSERT_EQ( msg.choice().leaderAdvisoryCommit().sequenceNumberCommitted(), sequenceNumber); @@ -506,9 +506,9 @@ static void test1_breathingTest() "IncoreClusterStateLedger (cluster: testCluster) : "); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 0U); - ASSERT(tester.hasBroadcastedMessages(0)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(0)); BMQTST_ASSERT_EQ(obj->close(), 0); - ASSERT(tester.hasNoMoreBroadcastedMessages()); + BMQTST_ASSERT(tester.hasNoMoreBroadcastedMessages()); } static void test2_apply_PartitionPrimaryAdvisory() @@ -550,11 +550,11 @@ static void test2_apply_PartitionPrimaryAdvisory() BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 1U); BMQTST_ASSERT_EQ(tester.committedMessage(0), expected); - ASSERT(tester.hasBroadcastedMessages(2)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2)); BMQTST_ASSERT_EQ(tester.broadcastedMessage(0), expected); BSLS_ASSERT_OPT(obj->close() == 0); - ASSERT(tester.hasNoMoreBroadcastedMessages()); + BMQTST_ASSERT(tester.hasNoMoreBroadcastedMessages()); } static void test3_apply_QueueAssignmentAdvisory() @@ -601,7 +601,7 @@ static void test3_apply_QueueAssignmentAdvisory() BMQTST_ASSERT_EQ(tester.committedMessage(0), expected); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 1U); BMQTST_ASSERT_EQ(tester.broadcastedMessage(0), expected); - ASSERT(tester.hasBroadcastedMessages(2)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2)); BSLS_ASSERT_OPT(obj->close() == 0); } @@ -645,7 +645,7 @@ static void test4_apply_QueueUnassignedAdvisory() .makeQueueUnassignedAdvisory(qadvisory); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 1U); BMQTST_ASSERT_EQ(tester.committedMessage(0), expected); - ASSERT(tester.hasBroadcastedMessages(2)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2)); BMQTST_ASSERT_EQ(tester.broadcastedMessage(0), expected); BSLS_ASSERT_OPT(obj->close() == 0); @@ -707,7 +707,7 @@ static void test5_apply_QueueUpdateAdvisory() qadvisory); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 1U); BMQTST_ASSERT_EQ(tester.committedMessage(0), expected); - ASSERT(tester.hasBroadcastedMessages(2)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2)); BMQTST_ASSERT_EQ(tester.broadcastedMessage(0), expected); BSLS_ASSERT_OPT(obj->close() == 0); @@ -758,11 +758,11 @@ static void test6_apply_LeaderAdvisory() leaderAdvisory); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 1U); BMQTST_ASSERT_EQ(tester.committedMessage(0), expected); - ASSERT(tester.hasBroadcastedMessages(2)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2)); BMQTST_ASSERT_EQ(tester.broadcastedMessage(0), expected); BSLS_ASSERT_OPT(obj->close() == 0); - ASSERT(tester.hasNoMoreBroadcastedMessages()); + BMQTST_ASSERT(tester.hasNoMoreBroadcastedMessages()); } static void test7_apply_ClusterStateRecord() @@ -814,13 +814,13 @@ static void test7_apply_ClusterStateRecord() mqbmock::Cluster::k_LEADER_NODE_ID)), 0); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 0U); - ASSERT(tester.hasBroadcastedMessages(0)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(0)); // Verify that the underlying ledger contains the update record bslma::ManagedPtr cslIter = obj->getIterator(); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, pmAdvisory.sequenceNumber()); @@ -829,7 +829,7 @@ static void test7_apply_ClusterStateRecord() bmqp_ctrlmsg::ClusterMessage msg; int rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isPartitionPrimaryAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isPartitionPrimaryAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().partitionPrimaryAdvisory(), pmAdvisory); // 2. Create a snapshot record @@ -862,10 +862,10 @@ static void test7_apply_ClusterStateRecord() mqbmock::Cluster::k_LEADER_NODE_ID)), 0); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 0U); - ASSERT(tester.hasBroadcastedMessages(0)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(0)); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_SNAPSHOT, leaderAdvisory.sequenceNumber()); @@ -873,7 +873,7 @@ static void test7_apply_ClusterStateRecord() rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isLeaderAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().leaderAdvisory(), leaderAdvisory); } @@ -944,7 +944,7 @@ static void test8_apply_ClusterStateRecordAck() mqbmock::Cluster::k_LEADER_NODE_ID + 1)), 0); BSLS_ASSERT_OPT(obj->close() == 0); - ASSERT(tester.hasNoMoreBroadcastedMessages()); + BMQTST_ASSERT(tester.hasNoMoreBroadcastedMessages()); } static void test9_apply_ClusterStateRecordCommit() @@ -995,7 +995,7 @@ static void test9_apply_ClusterStateRecordCommit() mqbmock::Cluster::k_LEADER_NODE_ID)), 0); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 0U); - ASSERT(tester.hasBroadcastedMessages(0)); + BMQTST_ASSERT(tester.hasBroadcastedMessages(0)); // 1. Build and apply 'LeaderAdvisoryCommit' for an advisory that has been // previously applied (but not yet committed) @@ -1038,7 +1038,7 @@ static void test9_apply_ClusterStateRecordCommit() BMQTST_ASSERT_EQ(tester.numCommittedMessages(), 1U); BSLS_ASSERT_OPT(obj->close() == 0); - ASSERT(tester.hasNoMoreBroadcastedMessages()); + BMQTST_ASSERT(tester.hasNoMoreBroadcastedMessages()); } static void test10_persistanceLeader() @@ -1179,7 +1179,7 @@ static void test10_persistanceLeader() // Verify 'PartitionPrimaryAdvisory' and its commit BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, pmAdvisory.sequenceNumber()); @@ -1187,86 +1187,86 @@ static void test10_persistanceLeader() bmqp_ctrlmsg::ClusterMessage msg; int rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(cslIter->loadClusterMessage(&msg), 0); - ASSERT(msg.choice().isPartitionPrimaryAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isPartitionPrimaryAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().partitionPrimaryAdvisory(), pmAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, pmAdvisory.sequenceNumber()); // Verify 'QueueAssignmentAdvisory' and its commit BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, qAssignAdvisory.sequenceNumber()); rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isQueueAssignmentAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isQueueAssignmentAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().queueAssignmentAdvisory(), qAssignAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, qAssignAdvisory.sequenceNumber()); // Verify 'QueueUnassignedAdvisory' and its commit BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, qUnassignedAdvisory.sequenceNumber()); rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isQueueUnassignedAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isQueueUnassignedAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().queueUnassignedAdvisory(), qUnassignedAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, qUnassignedAdvisory.sequenceNumber()); // Verify 'QueueUpdateAdvisory' and its commit BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, qUpdateAdvisory.sequenceNumber()); rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isQueueUpdateAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isQueueUpdateAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().queueUpdateAdvisory(), qUpdateAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, qUpdateAdvisory.sequenceNumber()); // Verify 'LeaderAdvisory' and its commit BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_SNAPSHOT, leaderAdvisory.sequenceNumber()); rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isLeaderAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().leaderAdvisory(), leaderAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, leaderAdvisory.sequenceNumber()); // Verify end of ledger BMQTST_ASSERT_EQ(cslIter->next(), 1); - ASSERT(!cslIter->isValid()); + BMQTST_ASSERT(!cslIter->isValid()); } static void test11_persistanceFollower() @@ -1484,7 +1484,7 @@ static void test11_persistanceFollower() // Verify 'PartitionPrimaryAdvisory' BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, pmAdvisory.sequenceNumber()); @@ -1493,12 +1493,12 @@ static void test11_persistanceFollower() bmqp_ctrlmsg::ClusterMessage msg; int rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isPartitionPrimaryAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isPartitionPrimaryAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().partitionPrimaryAdvisory(), pmAdvisory); // Verify 'QueueAssignmentAdvisory' BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, qAssignAdvisory.sequenceNumber()); @@ -1506,12 +1506,12 @@ static void test11_persistanceFollower() rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isQueueAssignmentAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isQueueAssignmentAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().queueAssignmentAdvisory(), qAssignAdvisory); // Verify 'QueueUnassignedAdvisory' BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, qUnassignedAdvisory.sequenceNumber()); @@ -1519,13 +1519,13 @@ static void test11_persistanceFollower() rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isQueueUnassignedAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isQueueUnassignedAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().queueUnassignedAdvisory(), qUnassignedAdvisory); // Verify 'QueueUpdateAdvisory' BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, qUpdateAdvisory.sequenceNumber()); @@ -1533,12 +1533,12 @@ static void test11_persistanceFollower() rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isQueueUpdateAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isQueueUpdateAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().queueUpdateAdvisory(), qUpdateAdvisory); // Verify 'LeaderAdvisory' and its commit BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_SNAPSHOT, leaderAdvisory.sequenceNumber()); @@ -1546,17 +1546,17 @@ static void test11_persistanceFollower() rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isLeaderAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().leaderAdvisory(), leaderAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, leaderAdvisory.sequenceNumber()); // Verify end of ledger BMQTST_ASSERT_EQ(cslIter->next(), 1); - ASSERT(!cslIter->isValid()); + BMQTST_ASSERT(!cslIter->isValid()); } static void test12_persistanceAcrossRollover() @@ -1674,7 +1674,7 @@ static void test12_persistanceAcrossRollover() .makePartitionPrimaryAdvisory(pmAdvisory); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), i + 1); BMQTST_ASSERT_EQ(tester.committedMessage(i), expectedPmAdvisory); - ASSERT(tester.hasBroadcastedMessages(2 * (i + 1))); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2 * (i + 1))); BMQTST_ASSERT_EQ(tester.broadcastedMessage(2 * i), expectedPmAdvisory); lastAdvisories.push_back( @@ -1707,7 +1707,7 @@ static void test12_persistanceAcrossRollover() BMQTST_ASSERT_EQ(tester.numCommittedMessages(), i + 2); BMQTST_ASSERT_EQ(tester.committedMessage(i + 1), expectedQUnassignedAdvisory); - ASSERT(tester.hasBroadcastedMessages(2 * (i + 2))); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2 * (i + 2))); BMQTST_ASSERT_EQ(tester.broadcastedMessage(2 * (i + 1)), expectedQUnassignedAdvisory); @@ -1745,7 +1745,7 @@ static void test12_persistanceAcrossRollover() .makeLeaderAdvisory(leaderAdvisory); BMQTST_ASSERT_EQ(tester.numCommittedMessages(), i + 3); BMQTST_ASSERT_EQ(tester.committedMessage(i + 2), expectedLeaderAdvisory); - ASSERT(tester.hasBroadcastedMessages(2 * (i + 3))); + BMQTST_ASSERT(tester.hasBroadcastedMessages(2 * (i + 3))); BMQTST_ASSERT_EQ(tester.broadcastedMessage(2 * (i + 2)), expectedLeaderAdvisory); @@ -1765,7 +1765,7 @@ static void test12_persistanceAcrossRollover() // 5. Verify the snapshot and the last advisories BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_SNAPSHOT, qadvisory.sequenceNumber()); @@ -1773,7 +1773,7 @@ static void test12_persistanceAcrossRollover() bmqp_ctrlmsg::ClusterMessage snapshotMsg; rc = cslIter->loadClusterMessage(&snapshotMsg); BMQTST_ASSERT_EQ(cslIter->loadClusterMessage(&snapshotMsg), 0); - ASSERT(snapshotMsg.choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(snapshotMsg.choice().isLeaderAdvisoryValue()); bmqp_ctrlmsg::LeaderAdvisory& snapshot = snapshotMsg.choice().leaderAdvisory(); @@ -1787,23 +1787,23 @@ static void test12_persistanceAcrossRollover() cit != lastAdvisories.cend(); ++cit) { BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, cit->d_recordType, cit->d_sequenceNumber); bmqp_ctrlmsg::ClusterMessage msg; rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(cit->d_advisory.choice().isClusterMessageValue()); + BMQTST_ASSERT(cit->d_advisory.choice().isClusterMessageValue()); BMQTST_ASSERT_EQ(msg, cit->d_advisory.choice().clusterMessage()); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, cit->d_sequenceNumber); } // Verify end of ledger BMQTST_ASSERT_EQ(cslIter->next(), 1); - ASSERT(!cslIter->isValid()); + BMQTST_ASSERT(!cslIter->isValid()); BSLS_ASSERT_OPT(obj->close() == 0); @@ -2078,18 +2078,18 @@ static void test13_rolloverUncommittedAdvisories() cit != uncommittedAdvisories.cend(); ++cit) { BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, cit->d_recordType, cit->d_sequenceNumber); bmqp_ctrlmsg::ClusterMessage msg; rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(cit->d_advisory.choice().isClusterMessageValue()); + BMQTST_ASSERT(cit->d_advisory.choice().isClusterMessageValue()); BMQTST_ASSERT_EQ(msg, cit->d_advisory.choice().clusterMessage()); } BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_SNAPSHOT, qAssignAdvisory.sequenceNumber()); @@ -2097,7 +2097,7 @@ static void test13_rolloverUncommittedAdvisories() bmqp_ctrlmsg::ClusterMessage snapshotMsg; rc = cslIter->loadClusterMessage(&snapshotMsg); BMQTST_ASSERT_EQ(cslIter->loadClusterMessage(&snapshotMsg), 0); - ASSERT(snapshotMsg.choice().isLeaderAdvisoryValue()); + BMQTST_ASSERT(snapshotMsg.choice().isLeaderAdvisoryValue()); bmqp_ctrlmsg::LeaderAdvisory& snapshot = snapshotMsg.choice().leaderAdvisory(); @@ -2113,7 +2113,7 @@ static void test13_rolloverUncommittedAdvisories() .choice() .makeQueueAssignmentAdvisory(qAssignAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyRecordHeader(*cslIter, mqbc::ClusterStateRecordType::e_UPDATE, qAssignAdvisory.sequenceNumber()); @@ -2121,16 +2121,16 @@ static void test13_rolloverUncommittedAdvisories() bmqp_ctrlmsg::ClusterMessage msg; rc = cslIter->loadClusterMessage(&msg); BMQTST_ASSERT_EQ(rc, 0); - ASSERT(msg.choice().isQueueAssignmentAdvisoryValue()); + BMQTST_ASSERT(msg.choice().isQueueAssignmentAdvisoryValue()); BMQTST_ASSERT_EQ(msg.choice().queueAssignmentAdvisory(), qAssignAdvisory); BMQTST_ASSERT_EQ(cslIter->next(), 0); - ASSERT(cslIter->isValid()); + BMQTST_ASSERT(cslIter->isValid()); verifyLeaderAdvisoryCommit(*cslIter, qAssignAdvisory.sequenceNumber()); // Verify end of ledger BMQTST_ASSERT_EQ(cslIter->next(), 1); - ASSERT(!cslIter->isValid()); + BMQTST_ASSERT(!cslIter->isValid()); BSLS_ASSERT_OPT(obj->close() == 0); } diff --git a/src/groups/mqb/mqbc/mqbc_incoreclusterstateledgeriterator.t.cpp b/src/groups/mqb/mqbc/mqbc_incoreclusterstateledgeriterator.t.cpp index 21e3493ef..c513d1875 100644 --- a/src/groups/mqb/mqbc/mqbc_incoreclusterstateledgeriterator.t.cpp +++ b/src/groups/mqb/mqbc/mqbc_incoreclusterstateledgeriterator.t.cpp @@ -405,12 +405,12 @@ static void test1_breathingTest() } mqbc::IncoreClusterStateLedgerIterator incoreCslIt(tester.ledger()); - ASSERT(!incoreCslIt.isValid()); + BMQTST_ASSERT(!incoreCslIt.isValid()); // Iterate through each record in the ledger for (size_t idx = 0; idx < k_NUM_DATA; ++idx) { BMQTST_ASSERT_EQ(incoreCslIt.next(), 0); - ASSERT(incoreCslIt.isValid()); + BMQTST_ASSERT(incoreCslIt.isValid()); const Test& test = k_DATA[idx]; const mqbc::ClusterStateRecordHeader& header = incoreCslIt.header(); @@ -443,7 +443,7 @@ static void test1_breathingTest() } BMQTST_ASSERT_EQ(incoreCslIt.next(), 1); // 1 means end of ledger - ASSERT(!incoreCslIt.isValid()); + BMQTST_ASSERT(!incoreCslIt.isValid()); } // ============================================================================ diff --git a/src/groups/mqb/mqbc/mqbc_storagemanager.t.cpp b/src/groups/mqb/mqbc/mqbc_storagemanager.t.cpp index 951936fa3..2508f7cf1 100644 --- a/src/groups/mqb/mqbc/mqbc_storagemanager.t.cpp +++ b/src/groups/mqb/mqbc/mqbc_storagemanager.t.cpp @@ -244,7 +244,7 @@ struct TestHelper { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() != selfNodeId) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -263,7 +263,7 @@ struct TestHelper { else { // Make sure that primary node does not end up receiving // replicaStateRequest. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -290,7 +290,7 @@ struct TestHelper { if (replicaCit->second.sequenceNumber() == selfSeqNum.sequenceNumber()) { // No data chunk was sent - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); continue; // CONTINUE } @@ -298,7 +298,7 @@ struct TestHelper { // Data chunks were sent BMQTST_ASSERT_LT(replicaCit->second.sequenceNumber(), selfSeqNum.sequenceNumber()); - ASSERT(cit->second->waitFor(2, false)); + BMQTST_ASSERT(cit->second->waitFor(2, false)); // Verify data chunks // @@ -373,11 +373,11 @@ struct TestHelper { // TODO // bmqu::BlobObjectProxy record(&blob, // pos); - // ASSERT(record.isSet()); + // BMQTST_ASSERT(record.isSet()); // bmqu::BlobObjectProxy recordHdr(&blob, // pos); - // ASSERT(recordHdr.isSet()); + // BMQTST_ASSERT(recordHdr.isSet()); // PV("XXM: " << currSeqNum << ", " << recordHdr->type()); /* @@ -403,7 +403,7 @@ struct TestHelper { else { // Make sure that primary node does not end up receiving // data chunks or send it to upto date replicas. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -443,8 +443,10 @@ struct TestHelper { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == primaryNodeId) { - ASSERT(cit->second->waitFor(expectedNumDataChunks, false)); - // ASSERT(!cit->second->waitFor(expectedNumDataChunks + 1, + BMQTST_ASSERT( + cit->second->waitFor(expectedNumDataChunks, false)); + // BMQTST_ASSERT(!cit->second->waitFor(expectedNumDataChunks + + // 1, // false)); /* // Verify data chunks @@ -481,7 +483,7 @@ struct TestHelper { else { // Make sure that replica node does not send chunks to anyone // except primary. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -510,7 +512,7 @@ struct TestHelper { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == highestSeqNumNodeId) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -523,7 +525,7 @@ struct TestHelper { else { // Make sure that no other node except highestSeqNumNodeId // receives replicaDataRequest of type PULL. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -550,7 +552,7 @@ struct TestHelper { ++cit) { if (destinationReplicas.find(cit->first->nodeId()) != destinationReplicas.end()) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -565,7 +567,7 @@ struct TestHelper { else { // Make sure that primary node does not end up receiving // data chunks or send it to upto date replicas. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -586,7 +588,7 @@ struct TestHelper { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == rogueNodeId) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -598,7 +600,7 @@ struct TestHelper { else { // Make sure that no other node except the rogue node ends up // receiving failure replicaStateResponse. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -619,7 +621,7 @@ struct TestHelper { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == rogueNodeId) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -631,7 +633,7 @@ struct TestHelper { else { // Make sure that no other node except the rogue node ends up // receiving failure primaryStateResponse. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -656,7 +658,7 @@ struct TestHelper { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == primaryNodeId) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -669,7 +671,7 @@ struct TestHelper { else { // Make sure that other replica nodes dont receive // primaryStateRequest. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } @@ -694,7 +696,7 @@ struct TestHelper { cit != d_cluster_mp->_channels().cend(); ++cit) { if (cit->first->nodeId() == primaryNodeId) { - ASSERT(cit->second->waitFor(1, false)); + BMQTST_ASSERT(cit->second->waitFor(1, false)); bmqp_ctrlmsg::ControlMessage message; mqbc::ClusterUtil::extractMessage( @@ -707,7 +709,7 @@ struct TestHelper { else { // Make sure that other replica nodes dont receive // primaryStateRequest. - ASSERT(!cit->second->waitFor(1, false)); + BMQTST_ASSERT(!cit->second->waitFor(1, false)); } } } diff --git a/src/groups/mqb/mqbcfg/mqbcfg_brokerconfig.t.cpp b/src/groups/mqb/mqbcfg/mqbcfg_brokerconfig.t.cpp index a80c22f88..15bce5939 100644 --- a/src/groups/mqb/mqbcfg/mqbcfg_brokerconfig.t.cpp +++ b/src/groups/mqb/mqbcfg/mqbcfg_brokerconfig.t.cpp @@ -32,13 +32,13 @@ using namespace BloombergLP; BMQTST_TEST(breathing) { - ASSERT_SAFE_FAIL(mqbcfg::BrokerConfig::get()); + BMQTST_ASSERT_SAFE_FAIL(mqbcfg::BrokerConfig::get()); mqbcfg::AppConfig config; mqbcfg::BrokerConfig::set(config); BMQTST_ASSERT_EQ(&mqbcfg::BrokerConfig::get(), &config); - ASSERT_SAFE_FAIL(mqbcfg::BrokerConfig::set(config)); + BMQTST_ASSERT_SAFE_FAIL(mqbcfg::BrokerConfig::set(config)); } // ============================================================================ diff --git a/src/groups/mqb/mqbi/mqbi_queueengine.t.cpp b/src/groups/mqb/mqbi/mqbi_queueengine.t.cpp index 6b06c32d8..70dc9fed3 100644 --- a/src/groups/mqb/mqbi/mqbi_queueengine.t.cpp +++ b/src/groups/mqb/mqbi/mqbi_queueengine.t.cpp @@ -57,9 +57,9 @@ static void test1_breathingTest() bsl::string emptyString("", bmqtst::TestHelperUtil::allocator()); // App id - ASSERT(emptyString == bmqp::ProtocolUtil::k_NULL_APP_ID); - ASSERT(emptyString != - bmqp_ctrlmsg::SubQueueIdInfo::DEFAULT_INITIALIZER_APP_ID); + BMQTST_ASSERT(emptyString == bmqp::ProtocolUtil::k_NULL_APP_ID); + BMQTST_ASSERT(emptyString != + bmqp_ctrlmsg::SubQueueIdInfo::DEFAULT_INITIALIZER_APP_ID); BMQTST_ASSERT_NE(bsl::string(bmqp::ProtocolUtil::k_DEFAULT_APP_ID, bmqtst::TestHelperUtil::allocator()), diff --git a/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp b/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp index 068c750c4..882c62437 100644 --- a/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp @@ -517,7 +517,7 @@ inline bmqt::EventBuilderResult::Enum Tester::build() bsl::shared_ptr payload_sp = d_blobSpPool.getObject(); bdlbb::BlobBuffer blobBuffer; - ASSERT(0 != payload_sp->factory()); + BMQTST_ASSERT(0 != payload_sp->factory()); payload_sp->factory()->allocate(&blobBuffer); setContent(&blobBuffer); @@ -650,7 +650,7 @@ inline size_t Tester::verify( itHistoryEvents.load(eventHistory); - ASSERT(itHistoryEvents.isValid()); + BMQTST_ASSERT(itHistoryEvents.isValid()); while (itHistoryEvents.next() == 1) { if (itEvents.next() != 1) { diff --git a/src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp b/src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp index 430f4eed5..5af6e7a16 100644 --- a/src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp @@ -226,13 +226,13 @@ static void test1_ClusterObserver() // NOTE: 'ClusterObserver' is purposely not a pure protocol, each method // has a default no-op implementation. - // ASSERT(testObj.testAbstract()); + // BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); @@ -293,13 +293,13 @@ static void test2_ClusterNode() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); @@ -376,13 +376,13 @@ static void test3_Cluster() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); diff --git a/src/groups/mqb/mqbnet/mqbnet_dummysession.t.cpp b/src/groups/mqb/mqbnet/mqbnet_dummysession.t.cpp index 995766162..6114f19c6 100644 --- a/src/groups/mqb/mqbnet/mqbnet_dummysession.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_dummysession.t.cpp @@ -89,7 +89,7 @@ static void test1_BreathingTest() { PV("Ensure that processEvent asserts"); bmqp::Event event(bmqtst::TestHelperUtil::allocator()); - ASSERT_OPT_FAIL(obj.processEvent(event, &mockClusterNode)); + BMQTST_ASSERT_OPT_FAIL(obj.processEvent(event, &mockClusterNode)); } { // teardown is a no-op, just invoke it for coverage's sake diff --git a/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp b/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp index f7483002d..e67502666 100644 --- a/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_multirequestmanager.t.cpp @@ -111,9 +111,9 @@ const bsls::Types::Int64 WATERMARK = 64 * 1024 * 1024; struct Caller { static void callback(bool* called, const ReqContextSp& context) { - ASSERT(!*called); + BMQTST_ASSERT(!*called); *called = true; - ASSERT(context); + BMQTST_ASSERT(context); } }; @@ -370,10 +370,10 @@ Mes TestContext::createResponseCancel() Mes TestContext::getNextRequest(const ChannelSp& channel) { - ASSERT(channel->waitFor(1, true, bsls::TimeInterval(1))); + BMQTST_ASSERT(channel->waitFor(1, true, bsls::TimeInterval(1))); bmqio::TestChannel::WriteCall wc = channel->popWriteCall(); bmqp::Event ev(&wc.d_blob, d_allocator_p); - ASSERT(ev.isControlEvent()); + BMQTST_ASSERT(ev.isControlEvent()); Mes controlMessage(d_allocator_p); BMQTST_ASSERT_EQ(0, ev.loadControlEvent(&controlMessage)); return controlMessage; @@ -465,13 +465,13 @@ static void test1_contextTest() { ReqContextSp reqContext; - ASSERT_PASS(reqContext = bsl::make_shared( - bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_PASS(reqContext = bsl::make_shared( + bmqtst::TestHelperUtil::allocator())); ReqSp request = bsl::make_shared( bmqtst::TestHelperUtil::allocator()); TestContext::populateRequest(request); - ASSERT_PASS(reqContext->request() = request->request()); + BMQTST_ASSERT_PASS(reqContext->request() = request->request()); mqbmock::Cluster::ClusterNodeDefs defs = TestContext::generateNodeDefs( 5, @@ -492,7 +492,7 @@ static void test1_contextTest() Nodes nodes = TestContext::clusterNodes( &cluster, bmqtst::TestHelperUtil::allocator()); - ASSERT_PASS(reqContext->setDestinationNodes(nodes)); + BMQTST_ASSERT_PASS(reqContext->setDestinationNodes(nodes)); NodeResponses responses = reqContext->response(); BMQTST_ASSERT_EQ(nodes.size(), responses.size()); NodesIt nodesIt = nodes.begin(); @@ -507,7 +507,7 @@ static void test1_contextTest() // the default state BMQTST_ASSERT_EQ(reqContext->request(), Mes(bmqtst::TestHelperUtil::allocator())); - ASSERT(reqContext->response().empty()); + BMQTST_ASSERT(reqContext->response().empty()); } } @@ -521,15 +521,16 @@ static void test2_creatorsTest() { // Null RequestManager pointer - ASSERT_SAFE_FAIL( + BMQTST_ASSERT_SAFE_FAIL( MultiReqManagerType(NULL, bmqtst::TestHelperUtil::allocator())); } { // Success creation TestContext context(5, bmqtst::TestHelperUtil::allocator()); - ASSERT_PASS(MultiReqManagerType(context.manager().get(), - bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_PASS( + MultiReqManagerType(context.manager().get(), + bmqtst::TestHelperUtil::allocator())); } } @@ -553,7 +554,7 @@ static void test3_sendRequestTest() for (; it != context.nodes().end(); ++it) { ChannelSp ch = bsl::dynamic_pointer_cast( (*it)->channel().channel()); - ASSERT(ch); + BMQTST_ASSERT(ch); // checking that MultiRequestManager has really sent the requests Mes controlMessage = context.getNextRequest(ch); BMQTST_ASSERT_EQ(req->request().choice(), controlMessage.choice()); @@ -586,19 +587,19 @@ static void test4_handleResponseTest() for (; it != context.nodes().end(); ++it) { ChannelSp ch = bsl::dynamic_pointer_cast( (*it)->channel().channel()); - ASSERT(ch); + BMQTST_ASSERT(ch); // checking that MultiRequestManager has really sent the requests Mes controlMessage = context.getNextRequest(ch); responses.emplace_back( context.createResponse(controlMessage.rId().value())); } - ASSERT(!called); + BMQTST_ASSERT(!called); bsl::vector::const_iterator rIt = responses.begin(); for (; rIt != responses.end(); ++rIt) { context.manager()->processResponse(*rIt); } - ASSERT(called); + BMQTST_ASSERT(called); const NodeResponses& nodeResponses = context.context()->response(); NodeResponsesIt nodeIt = nodeResponses.begin(); @@ -620,9 +621,9 @@ static void test4_handleResponseTest() bdlf::PlaceHolders::_1)); context.sendRequest(req); - ASSERT(!called); + BMQTST_ASSERT(!called); context.advanceTime(SEND_REQUEST_TIMEOUT); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -681,7 +682,7 @@ static void test4_handleResponseTest() for (; it != context.nodes().end(); ++it) { ChannelSp ch = bsl::dynamic_pointer_cast( (*it)->channel().channel()); - ASSERT(ch); + BMQTST_ASSERT(ch); // checking that MultiRequestManager has really sent the requests Mes controlMessage = context.getNextRequest(ch); responses.emplace( @@ -699,10 +700,10 @@ static void test4_handleResponseTest() BMQTST_ASSERT_EQ(0, rc); } - ASSERT(!called); + BMQTST_ASSERT(!called); barrier.wait(); threadGroup.joinAll(); - ASSERT(called); + BMQTST_ASSERT(called); } } diff --git a/src/groups/mqb/mqbnet/mqbnet_negotiator.t.cpp b/src/groups/mqb/mqbnet/mqbnet_negotiator.t.cpp index db8b61ff1..684db5e7d 100644 --- a/src/groups/mqb/mqbnet/mqbnet_negotiator.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_negotiator.t.cpp @@ -124,13 +124,13 @@ static void test1_Negotiator() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); diff --git a/src/groups/mqb/mqbnet/mqbnet_session.t.cpp b/src/groups/mqb/mqbnet/mqbnet_session.t.cpp index 3fd0b35b1..0e67a4c3b 100644 --- a/src/groups/mqb/mqbnet/mqbnet_session.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_session.t.cpp @@ -158,13 +158,13 @@ static void test1_SessionEventProcessor() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); @@ -224,13 +224,13 @@ static void test2_Session() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); { PV("Verify that methods are public and virtual"); diff --git a/src/groups/mqb/mqbs/mqbs_datafileiterator.t.cpp b/src/groups/mqb/mqbs/mqbs_datafileiterator.t.cpp index 6c0787a3f..4692b2f49 100644 --- a/src/groups/mqb/mqbs/mqbs_datafileiterator.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_datafileiterator.t.cpp @@ -243,7 +243,7 @@ static void test2_forwardIteration() MESSAGES, k_NUM_MSGS); - ASSERT(p != 0); + BMQTST_ASSERT(p != 0); BMQTST_ASSERT_GT(mfd.fileSize(), 0ULL); // Create iterator @@ -284,8 +284,8 @@ static void test2_forwardIteration() BMQTST_ASSERT_EQ(i, k_NUM_MSGS); - ASSERT(it.nextRecord() != 1); - ASSERT(!it.isValid()); + BMQTST_ASSERT(it.nextRecord() != 1); + BMQTST_ASSERT(!it.isValid()); bmqtst::TestHelperUtil::allocator()->deallocate(p); } @@ -327,7 +327,7 @@ static void test3_reverseIteration() MESSAGES, k_NUM_MSGS); - ASSERT(p != 0); + BMQTST_ASSERT(p != 0); BMQTST_ASSERT_GT(mfd.fileSize(), 0ULL); // Create iterator @@ -353,14 +353,14 @@ static void test3_reverseIteration() } // 'it' is now pointing to 'D' (the 2nd-last record). - ASSERT(it.isValid()); - ASSERT(!it.isReverseMode()); + BMQTST_ASSERT(it.isValid()); + BMQTST_ASSERT(!it.isReverseMode()); it.flipDirection(); - ASSERT(it.isValid()); - ASSERT(it.isReverseMode()); - ASSERT(it.hasRecordSizeRemaining()); + BMQTST_ASSERT(it.isValid()); + BMQTST_ASSERT(it.isReverseMode()); + BMQTST_ASSERT(it.hasRecordSizeRemaining()); // Start iterating the records in the reverse direction. Note that we // will start with record 'D', which is 6th record, and thus, at index diff --git a/src/groups/mqb/mqbs/mqbs_filebackedstorage.t.cpp b/src/groups/mqb/mqbs/mqbs_filebackedstorage.t.cpp index 3be0df8b3..004ecdb17 100644 --- a/src/groups/mqb/mqbs/mqbs_filebackedstorage.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_filebackedstorage.t.cpp @@ -725,7 +725,7 @@ BMQTST_TEST(breathingTest) BMQTST_ASSERT_NE(storage.queue(), static_cast(0)); // Queue has been set via call to 'setQueue' - ASSERT_PASS(storage.flushStorage()); + BMQTST_ASSERT_PASS(storage.flushStorage()); // Does nothing, at the time of this writing BMQTST_ASSERT_EQ(storage.queueOpRecordHandles().empty(), true); @@ -798,7 +798,7 @@ BMQTST_TEST_F(Test, supportedOperations) mqbs::DataStoreRecordHandle handle; d_tester.insertDataStoreRecord(&handle, key, record); - ASSERT_OPT_PASS( + BMQTST_ASSERT_OPT_PASS( storage.processMessageRecord(guid, msgLen, refCount, handle)); } @@ -811,7 +811,7 @@ BMQTST_TEST_F(Test, supportedOperations) mqbs::DataStoreRecordHandle handle; d_tester.insertDataStoreRecord(&handle, key, record); - ASSERT_OPT_PASS( + BMQTST_ASSERT_OPT_PASS( storage.processConfirmRecord(guid, appKey, mqbs::ConfirmReason::e_CONFIRMED, @@ -827,10 +827,10 @@ BMQTST_TEST_F(Test, supportedOperations) mqbs::DataStoreRecordHandle handle; d_tester.insertDataStoreRecord(&handle, key, record); - ASSERT_OPT_PASS(storage.processDeletionRecord(guid)); + BMQTST_ASSERT_OPT_PASS(storage.processDeletionRecord(guid)); } - ASSERT_OPT_PASS(storage.purge(appKey)); + BMQTST_ASSERT_OPT_PASS(storage.purge(appKey)); } BMQTST_TEST_F(Test, put_noVirtualStorage) @@ -941,7 +941,7 @@ BMQTST_TEST_F(Test, get_noVirtualStorages) BMQTST_ASSERT_EQ(attributes.arrivalTimepoint(), 0LL); BMQTST_ASSERT_EQ(attributes.refCount(), static_cast(1)); - ASSERT(attributes.messagePropertiesInfo().isPresent()); + BMQTST_ASSERT(attributes.messagePropertiesInfo().isPresent()); } { @@ -957,7 +957,7 @@ BMQTST_TEST_F(Test, get_noVirtualStorages) BMQTST_ASSERT_EQ(attributes.arrivalTimepoint(), 0LL); BMQTST_ASSERT_EQ(attributes.refCount(), static_cast(1)); - ASSERT(attributes.messagePropertiesInfo().isPresent()); + BMQTST_ASSERT(attributes.messagePropertiesInfo().isPresent()); BMQTST_ASSERT_EQ( *(reinterpret_cast(appData->buffer(0).data())), i); @@ -1030,7 +1030,7 @@ BMQTST_TEST_F(Test, removeMessage) mqbi::StorageResult::e_SUCCESS); // Verify message was removed - ASSERT(!storage.hasMessage(guids[i])); + BMQTST_ASSERT(!storage.hasMessage(guids[i])); BMQTST_ASSERT_EQ(storage.numMessages(mqbu::StorageKey::k_NULL_KEY), k_MSG_COUNT - i - 1); BMQTST_ASSERT_EQ(static_cast(removedMsgSize), @@ -1090,18 +1090,18 @@ BMQTST_TEST_F(Test, hasVirtualStorage) BSLS_ASSERT_OPT(storage.numVirtualStorages() == 2); // Verify 'hasVirtualStorage' - ASSERT(storage.hasVirtualStorage(k_APP_ID1, &dummyAppKey)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_ID1, &dummyAppKey)); BMQTST_ASSERT_EQ(dummyAppKey, k_APP_KEY1); - ASSERT(storage.hasVirtualStorage(k_APP_ID2, &dummyAppKey)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_ID2, &dummyAppKey)); BMQTST_ASSERT_EQ(dummyAppKey, k_APP_KEY2); - ASSERT(!storage.hasVirtualStorage(k_APP_ID3, &dummyAppKey)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_ID3, &dummyAppKey)); BMQTST_ASSERT_EQ(dummyAppKey, mqbu::StorageKey::k_NULL_KEY); - ASSERT(storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); BMQTST_ASSERT_EQ(dummyAppId, k_APP_ID1); - ASSERT(storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); BMQTST_ASSERT_EQ(dummyAppId, k_APP_ID2); - ASSERT(!storage.hasVirtualStorage(k_APP_KEY3, &dummyAppId)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_KEY3, &dummyAppId)); BMQTST_ASSERT_EQ(dummyAppId, ""); } @@ -1126,15 +1126,15 @@ BMQTST_TEST_F(Test, removeVirtualStorage) storage.addVirtualStorage(errDescription, k_APP_ID2, k_APP_KEY2); // Verify removal - ASSERT(storage.removeVirtualStorage(k_APP_KEY1)); - ASSERT(!storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); + BMQTST_ASSERT(storage.removeVirtualStorage(k_APP_KEY1)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); BMQTST_ASSERT_EQ(storage.numVirtualStorages(), 1); - ASSERT(!storage.removeVirtualStorage(k_APP_KEY3)); + BMQTST_ASSERT(!storage.removeVirtualStorage(k_APP_KEY3)); BMQTST_ASSERT_EQ(storage.numVirtualStorages(), 1); - ASSERT(storage.removeVirtualStorage(k_APP_KEY2)); - ASSERT(!storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); + BMQTST_ASSERT(storage.removeVirtualStorage(k_APP_KEY2)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); BMQTST_ASSERT_EQ(storage.numVirtualStorages(), 0); } @@ -1375,7 +1375,7 @@ BMQTST_TEST(get_withVirtualStorages) static_cast(15)); BMQTST_ASSERT_EQ(attributes.arrivalTimepoint(), 0LL); - ASSERT(attributes.messagePropertiesInfo().isPresent()); + BMQTST_ASSERT(attributes.messagePropertiesInfo().isPresent()); BMQTST_ASSERT_EQ(*(reinterpret_cast(appData->buffer(0).data())), 15); BMQTST_ASSERT_EQ(storage.removeAll(mqbu::StorageKey::k_NULL_KEY), @@ -1809,11 +1809,11 @@ BMQTST_TEST_F(Test, addQueueOpRecordHandle) mqbs::ReplicatedStorage& storage = d_tester.storage(); - ASSERT(storage.queueOpRecordHandles().empty()); + BMQTST_ASSERT(storage.queueOpRecordHandles().empty()); storage.addQueueOpRecordHandle(handle); - ASSERT(storage.queueOpRecordHandles().size() == 1U); - ASSERT(storage.queueOpRecordHandles()[0] == handle); + BMQTST_ASSERT(storage.queueOpRecordHandles().size() == 1U); + BMQTST_ASSERT(storage.queueOpRecordHandles()[0] == handle); } BMQTST_TEST_F(Test, doNotRecordLastConfirmInPriorityMode) diff --git a/src/groups/mqb/mqbs/mqbs_fileset.t.cpp b/src/groups/mqb/mqbs/mqbs_fileset.t.cpp index d2d0615f2..be4daa2b8 100644 --- a/src/groups/mqb/mqbs/mqbs_fileset.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_fileset.t.cpp @@ -52,9 +52,9 @@ static void test1_breathingTest() // Default constructor mqbs::FileSet obj(static_cast(0), bmqtst::TestHelperUtil::allocator()); - ASSERT_SAFE_PASS(new (&obj) - mqbs::FileSet(static_cast(0), - bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_SAFE_PASS( + new (&obj) mqbs::FileSet(static_cast(0), + bmqtst::TestHelperUtil::allocator())); BMQTST_ASSERT_EQ(obj.d_store_p, static_cast(0)); BMQTST_ASSERT_EQ(obj.d_dataFileKey.isNull(), true); diff --git a/src/groups/mqb/mqbs/mqbs_filestoreprotocol.t.cpp b/src/groups/mqb/mqbs/mqbs_filestoreprotocol.t.cpp index 0f9ff3704..0fc143f03 100644 --- a/src/groups/mqb/mqbs/mqbs_filestoreprotocol.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_filestoreprotocol.t.cpp @@ -300,12 +300,14 @@ static void test1_breathingTest() bmqt::CompressionAlgorithmType::e_ZLIB) .setMagic(0xdeadbeef); BMQTST_ASSERT_EQ(fh2.refCount(), refCount); - ASSERT(fh2.queueKey() == - mqbu::StorageKey(mqbu::StorageKey::BinaryRepresentation(), - "abcde")); - ASSERT(fh2.fileKey() == - mqbu::StorageKey(mqbu::StorageKey::BinaryRepresentation(), - "12345")); + BMQTST_ASSERT( + fh2.queueKey() == + mqbu::StorageKey(mqbu::StorageKey::BinaryRepresentation(), + "abcde")); + BMQTST_ASSERT( + fh2.fileKey() == + mqbu::StorageKey(mqbu::StorageKey::BinaryRepresentation(), + "12345")); BMQTST_ASSERT_EQ(fh2.messageOffsetDwords(), 1000000U); BMQTST_ASSERT_EQ(fh2.messageGUID(), bmqt::MessageGUID()); BMQTST_ASSERT_EQ(fh2.crc32c(), 987654321U); diff --git a/src/groups/mqb/mqbs/mqbs_filestoreprotocolutil.t.cpp b/src/groups/mqb/mqbs/mqbs_filestoreprotocolutil.t.cpp index d4556af6a..ca37304b8 100644 --- a/src/groups/mqb/mqbs/mqbs_filestoreprotocolutil.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_filestoreprotocolutil.t.cpp @@ -740,11 +740,12 @@ static void jobForThreadPool(const Results* testData, bslmt::Barrier* barrier) bdlde::Md5::Md5Digest buffer; int rc = -1; - ASSERT_PASS(rc = mqbs::FileStoreProtocolUtil::calculateMd5Digest( - &buffer, - localBlob, - startPos, - source.size())); + BMQTST_ASSERT_PASS( + rc = mqbs::FileStoreProtocolUtil::calculateMd5Digest( + &buffer, + localBlob, + startPos, + source.size())); BMQTST_ASSERT_EQ(0, rc); bsl::string result(buffer.buffer(), MD5_DIGEST_BYTES, @@ -781,7 +782,7 @@ static void test5_calculateMd5Digest() { // Empty buffer. - ASSERT_FAIL( + BMQTST_ASSERT_FAIL( mqbs::FileStoreProtocolUtil::calculateMd5Digest(0, blob, startPos, @@ -803,12 +804,12 @@ static void test5_calculateMd5Digest() { // startPos out of blob. bdlde::Md5::Md5Digest buffer; - ASSERT_FAIL(mqbs::FileStoreProtocolUtil::calculateMd5Digest( + BMQTST_ASSERT_FAIL(mqbs::FileStoreProtocolUtil::calculateMd5Digest( &buffer, blob, bmqu::BlobPosition(0, data.size() + 1), data.size())); - ASSERT_FAIL(mqbs::FileStoreProtocolUtil::calculateMd5Digest( + BMQTST_ASSERT_FAIL(mqbs::FileStoreProtocolUtil::calculateMd5Digest( &buffer, blob, bmqu::BlobPosition(1, 1), @@ -818,10 +819,11 @@ static void test5_calculateMd5Digest() { // Zero Length. bdlde::Md5::Md5Digest buffer; - ASSERT_FAIL(mqbs::FileStoreProtocolUtil::calculateMd5Digest(&buffer, - blob, - startPos, - 0)); + BMQTST_ASSERT_FAIL( + mqbs::FileStoreProtocolUtil::calculateMd5Digest(&buffer, + blob, + startPos, + 0)); } { diff --git a/src/groups/mqb/mqbs/mqbs_inmemorystorage.t.cpp b/src/groups/mqb/mqbs/mqbs_inmemorystorage.t.cpp index 291533d0e..278a06670 100644 --- a/src/groups/mqb/mqbs/mqbs_inmemorystorage.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_inmemorystorage.t.cpp @@ -414,7 +414,7 @@ BMQTST_TEST(breathingTest) BMQTST_ASSERT_NE(storage.queue(), static_cast(0)); // Queue has been set via call to 'setQueue' - ASSERT_PASS(storage.flushStorage()); + BMQTST_ASSERT_PASS(storage.flushStorage()); // Does nothing, at the time of this writing BMQTST_ASSERT_EQ(storage.queueOpRecordHandles().empty(), true); @@ -483,15 +483,15 @@ BMQTST_TEST_F(Test, unsupportedOperations) mqbs::DataStoreRecordHandle handle; - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( storage.processMessageRecord(guid, msgLen, refCount, handle)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( storage.processConfirmRecord(guid, appKey, mqbs::ConfirmReason::e_CONFIRMED, handle)); - ASSERT_OPT_FAIL(storage.processDeletionRecord(guid)); - ASSERT_OPT_FAIL(storage.purge(appKey)); + BMQTST_ASSERT_OPT_FAIL(storage.processDeletionRecord(guid)); + BMQTST_ASSERT_OPT_FAIL(storage.purge(appKey)); } BMQTST_TEST_F(Test, put_noVirtualStorage) @@ -602,7 +602,7 @@ BMQTST_TEST_F(Test, get_noVirtualStorages) BMQTST_ASSERT_EQ(attributes.arrivalTimepoint(), 0LL); BMQTST_ASSERT_EQ(attributes.refCount(), static_cast(1)); - ASSERT(attributes.messagePropertiesInfo().isPresent()); + BMQTST_ASSERT(attributes.messagePropertiesInfo().isPresent()); } { @@ -618,7 +618,7 @@ BMQTST_TEST_F(Test, get_noVirtualStorages) BMQTST_ASSERT_EQ(attributes.arrivalTimepoint(), 0LL); BMQTST_ASSERT_EQ(attributes.refCount(), static_cast(1)); - ASSERT(attributes.messagePropertiesInfo().isPresent()); + BMQTST_ASSERT(attributes.messagePropertiesInfo().isPresent()); BMQTST_ASSERT_EQ( *(reinterpret_cast(appData->buffer(0).data())), i); @@ -691,7 +691,7 @@ BMQTST_TEST_F(Test, removeMessage) mqbi::StorageResult::e_SUCCESS); // Verify message was removed - ASSERT(!storage.hasMessage(guids[i])); + BMQTST_ASSERT(!storage.hasMessage(guids[i])); BMQTST_ASSERT_EQ(storage.numMessages(mqbu::StorageKey::k_NULL_KEY), k_MSG_COUNT - i - 1); BMQTST_ASSERT_EQ(static_cast(removedMsgSize), @@ -751,18 +751,18 @@ BMQTST_TEST_F(Test, hasVirtualStorage) BSLS_ASSERT_OPT(storage.numVirtualStorages() == 2); // Verify 'hasVirtualStorage' - ASSERT(storage.hasVirtualStorage(k_APP_ID1, &dummyAppKey)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_ID1, &dummyAppKey)); BMQTST_ASSERT_EQ(dummyAppKey, k_APP_KEY1); - ASSERT(storage.hasVirtualStorage(k_APP_ID2, &dummyAppKey)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_ID2, &dummyAppKey)); BMQTST_ASSERT_EQ(dummyAppKey, k_APP_KEY2); - ASSERT(!storage.hasVirtualStorage(k_APP_ID3, &dummyAppKey)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_ID3, &dummyAppKey)); BMQTST_ASSERT_EQ(dummyAppKey, mqbu::StorageKey::k_NULL_KEY); - ASSERT(storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); BMQTST_ASSERT_EQ(dummyAppId, k_APP_ID1); - ASSERT(storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); + BMQTST_ASSERT(storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); BMQTST_ASSERT_EQ(dummyAppId, k_APP_ID2); - ASSERT(!storage.hasVirtualStorage(k_APP_KEY3, &dummyAppId)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_KEY3, &dummyAppId)); BMQTST_ASSERT_EQ(dummyAppId, ""); } @@ -787,15 +787,15 @@ BMQTST_TEST_F(Test, removeVirtualStorage) storage.addVirtualStorage(errDescription, k_APP_ID2, k_APP_KEY2); // Verify removal - ASSERT(storage.removeVirtualStorage(k_APP_KEY1)); - ASSERT(!storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); + BMQTST_ASSERT(storage.removeVirtualStorage(k_APP_KEY1)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_KEY1, &dummyAppId)); BMQTST_ASSERT_EQ(storage.numVirtualStorages(), 1); - ASSERT(!storage.removeVirtualStorage(k_APP_KEY3)); + BMQTST_ASSERT(!storage.removeVirtualStorage(k_APP_KEY3)); BMQTST_ASSERT_EQ(storage.numVirtualStorages(), 1); - ASSERT(storage.removeVirtualStorage(k_APP_KEY2)); - ASSERT(!storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); + BMQTST_ASSERT(storage.removeVirtualStorage(k_APP_KEY2)); + BMQTST_ASSERT(!storage.hasVirtualStorage(k_APP_KEY2, &dummyAppId)); BMQTST_ASSERT_EQ(storage.numVirtualStorages(), 0); } @@ -1039,7 +1039,7 @@ BMQTST_TEST(get_withVirtualStorages) static_cast(15)); BMQTST_ASSERT_EQ(attributes.arrivalTimepoint(), 0LL); BMQTST_ASSERT_EQ(attributes.refCount(), 2U); - ASSERT(attributes.messagePropertiesInfo().isPresent()); + BMQTST_ASSERT(attributes.messagePropertiesInfo().isPresent()); BMQTST_ASSERT_EQ(*(reinterpret_cast(appData->buffer(0).data())), 15); BMQTST_ASSERT_EQ(storage.removeAll(mqbu::StorageKey::k_NULL_KEY), @@ -1468,11 +1468,11 @@ BMQTST_TEST_F(Test, addQueueOpRecordHandle) mqbs::ReplicatedStorage& storage = d_tester.storage(); - ASSERT(storage.queueOpRecordHandles().empty()); + BMQTST_ASSERT(storage.queueOpRecordHandles().empty()); storage.addQueueOpRecordHandle(handle); - ASSERT(storage.queueOpRecordHandles().size() == 1U); - ASSERT(storage.queueOpRecordHandles()[0] == handle); + BMQTST_ASSERT(storage.queueOpRecordHandles().size() == 1U); + BMQTST_ASSERT(storage.queueOpRecordHandles()[0] == handle); } // ============================================================================ diff --git a/src/groups/mqb/mqbs/mqbs_mappedfiledescriptor.t.cpp b/src/groups/mqb/mqbs/mqbs_mappedfiledescriptor.t.cpp index 47be04eba..571fc6d84 100644 --- a/src/groups/mqb/mqbs/mqbs_mappedfiledescriptor.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_mappedfiledescriptor.t.cpp @@ -55,7 +55,7 @@ static void test1_breathingTest() obj.mappingSize(), static_cast(obj.k_INVALID_MAPPING_SIZE)); BMQTST_ASSERT_EQ(obj.mapping(), obj.k_INVALID_MAPPING); - ASSERT(!obj.isValid()); + BMQTST_ASSERT(!obj.isValid()); } static void test2_operations() @@ -85,7 +85,7 @@ static void test2_operations() .setMapping(block.base()) .setMappingSize(block.size()); - ASSERT(obj.isValid()); + BMQTST_ASSERT(obj.isValid()); // Verify Manipulators- Accessors BMQTST_ASSERT_EQ(obj.fd(), fileDescriptor); @@ -120,7 +120,7 @@ static void test3_reset() .setMapping(block.base()) .setMappingSize(block.size()); - ASSERT(obj.isValid()); + BMQTST_ASSERT(obj.isValid()); // Verify Clear() obj.reset(); @@ -132,7 +132,7 @@ static void test3_reset() obj.mappingSize(), static_cast(obj.k_INVALID_MAPPING_SIZE)); BMQTST_ASSERT_EQ(obj.mapping(), obj.k_INVALID_MAPPING); - ASSERT(!obj.isValid()); + BMQTST_ASSERT(!obj.isValid()); } // ============================================================================ diff --git a/src/groups/mqb/mqbs/mqbs_qlistfileiterator.t.cpp b/src/groups/mqb/mqbs/mqbs_qlistfileiterator.t.cpp index 7daa8e9b4..7520c47de 100644 --- a/src/groups/mqb/mqbs/mqbs_qlistfileiterator.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_qlistfileiterator.t.cpp @@ -617,7 +617,7 @@ static void test4_iteratorAppKeys() appIdsVec, queueKeys, appKeysVec); - ASSERT(p != 0); + BMQTST_ASSERT(p != 0); QlistFileIterator it(&mfd, fh); BMQTST_ASSERT_EQ(it.isValid(), true); diff --git a/src/groups/mqb/mqbs/mqbs_storageutil.t.cpp b/src/groups/mqb/mqbs/mqbs_storageutil.t.cpp index e02290ba3..c2a1566a8 100644 --- a/src/groups/mqb/mqbs/mqbs_storageutil.t.cpp +++ b/src/groups/mqb/mqbs/mqbs_storageutil.t.cpp @@ -108,9 +108,9 @@ static void test1_queueMessagesCountComparator() StorageUtil::QueueMessagesCount rhs2(tester.d_d2uri1, 10); StorageUtil::QueueMessagesCount rhs3(tester.d_d3uri1, 15); - ASSERT(StorageUtil::queueMessagesCountComparator(lhs, rhs1)); - ASSERT(!StorageUtil::queueMessagesCountComparator(lhs, rhs2)); - ASSERT(!StorageUtil::queueMessagesCountComparator(lhs, rhs3)); + BMQTST_ASSERT(StorageUtil::queueMessagesCountComparator(lhs, rhs1)); + BMQTST_ASSERT(!StorageUtil::queueMessagesCountComparator(lhs, rhs2)); + BMQTST_ASSERT(!StorageUtil::queueMessagesCountComparator(lhs, rhs3)); } static void test2_mergeQueueMessagesCountMap() diff --git a/src/groups/mqb/mqbsi/mqbsi_ledger.t.cpp b/src/groups/mqb/mqbsi/mqbsi_ledger.t.cpp index aacabe0cb..73e1e6d78 100644 --- a/src/groups/mqb/mqbsi/mqbsi_ledger.t.cpp +++ b/src/groups/mqb/mqbsi/mqbsi_ledger.t.cpp @@ -210,13 +210,13 @@ static void test1_ledger_protocol() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); } // ============================================================================ diff --git a/src/groups/mqb/mqbsi/mqbsi_log.t.cpp b/src/groups/mqb/mqbsi/mqbsi_log.t.cpp index b8d57e403..0f6984c93 100644 --- a/src/groups/mqb/mqbsi/mqbsi_log.t.cpp +++ b/src/groups/mqb/mqbsi/mqbsi_log.t.cpp @@ -209,13 +209,13 @@ static void test1_log_protocol() bmqtst::TestHelperUtil::verbosityLevel() > 2); PV("Verify that the protocol is abstract"); - ASSERT(testObj.testAbstract()); + BMQTST_ASSERT(testObj.testAbstract()); PV("Verify that there are no data members"); - ASSERT(testObj.testNoDataMembers()); + BMQTST_ASSERT(testObj.testNoDataMembers()); PV("Verify that the destructor is virtual"); - ASSERT(testObj.testVirtualDestructor()); + BMQTST_ASSERT(testObj.testVirtualDestructor()); } // ============================================================================ diff --git a/src/groups/mqb/mqbsl/mqbsl_ledger.t.cpp b/src/groups/mqb/mqbsl/mqbsl_ledger.t.cpp index a8b9b831b..219c4b1dc 100644 --- a/src/groups/mqb/mqbsl/mqbsl_ledger.t.cpp +++ b/src/groups/mqb/mqbsl/mqbsl_ledger.t.cpp @@ -428,8 +428,8 @@ static void test3_openMultipleLogsNoKeep() Tester::k_OLD_LOG_LEN, obsoleteRecordId), LedgerOpResult::e_LOG_NOT_FOUND); - ASSERT_OPT_FAIL(ledger->outstandingNumBytes(obsoleteLogId)); - ASSERT_OPT_FAIL(ledger->totalNumBytes(obsoleteLogId)); + BMQTST_ASSERT_OPT_FAIL(ledger->outstandingNumBytes(obsoleteLogId)); + BMQTST_ASSERT_OPT_FAIL(ledger->totalNumBytes(obsoleteLogId)); BSLS_ASSERT_OPT(ledger->close() == LedgerOpResult::e_SUCCESS); } diff --git a/src/groups/mqb/mqbsl/mqbsl_readwriteondisklog.t.cpp b/src/groups/mqb/mqbsl/mqbsl_readwriteondisklog.t.cpp index 11e9ea07b..d79c15c56 100644 --- a/src/groups/mqb/mqbsl/mqbsl_readwriteondisklog.t.cpp +++ b/src/groups/mqb/mqbsl/mqbsl_readwriteondisklog.t.cpp @@ -730,7 +730,7 @@ static void test10_aliasRaw() // Raw aliasing is not supported char entry[k_ENTRY_LENGTH]; void* entry_vp = entry; - ASSERT_FAIL(log.alias(&entry_vp, k_ENTRY_LENGTH, 0)); + BMQTST_ASSERT_FAIL(log.alias(&entry_vp, k_ENTRY_LENGTH, 0)); BSLS_ASSERT_OPT(log.close() == LogOpResult::e_SUCCESS); } @@ -755,7 +755,7 @@ static void test11_aliasBlob() // Blob aliasing is not supported bdlbb::Blob blob(g_bufferFactory_p, bmqtst::TestHelperUtil::allocator()); - ASSERT_FAIL(log.alias(&blob, k_ENTRY_LENGTH, 0)); + BMQTST_ASSERT_FAIL(log.alias(&blob, k_ENTRY_LENGTH, 0)); BSLS_ASSERT_OPT(log.close() == LogOpResult::e_SUCCESS); } diff --git a/src/groups/mqb/mqbstat/mqbstat_queuestats.t.cpp b/src/groups/mqb/mqbstat/mqbstat_queuestats.t.cpp index 813f6db05..65590a150 100644 --- a/src/groups/mqb/mqbstat/mqbstat_queuestats.t.cpp +++ b/src/groups/mqb/mqbstat/mqbstat_queuestats.t.cpp @@ -630,7 +630,7 @@ static void test5_appIdMetrics() BMQTST_ASSERT_EQ(1, sc->numSubcontexts()); const bmqst::StatContext* fooSc = sc->getSubcontext(k_APPID_FOO); - ASSERT(fooSc); + BMQTST_ASSERT(fooSc); } // Add event for non-configured appId "bar", this value should not reach to @@ -654,12 +654,12 @@ static void test5_appIdMetrics() BMQTST_ASSERT_EQ(2, sc->numSubcontexts()); const bmqst::StatContext* fooSc = sc->getSubcontext(k_APPID_FOO); - ASSERT(!fooSc); + BMQTST_ASSERT(!fooSc); const bmqst::StatContext* barSc = sc->getSubcontext(k_APPID_BAR); const bmqst::StatContext* bazSc = sc->getSubcontext(k_APPID_BAZ); - ASSERT(barSc); - ASSERT(bazSc); + BMQTST_ASSERT(barSc); + BMQTST_ASSERT(bazSc); } // Report some metrics and check that they reached subcontexts @@ -682,8 +682,8 @@ static void test5_appIdMetrics() const bmqst::StatContext* barSc = sc->getSubcontext(k_APPID_BAR); const bmqst::StatContext* bazSc = sc->getSubcontext(k_APPID_BAZ); - ASSERT(barSc); - ASSERT(bazSc); + BMQTST_ASSERT(barSc); + BMQTST_ASSERT(bazSc); BMQTST_ASSERT_EQ( 900, diff --git a/src/groups/mqb/mqbu/mqbu_capacitymeter.t.cpp b/src/groups/mqb/mqbu/mqbu_capacitymeter.t.cpp index ecf774b8b..e7b3533f5 100644 --- a/src/groups/mqb/mqbu/mqbu_capacitymeter.t.cpp +++ b/src/groups/mqb/mqbu/mqbu_capacitymeter.t.cpp @@ -151,7 +151,7 @@ static void test2_logStateChange() BSLS_ASSERT_OPT(nbMessagesAvailable == k_MSGS_HIGH_WATERMARK_VALUE); BSLS_ASSERT_OPT(nbBytesAvailable == 10); - ASSERT(observer.records().empty()); + BMQTST_ASSERT(observer.records().empty()); capacityMeter.commit(k_MSGS_HIGH_WATERMARK_VALUE, 10); @@ -161,12 +161,12 @@ static void test2_logStateChange() BMQTST_ASSERT_EQ(record.fixedFields().severity(), ball::Severity::ERROR); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( record, "ALARM \\[CAPACITY_STATE_HIGH_WATERMARK\\]", bmqtst::TestHelperUtil::allocator())); // This pattern is looked for to generate an alarm - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( record, "dummy.*Messages.*HIGH_WATERMARK", bmqtst::TestHelperUtil::allocator())); @@ -191,12 +191,12 @@ static void test2_logStateChange() BMQTST_ASSERT_EQ(observer.records()[0].fixedFields().severity(), ball::Severity::ERROR); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[0], "ALARM \\[CAPACITY_STATE_FULL\\]", bmqtst::TestHelperUtil::allocator())); // This pattern is looked for to generate an alarm - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[0], "dummy.*Messages.*FULL", bmqtst::TestHelperUtil::allocator())); @@ -221,12 +221,12 @@ static void test2_logStateChange() BMQTST_ASSERT_EQ(observer.records().size(), 1U); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[0], "ALARM \\[CAPACITY_STATE_HIGH_WATERMARK\\]", bmqtst::TestHelperUtil::allocator())); // This pattern is looked for to generate an alarm - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[0], "dummy.*Messages.*HIGH_WATERMARK", bmqtst::TestHelperUtil::allocator())); @@ -238,12 +238,12 @@ static void test2_logStateChange() k_MSGS_HIGH_WATERMARK_VALUE, 10); BMQTST_ASSERT_EQ(observer.records().size(), 2U); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[1], "ALARM \\[CAPACITY_STATE_FULL\\]", bmqtst::TestHelperUtil::allocator())); // This pattern is looked for to generate an alarm - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( observer.records()[1], "dummy.*Messages.*FULL", bmqtst::TestHelperUtil::allocator())); @@ -304,7 +304,7 @@ static void test3_enhancedLog() BSLS_ASSERT_OPT(nbMessagesAvailable == k_MSGS_HIGH_WATERMARK_VALUE); BSLS_ASSERT_OPT(nbBytesAvailable == 10); - ASSERT(observer.records().empty()); + BMQTST_ASSERT(observer.records().empty()); capacityMeter.commit(k_MSGS_HIGH_WATERMARK_VALUE, 10); @@ -313,12 +313,12 @@ static void test3_enhancedLog() const ball::Record& record = observer.records()[0]; BMQTST_ASSERT_EQ(record.fixedFields().severity(), ball::Severity::ERROR); - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( record, "ALARM \\[CAPACITY_STATE_HIGH_WATERMARK\\]", bmqtst::TestHelperUtil::allocator())); // Check log from callback - ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( + BMQTST_ASSERT(bmqtst::ScopedLogObserverUtil::recordMessageMatch( record, "Test enhanced storage Info", bmqtst::TestHelperUtil::allocator())); diff --git a/src/groups/mqb/mqbu/mqbu_exit.t.cpp b/src/groups/mqb/mqbu/mqbu_exit.t.cpp index e9c0832ee..bcc712407 100644 --- a/src/groups/mqb/mqbu/mqbu_exit.t.cpp +++ b/src/groups/mqb/mqbu/mqbu_exit.t.cpp @@ -364,7 +364,7 @@ static void test4_exit_terminate(int argc, char* argv[]) int status = -1; BMQTST_ASSERT_EQ(pid, waitpid(pid, &status, 0)); - ASSERT(WIFEXITED(status)); + BMQTST_ASSERT(WIFEXITED(status)); BMQTST_ASSERT_EQ(static_cast(test.d_reason), WEXITSTATUS(status)); } diff --git a/src/groups/mqb/mqbu/mqbu_loadbalancer.t.cpp b/src/groups/mqb/mqbu/mqbu_loadbalancer.t.cpp index e56800e6c..6550800e5 100644 --- a/src/groups/mqb/mqbu/mqbu_loadbalancer.t.cpp +++ b/src/groups/mqb/mqbu/mqbu_loadbalancer.t.cpp @@ -230,10 +230,10 @@ static void test4_forceAssociate() PV(":: Testing 'setProcessorForClient' with invalid processor"); // Negative testing, ensure an assertion is thrown if trying to assign to // an invalid processor - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( obj.setProcessorForClient(reinterpret_cast(4), k_NUM_PROCESSORS)); - ASSERT_OPT_FAIL( + BMQTST_ASSERT_OPT_FAIL( obj.setProcessorForClient(reinterpret_cast(4), -1)); } diff --git a/src/groups/mqb/mqbu/mqbu_resourceusagemonitor.t.cpp b/src/groups/mqb/mqbu/mqbu_resourceusagemonitor.t.cpp index 63f6efa44..3acc8dff2 100644 --- a/src/groups/mqb/mqbu/mqbu_resourceusagemonitor.t.cpp +++ b/src/groups/mqb/mqbu/mqbu_resourceusagemonitor.t.cpp @@ -2819,7 +2819,7 @@ static void test10_usageExample() bool highWatermarkLimitReached = monitor.state() != RUMState::e_STATE_NORMAL; - ASSERT(!highWatermarkLimitReached); + BMQTST_ASSERT(!highWatermarkLimitReached); if (!highWatermarkLimitReached) { // Send message(s)