From 73e2eda899eee182a740d74d26610c75758614c5 Mon Sep 17 00:00:00 2001 From: Taylor Foxhall Date: Tue, 3 Dec 2024 13:36:44 -0500 Subject: [PATCH] Rename gtest conflicting test macros bmqtst provides several gtest-like compatibility macros, but this prevents us from using gtest or gmock directly because it uses the exact same names as the test macros from that library. Since we want to support at least using gmock in our tests, we rename them to avoid conflict. Signed-off-by: Taylor Foxhall --- ...qstoragetool_commandprocessorfactory.t.cpp | 3 +- ..._bmqstoragetool_journalfileprocessor.t.cpp | 38 +- ...m_bmqstoragetool_searchresultfactory.t.cpp | 2 +- .../bmq/bmqa/bmqa_abstractsession.t.cpp | 237 ++--- .../bmq/bmqa/bmqa_closequeuestatus.t.cpp | 4 +- .../bmq/bmqa/bmqa_configurequeuestatus.t.cpp | 4 +- src/groups/bmq/bmqa/bmqa_message.t.cpp | 54 +- src/groups/bmq/bmqa/bmqa_messageevent.t.cpp | 3 +- .../bmq/bmqa/bmqa_messageeventbuilder.t.cpp | 2 +- src/groups/bmq/bmqa/bmqa_mocksession.t.cpp | 10 +- .../bmq/bmqa/bmqa_openqueuestatus.t.cpp | 4 +- src/groups/bmq/bmqc/bmqc_array.t.cpp | 58 +- .../bmqc_monitoredqueue_bdlccfixedqueue.t.cpp | 2 +- src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp | 12 +- .../bmqc/bmqc_orderedhashmapwithhistory.t.cpp | 6 +- src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp | 14 +- .../bmq/bmqeval/bmqeval_simpleevaluator.t.cpp | 14 +- .../bmqex_bdlmteventschedulerexecutor.t.cpp | 4 +- .../bmqex_bdlmtfixedthreadpoolexecutor.t.cpp | 4 +- ...ex_bdlmtmultiqueuethreadpoolexecutor.t.cpp | 4 +- .../bmqex/bmqex_bdlmtthreadpoolexecutor.t.cpp | 4 +- src/groups/bmq/bmqex/bmqex_bindutil.t.cpp | 12 +- .../bmq/bmqex/bmqex_executionpolicy.t.cpp | 24 +- .../bmq/bmqex/bmqex_executionutil.t.cpp | 235 ++--- src/groups/bmq/bmqex/bmqex_executor.t.cpp | 111 +- .../bmq/bmqex/bmqex_executortraits.t.cpp | 12 +- src/groups/bmq/bmqex/bmqex_future.t.cpp | 28 +- src/groups/bmq/bmqex/bmqex_promise.t.cpp | 10 +- .../bmq/bmqex/bmqex_sequentialcontext.t.cpp | 6 +- src/groups/bmq/bmqex/bmqex_strand.t.cpp | 12 +- .../bmq/bmqex/bmqex_systemexecutor.t.cpp | 24 +- .../bmq/bmqimp/bmqimp_application.t.cpp | 18 +- .../bmq/bmqimp/bmqimp_brokersession.t.cpp | 947 +++++++++--------- src/groups/bmq/bmqimp/bmqimp_event.t.cpp | 54 +- src/groups/bmq/bmqimp/bmqimp_eventqueue.h | 2 +- src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp | 10 +- src/groups/bmq/bmqimp/bmqimp_queue.t.cpp | 30 +- .../bmq/bmqimp/bmqimp_queuemanager.t.cpp | 86 +- src/groups/bmq/bmqio/bmqio_channelutil.t.cpp | 8 +- src/groups/bmq/bmqio/bmqio_ntcchannel.t.cpp | 10 +- .../bmq/bmqio/bmqio_ntcchannelfactory.t.cpp | 30 +- .../bmqio_reconnectingchannelfactory.t.cpp | 38 +- src/groups/bmq/bmqio/bmqio_resolveutil.t.cpp | 8 +- .../bmqio/bmqio_resolvingchannelfactory.t.cpp | 10 +- .../bmq/bmqma/bmqma_countingallocator.t.cpp | 16 +- .../bmqma/bmqma_countingallocatorutil.t.cpp | 16 +- .../bmq/bmqp/bmqp_ackeventbuilder.t.cpp | 4 +- .../bmq/bmqp/bmqp_ackmessageiterator.t.cpp | 14 +- .../bmq/bmqp/bmqp_confirmeventbuilder.t.cpp | 4 +- .../bmqp/bmqp_confirmmessageiterator.t.cpp | 14 +- src/groups/bmq/bmqp/bmqp_event.t.cpp | 47 +- src/groups/bmq/bmqp/bmqp_eventutil.t.cpp | 8 +- .../bmq/bmqp/bmqp_messageguidgenerator.t.cpp | 4 +- .../bmq/bmqp/bmqp_messageproperties.t.cpp | 22 +- src/groups/bmq/bmqp/bmqp_optionsview.t.cpp | 62 +- src/groups/bmq/bmqp/bmqp_optionutil.t.cpp | 12 +- src/groups/bmq/bmqp/bmqp_protocol.t.cpp | 25 +- src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp | 53 +- .../bmq/bmqp/bmqp_puteventbuilder.t.cpp | 21 +- .../bmq/bmqp/bmqp_putmessageiterator.t.cpp | 2 +- src/groups/bmq/bmqp/bmqp_queueutil.t.cpp | 12 +- .../bmqp/bmqp_recoverymessageiterator.t.cpp | 22 +- .../bmq/bmqp/bmqp_rejecteventbuilder.t.cpp | 16 +- .../bmq/bmqp/bmqp_rejectmessageiterator.t.cpp | 14 +- src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp | 115 ++- .../bmq/bmqp/bmqp_schemaeventbuilder.t.cpp | 10 +- .../bmq/bmqp/bmqp_schemagenerator.t.cpp | 8 +- src/groups/bmq/bmqp/bmqp_schemalearner.t.cpp | 48 +- .../bmq/bmqp/bmqp_storageeventbuilder.t.cpp | 2 +- .../bmqp/bmqp_storagemessageiterator.t.cpp | 10 +- src/groups/bmq/bmqpi/bmqpi_dtcontext.t.cpp | 6 +- src/groups/bmq/bmqpi/bmqpi_dtspan.t.cpp | 6 +- src/groups/bmq/bmqpi/bmqpi_dttracer.t.cpp | 6 +- .../bmq/bmqpi/bmqpi_hosthealthmonitor.t.cpp | 6 +- src/groups/bmq/bmqst/bmqst_printutil.t.cpp | 24 +- src/groups/bmq/bmqst/bmqst_statcontext.t.cpp | 70 +- src/groups/bmq/bmqst/bmqst_tableutil.t.cpp | 10 +- src/groups/bmq/bmqst/bmqst_testutil.h | 61 +- .../bmq/bmqsys/bmqsys_statmonitor.t.cpp | 40 +- src/groups/bmq/bmqsys/bmqsys_time.t.cpp | 20 +- src/groups/bmq/bmqt/bmqt_messageguid.t.cpp | 6 +- src/groups/bmq/bmqt/bmqt_queueflags.t.cpp | 4 +- src/groups/bmq/bmqt/bmqt_queueoptions.t.cpp | 50 +- src/groups/bmq/bmqt/bmqt_uri.t.cpp | 4 +- .../bmq/bmqtsk/bmqtsk_logcontroller.t.cpp | 2 +- .../bmq/bmqtst/bmqtst_scopedlogobserver.t.cpp | 26 +- src/groups/bmq/bmqtst/bmqtst_testhelper.h | 35 +- .../bmq/bmqu/bmqu_atomicvalidator.t.cpp | 48 +- src/groups/bmq/bmqu/bmqu_blob.t.cpp | 4 +- src/groups/bmq/bmqu/bmqu_blobiterator.t.cpp | 2 +- .../bmq/bmqu/bmqu_blobobjectproxy.t.cpp | 66 +- src/groups/bmq/bmqu/bmqu_memoutstream.t.cpp | 2 +- src/groups/bmq/bmqu/bmqu_operationchain.t.cpp | 8 +- src/groups/bmq/bmqu/bmqu_printutil.t.cpp | 8 +- src/groups/bmq/bmqu/bmqu_sharedresource.t.cpp | 72 +- .../bmq/bmqu/bmqu_throttledaction.t.cpp | 2 +- src/groups/bmq/bmqu/bmqu_tlsbool.t.cpp | 8 +- src/groups/bmq/bmqu/bmqu_weakmemfn.t.cpp | 57 +- src/groups/bmq/bmqvt/bmqvt_propertybag.h | 2 +- src/groups/bmq/bmqvt/bmqvt_propertybag.t.cpp | 33 +- src/groups/bmq/bmqvt/bmqvt_valueorerror.t.cpp | 40 +- src/groups/mqb/mqba/mqba_clientsession.t.cpp | 90 +- src/groups/mqb/mqba/mqba_dispatcher.t.cpp | 42 +- src/groups/mqb/mqbblp/mqbblp_pushstream.t.cpp | 12 +- .../mqbblp_queueconsumptionmonitor.t.cpp | 10 +- .../mqb/mqbblp/mqbblp_relayqueueengine.t.cpp | 2 +- .../mqb/mqbblp/mqbblp_rootqueueengine.t.cpp | 39 +- src/groups/mqb/mqbblp/mqbblp_routers.t.cpp | 4 +- .../mqb/mqbc/mqbc_clusterstateledger.t.cpp | 6 +- .../mqbc_clusterstateledgeriterator.t.cpp | 6 +- .../mqb/mqbc/mqbc_clusterstatemanager.t.cpp | 44 +- .../mqbc/mqbc_incoreclusterstateledger.t.cpp | 128 +-- ...qbc_incoreclusterstateledgeriterator.t.cpp | 6 +- src/groups/mqb/mqbc/mqbc_storagemanager.t.cpp | 46 +- .../mqb/mqbcfg/mqbcfg_brokerconfig.t.cpp | 4 +- src/groups/mqb/mqbi/mqbi_queueengine.t.cpp | 6 +- src/groups/mqb/mqbnet/mqbnet_channel.t.cpp | 2 +- src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp | 18 +- .../mqb/mqbnet/mqbnet_dummysession.t.cpp | 2 +- .../mqbnet/mqbnet_multirequestmanager.t.cpp | 43 +- src/groups/mqb/mqbnet/mqbnet_negotiator.t.cpp | 6 +- src/groups/mqb/mqbnet/mqbnet_session.t.cpp | 12 +- .../mqb/mqbs/mqbs_datafileiterator.t.cpp | 18 +- .../mqb/mqbs/mqbs_filebackedstorage.t.cpp | 46 +- src/groups/mqb/mqbs/mqbs_fileset.t.cpp | 6 +- .../mqb/mqbs/mqbs_filestoreprotocol.t.cpp | 14 +- .../mqb/mqbs/mqbs_filestoreprotocolutil.t.cpp | 26 +- .../mqb/mqbs/mqbs_inmemorystorage.t.cpp | 46 +- .../mqb/mqbs/mqbs_mappedfiledescriptor.t.cpp | 8 +- .../mqb/mqbs/mqbs_qlistfileiterator.t.cpp | 2 +- src/groups/mqb/mqbs/mqbs_storageutil.t.cpp | 6 +- src/groups/mqb/mqbsi/mqbsi_ledger.t.cpp | 6 +- src/groups/mqb/mqbsi/mqbsi_log.t.cpp | 6 +- src/groups/mqb/mqbsl/mqbsl_ledger.t.cpp | 4 +- .../mqb/mqbsl/mqbsl_readwriteondisklog.t.cpp | 4 +- .../mqb/mqbstat/mqbstat_queuestats.t.cpp | 12 +- src/groups/mqb/mqbu/mqbu_capacitymeter.t.cpp | 24 +- src/groups/mqb/mqbu/mqbu_exit.t.cpp | 2 +- src/groups/mqb/mqbu/mqbu_loadbalancer.t.cpp | 4 +- .../mqb/mqbu/mqbu_resourceusagemonitor.t.cpp | 2 +- 140 files changed, 2187 insertions(+), 2094 deletions(-) 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 050bd052d..4b75d03a0 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 } @@ -362,11 +362,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); } @@ -486,7 +486,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); @@ -540,7 +540,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); @@ -585,11 +585,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") @@ -622,11 +622,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 922e2aecb..4a88a3dc6 100644 --- a/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp @@ -279,7 +279,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 98f3bd40b..0c3cc6216 100644 --- a/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp @@ -193,7 +193,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; @@ -252,7 +252,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); @@ -262,7 +262,7 @@ void sessionEventHandler( bool waitRealTime(bslmt::TimedSemaphore* sem) { - ASSERT(sem); + BMQTST_ASSERT(sem); const bsls::TimeInterval k_REALTIME_TIMEOUT = bsls::TimeInterval(15); @@ -282,7 +282,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()) { @@ -798,7 +798,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. @@ -952,10 +952,10 @@ void TestSession::startAndConnect(bool expectHostUnhealthy) setChannel(); if (expectHostUnhealthy) { - ASSERT(waitHostUnhealthyEvent()); + BMQTST_ASSERT(waitHostUnhealthyEvent()); } - ASSERT(waitConnectedEvent()); + BMQTST_ASSERT(waitConnectedEvent()); PVVV_SAFE("Channel connected"); } @@ -1007,7 +1007,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); @@ -1157,14 +1157,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); @@ -1178,20 +1178,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); @@ -1227,8 +1228,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( @@ -1262,7 +1263,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 } @@ -1300,7 +1301,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 } @@ -1369,7 +1370,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); @@ -1395,7 +1396,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, @@ -1440,15 +1441,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); @@ -1476,8 +1478,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); @@ -1486,7 +1489,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); @@ -1504,7 +1507,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()); @@ -1512,21 +1515,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; } @@ -1536,7 +1539,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); @@ -1545,11 +1548,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); } @@ -1563,15 +1566,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); @@ -1580,13 +1584,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; } @@ -1608,7 +1612,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); @@ -1625,18 +1629,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); @@ -1646,21 +1650,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"); @@ -1673,7 +1677,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"); @@ -1681,7 +1685,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)); @@ -1702,17 +1706,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"); @@ -1766,41 +1770,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"); @@ -1810,22 +1814,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"); @@ -1912,14 +1916,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)); @@ -1939,7 +1943,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"); @@ -1975,7 +1979,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)); @@ -1987,7 +1991,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"); @@ -2003,7 +2007,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"); @@ -2028,13 +2032,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"); @@ -2043,14 +2047,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)); @@ -2112,12 +2116,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); @@ -2133,26 +2137,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 @@ -2171,7 +2175,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; @@ -2287,8 +2291,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( @@ -2299,12 +2303,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..."); @@ -2415,7 +2419,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); @@ -2426,12 +2430,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); @@ -2493,20 +2497,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: { @@ -2561,18 +2565,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)); } } @@ -2618,11 +2623,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); } @@ -2662,10 +2667,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 { @@ -2914,11 +2919,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() @@ -3002,7 +3007,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(); @@ -3120,10 +3125,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); @@ -3134,7 +3139,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); @@ -3145,9 +3150,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(), @@ -3167,9 +3172,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); @@ -3190,9 +3195,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); @@ -3389,7 +3394,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)); @@ -3400,15 +3405,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"); @@ -3429,17 +3435,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"); @@ -3449,7 +3456,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(), @@ -3549,7 +3556,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). @@ -3558,14 +3565,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)); @@ -3592,7 +3599,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(); @@ -3667,12 +3674,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"); @@ -3695,7 +3703,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"); @@ -3769,7 +3778,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)); @@ -3806,8 +3815,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"); @@ -3818,12 +3827,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"); @@ -3842,8 +3851,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"); @@ -3860,9 +3869,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"); @@ -4033,15 +4042,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); @@ -4078,7 +4087,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 @@ -4120,7 +4129,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); @@ -4139,10 +4148,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); @@ -4170,7 +4179,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); @@ -4229,8 +4238,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( @@ -4245,10 +4254,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() @@ -4297,16 +4306,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() @@ -4489,7 +4498,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)); @@ -4506,13 +4515,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(); @@ -4624,7 +4633,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)); @@ -4641,7 +4650,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); @@ -4653,7 +4662,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(); @@ -4739,7 +4748,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); @@ -4769,7 +4778,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); @@ -4787,7 +4796,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 @@ -4955,10 +4964,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); @@ -4977,7 +4987,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); } @@ -5062,36 +5072,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"); @@ -5110,23 +5120,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); } @@ -5963,7 +5973,7 @@ static void test25_sessionFsmTable() } PVV_SAFE("Waiting for empty transition table"); - ASSERT(waitRealTime(&doneSemaphore)); + BMQTST_ASSERT(waitRealTime(&doneSemaphore)); scheduler.cancelAllEventsAndWait(); scheduler.stop(); @@ -6297,9 +6307,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(); @@ -6307,16 +6317,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"); @@ -6337,7 +6347,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); } @@ -6493,7 +6503,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); @@ -6583,7 +6593,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); @@ -6722,40 +6732,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); @@ -6773,7 +6783,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); @@ -6811,10 +6821,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); @@ -6822,19 +6833,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); @@ -6848,15 +6859,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( @@ -6873,26 +6885,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 @@ -7008,12 +7022,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(); @@ -7032,20 +7046,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); @@ -7053,11 +7067,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. " @@ -7073,11 +7087,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"); @@ -7087,19 +7101,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"); @@ -7112,8 +7126,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); @@ -7121,8 +7135,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. @@ -7137,7 +7151,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(), @@ -7146,19 +7160,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(); @@ -7228,18 +7242,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"); @@ -7251,7 +7266,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"); @@ -7259,7 +7275,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..."); @@ -7330,12 +7346,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)); @@ -7349,7 +7366,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"); @@ -7357,7 +7375,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..."); @@ -7404,7 +7422,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; } @@ -7480,7 +7498,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; @@ -7493,7 +7511,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; @@ -7507,18 +7525,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); @@ -7584,13 +7602,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); @@ -7607,13 +7625,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); @@ -7630,19 +7648,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); @@ -7659,7 +7677,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"); @@ -7964,11 +7982,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()); @@ -7976,42 +7994,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(); @@ -8019,14 +8037,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); @@ -8036,16 +8054,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); @@ -8053,8 +8071,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; @@ -8089,7 +8107,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()); @@ -8100,19 +8118,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. " @@ -8128,7 +8146,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)); } @@ -8141,22 +8159,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()); } } @@ -8397,9 +8415,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, @@ -8416,37 +8434,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(); @@ -8523,18 +8541,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( @@ -8545,9 +8563,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); @@ -8556,8 +8574,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."); @@ -8580,10 +8598,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); @@ -8605,7 +8623,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(); @@ -8662,10 +8680,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"); @@ -8689,15 +8707,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(); @@ -8772,20 +8790,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(); @@ -8800,11 +8818,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"); @@ -8825,31 +8843,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); @@ -8869,18 +8887,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(); @@ -8955,9 +8973,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); @@ -9007,8 +9028,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() @@ -9142,7 +9163,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, @@ -9154,7 +9175,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()); @@ -9168,7 +9189,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(); @@ -9188,12 +9209,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(); @@ -9202,7 +9223,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()); @@ -9214,7 +9235,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); @@ -9226,7 +9247,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()); @@ -9261,24 +9282,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()); @@ -9294,7 +9315,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); @@ -9421,12 +9442,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(); @@ -9446,12 +9467,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(); @@ -9460,7 +9481,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()); @@ -9473,17 +9494,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(); @@ -9492,7 +9513,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()); @@ -9502,13 +9523,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()); @@ -9524,7 +9545,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); @@ -9586,7 +9607,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); @@ -9594,8 +9615,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); @@ -9606,22 +9627,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); @@ -9629,34 +9650,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); @@ -9664,50 +9685,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"); @@ -9742,7 +9763,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"); { @@ -9753,7 +9774,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)); @@ -9763,8 +9784,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"); @@ -9784,13 +9805,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)); @@ -9800,8 +9821,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()); } } @@ -9812,7 +9833,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, @@ -9833,7 +9854,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)); @@ -9842,7 +9863,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() @@ -10053,7 +10074,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"); @@ -10097,10 +10118,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"); @@ -10109,12 +10130,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], @@ -10124,10 +10145,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"); @@ -10157,7 +10178,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], @@ -10174,10 +10195,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 ee548ec39..c6380496e 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); } @@ -800,16 +800,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()); @@ -818,7 +818,7 @@ static void test6_comparisonOperatorTest() obj4.configureAsMessageEvent(&bufferFactory); // NOTE: Message event can not be equal. Is it expected? - ASSERT(obj3 != obj4); + BMQTST_ASSERT(obj3 != obj4); PV("Configure as RawEvent"); prepareBlobForMessageEvent(&eventHeader, @@ -832,7 +832,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() @@ -996,7 +996,7 @@ static void test7_printing() break; } default: { - ASSERT(false && "Unknown bmqimp::Event::EventType"); + BMQTST_ASSERT(false && "Unknown bmqimp::Event::EventType"); break; } } @@ -1042,7 +1042,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 << " ]"; @@ -1076,7 +1076,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(); } } @@ -1212,14 +1212,14 @@ static void test8_putEventBuilder() const bdlbb::Blob& eventBlob = builder.blob(); bmqp::Event rawEvent(&eventBlob, 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) { @@ -1234,8 +1234,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, @@ -1367,7 +1367,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(); @@ -1465,7 +1465,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 068428920..b9a5321b0 100644 --- a/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp +++ b/src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp @@ -304,14 +304,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); } @@ -510,7 +510,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); @@ -642,7 +642,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)); } @@ -656,7 +656,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 05b1885d6..d9d3764b9 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() @@ -613,10 +613,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); @@ -639,10 +639,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(), @@ -722,7 +722,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 @@ -744,7 +744,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 fefe8d9a3..1b3619cb0 100644 --- a/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_ackeventbuilder.t.cpp @@ -241,7 +241,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()); @@ -252,7 +252,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 ee9afe988..a417b9b32 100644 --- a/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_confirmeventbuilder.t.cpp @@ -239,7 +239,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()); @@ -250,7 +250,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 e7bdba184..063330e75 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); @@ -577,7 +577,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(), @@ -619,7 +619,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"); @@ -715,28 +715,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 || @@ -744,14 +745,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); @@ -833,7 +836,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 30998b18b..3b770be3b 100644 --- a/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_eventutil.t.cpp @@ -356,7 +356,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 } @@ -401,7 +401,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)); } } @@ -636,7 +636,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) @@ -773,7 +773,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 68ab09048..8f77fa18a 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() @@ -682,9 +682,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]); @@ -693,9 +693,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]); @@ -703,10 +703,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"); @@ -716,10 +716,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"); @@ -730,10 +730,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 46bad3cc6..2ba4dec2d 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); @@ -1919,7 +1919,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); @@ -2108,14 +2108,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(); @@ -2130,7 +2131,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); 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 77070915e..8139c3990 100644 --- a/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_rejecteventbuilder.t.cpp @@ -101,13 +101,13 @@ static void verifyContent(const bmqp::RejectEventBuilder& builder, PVV("Iterating over messages"); bmqp::Event event(&builder.blob(), 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()) { @@ -239,7 +239,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()); @@ -250,7 +250,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() @@ -334,15 +334,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 8afd82885..e11f121d9 100644 --- a/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp @@ -297,10 +297,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; @@ -387,11 +387,12 @@ static void test1_creatorsTest() bdlmt::EventScheduler scheduler(bsls::SystemClockType::e_REALTIME, bmqtst::TestHelperUtil::allocator()); - ASSERT_SAFE_FAIL(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobBufferFactory, - &scheduler, - false, // late response mode is off - bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_SAFE_FAIL( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobBufferFactory, + &scheduler, + false, // late response mode is off + bmqtst::TestHelperUtil::allocator())); } { @@ -399,26 +400,29 @@ static void test1_creatorsTest() bdlmt::EventScheduler scheduler(bsls::SystemClockType::e_MONOTONIC, bmqtst::TestHelperUtil::allocator()); - ASSERT_PASS(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobBufferFactory, - &scheduler, - false, // late response mode is off - bmqtst::TestHelperUtil::allocator())); - - ASSERT_PASS(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobBufferFactory, - &scheduler, - false, // late response mode is off - bmqex::SystemExecutor(), - bmqtst::TestHelperUtil::allocator())); - - ASSERT_PASS(ReqManagerType(bmqp::EventType::e_CONTROL, - &blobBufferFactory, - &scheduler, - false, // late response mode is off - bmqex::SystemExecutor(), - ReqManagerType::DTContextSp(), - bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_PASS( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobBufferFactory, + &scheduler, + false, // late response mode is off + bmqtst::TestHelperUtil::allocator())); + + BMQTST_ASSERT_PASS( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobBufferFactory, + &scheduler, + false, // late response mode is off + bmqex::SystemExecutor(), + bmqtst::TestHelperUtil::allocator())); + + BMQTST_ASSERT_PASS( + ReqManagerType(bmqp::EventType::e_CONTROL, + &blobBufferFactory, + &scheduler, + false, // late response mode is off + bmqex::SystemExecutor(), + ReqManagerType::DTContextSp(), + bmqtst::TestHelperUtil::allocator())); } } @@ -433,7 +437,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())); } } @@ -449,7 +454,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); } } @@ -469,7 +474,7 @@ static void test4_sendRequestTest() { *called = true; bmqp::Event ev(&blob, 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); @@ -485,7 +490,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); } @@ -534,7 +539,7 @@ static void test4_sendRequestTest() &called, bdlf::PlaceHolders::_1, request)); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -602,14 +607,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()); } } @@ -674,7 +679,7 @@ static void test5_processResponseTest() context.advanceTime(SEND_REQUEST_TIMEOUT); BMQTST_ASSERT_EQ(request->result(), bmqt::GenericResult::e_SUCCESS); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -697,7 +702,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); } { @@ -720,7 +725,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); } { @@ -925,24 +930,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()); } { @@ -959,7 +964,7 @@ static void test7_requestBreathingTest() &request)); request->responseCb()(request); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -974,7 +979,7 @@ static void test7_requestBreathingTest() bdlf::PlaceHolders::_1, &request)); request->signal(); - ASSERT(called); + BMQTST_ASSERT(called); } { @@ -998,7 +1003,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()); } } @@ -1026,7 +1031,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())); @@ -1041,13 +1046,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 1f5855881..e4c447d51 100644 --- a/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_schemaeventbuilder.t.cpp @@ -105,7 +105,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()); @@ -319,7 +319,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()); @@ -513,12 +513,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"); @@ -561,7 +561,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 7ea6a18d5..f1010bbb7 100644 --- a/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp +++ b/src/groups/bmq/bmqp/bmqp_storageeventbuilder.t.cpp @@ -671,7 +671,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 321beac36..51b86671b 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(); } @@ -933,12 +933,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 @@ -955,8 +955,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 } @@ -969,20 +969,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); @@ -992,11 +992,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()); } } @@ -1015,17 +1015,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(), @@ -1044,10 +1044,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); @@ -1059,7 +1060,7 @@ class TestBench { const int msgPropsAreaSize = mpsh->messagePropertiesAreaWords() * bmqp::Protocol::k_WORD_SIZE; - ASSERT(validateData(payloadBlob, msgPropsAreaSize, length)); + BMQTST_ASSERT(validateData(payloadBlob, msgPropsAreaSize, length)); } }; @@ -1131,7 +1132,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(); } @@ -1229,7 +1230,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); @@ -1388,7 +1389,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, @@ -1596,13 +1597,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); @@ -1661,13 +1662,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); @@ -1756,7 +1757,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)); @@ -1764,7 +1765,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); @@ -1776,7 +1777,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, @@ -1838,7 +1840,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)); @@ -1849,7 +1851,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); @@ -1858,7 +1860,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, @@ -1955,10 +1958,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); @@ -1974,7 +1977,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, @@ -2072,10 +2076,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 fcdc20f36..4345dd8b3 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 0e8439c05..b60d9bfff 100644 --- a/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_channel.t.cpp @@ -637,7 +637,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 d64a8eea5..014121ca0 100644 --- a/src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp +++ b/src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp @@ -225,13 +225,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"); @@ -292,13 +292,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"); @@ -374,13 +374,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 e0d09a734..3164c5f5d 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); } }; @@ -364,10 +364,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; @@ -459,13 +459,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, @@ -486,7 +486,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(); @@ -501,7 +501,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()); } } @@ -515,15 +515,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())); } } @@ -547,7 +548,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()); @@ -580,19 +581,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(); @@ -614,9 +615,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); } { @@ -675,7 +676,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( @@ -693,10 +694,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)