From d87cc333beb80ce677b5a7cc180f2a6fd5ca355d 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. --- .../m_bmqstoragetool_filemanagermock.h | 29 - ..._bmqstoragetool_journalfileprocessor.t.cpp | 72 +- .../bmqtool/m_bmqtool_inpututil.t.cpp | 20 +- .../bmq/bmqa/bmqa_abstractsession.t.cpp | 2 +- .../bmq/bmqa/bmqa_closequeuestatus.t.cpp | 34 +- .../bmq/bmqa/bmqa_configurequeuestatus.t.cpp | 34 +- src/groups/bmq/bmqa/bmqa_event.t.cpp | 16 +- src/groups/bmq/bmqa/bmqa_message.t.cpp | 106 +- src/groups/bmq/bmqa/bmqa_messageevent.t.cpp | 16 +- .../bmq/bmqa/bmqa_messageeventbuilder.t.cpp | 30 +- src/groups/bmq/bmqa/bmqa_mocksession.h | 46 +- src/groups/bmq/bmqa/bmqa_mocksession.t.cpp | 292 +-- .../bmq/bmqa/bmqa_openqueuestatus.t.cpp | 34 +- src/groups/bmq/bmqa/bmqa_queueid.t.cpp | 82 +- src/groups/bmq/bmqc/bmqc_array.t.cpp | 242 +- src/groups/bmq/bmqc/bmqc_monitoredqueue.t.cpp | 8 +- .../bmqc_monitoredqueue_bdlccfixedqueue.t.cpp | 130 +- ...itoredqueue_bdlccsingleconsumerqueue.t.cpp | 100 +- .../bmq/bmqc/bmqc_multiqueuethreadpool.t.cpp | 34 +- src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp | 364 +-- .../bmqc/bmqc_orderedhashmapwithhistory.t.cpp | 76 +- src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp | 618 ++--- .../bmq/bmqeval/bmqeval_simpleevaluator.t.cpp | 8 +- .../bmqex_bdlmteventschedulerexecutor.t.cpp | 44 +- .../bmqex_bdlmtfixedthreadpoolexecutor.t.cpp | 18 +- ...bdlmtmultiprioritythreadpoolexecutor.t.cpp | 42 +- ...ex_bdlmtmultiqueuethreadpoolexecutor.t.cpp | 48 +- .../bmqex/bmqex_bdlmtthreadpoolexecutor.t.cpp | 18 +- src/groups/bmq/bmqex/bmqex_bindutil.t.cpp | 20 +- .../bmq/bmqex/bmqex_executionpolicy.t.cpp | 104 +- .../bmq/bmqex/bmqex_executionutil.t.cpp | 94 +- src/groups/bmq/bmqex/bmqex_executor.t.cpp | 52 +- .../bmq/bmqex/bmqex_executortraits.t.cpp | 18 +- src/groups/bmq/bmqex/bmqex_future.t.cpp | 222 +- src/groups/bmq/bmqex/bmqex_job.t.cpp | 8 +- src/groups/bmq/bmqex/bmqex_promise.t.cpp | 16 +- .../bmq/bmqex/bmqex_sequentialcontext.t.cpp | 68 +- src/groups/bmq/bmqex/bmqex_strand.t.cpp | 82 +- .../bmq/bmqex/bmqex_systemexecutor.t.cpp | 50 +- .../bmq/bmqimp/bmqimp_application.t.cpp | 14 +- .../bmq/bmqimp/bmqimp_brokersession.t.cpp | 1072 ++++---- src/groups/bmq/bmqimp/bmqimp_event.t.cpp | 326 +-- src/groups/bmq/bmqimp/bmqimp_eventqueue.t.cpp | 42 +- ...bmqimp_messagecorrelationidcontainer.t.cpp | 42 +- .../bmq/bmqimp/bmqimp_messagedumper.t.cpp | 134 +- src/groups/bmq/bmqimp/bmqimp_queue.t.cpp | 100 +- .../bmq/bmqimp/bmqimp_queuemanager.t.cpp | 62 +- src/groups/bmq/bmqio/bmqio_channelutil.t.cpp | 108 +- src/groups/bmq/bmqio/bmqio_ntcchannel.t.cpp | 16 +- .../bmq/bmqio/bmqio_ntcchannelfactory.t.cpp | 28 +- .../bmqio_reconnectingchannelfactory.t.cpp | 68 +- src/groups/bmq/bmqio/bmqio_resolveutil.t.cpp | 16 +- .../bmqio/bmqio_resolvingchannelfactory.t.cpp | 18 +- .../bmq/bmqma/bmqma_countingallocator.t.cpp | 62 +- .../bmqma/bmqma_countingallocatorstore.t.cpp | 12 +- .../bmqma/bmqma_countingallocatorutil.t.cpp | 14 +- .../bmq/bmqp/bmqp_ackeventbuilder.t.cpp | 72 +- .../bmq/bmqp/bmqp_ackmessageiterator.t.cpp | 154 +- src/groups/bmq/bmqp/bmqp_compression.t.cpp | 44 +- .../bmq/bmqp/bmqp_confirmeventbuilder.t.cpp | 70 +- .../bmqp/bmqp_confirmmessageiterator.t.cpp | 102 +- .../bmq/bmqp/bmqp_controlmessageutil.t.cpp | 8 +- src/groups/bmq/bmqp/bmqp_crc32c.t.cpp | 94 +- src/groups/bmq/bmqp/bmqp_event.t.cpp | 150 +- src/groups/bmq/bmqp/bmqp_eventutil.t.cpp | 56 +- .../bmq/bmqp/bmqp_messageguidgenerator.t.cpp | 80 +- .../bmq/bmqp/bmqp_messageproperties.t.cpp | 392 +-- src/groups/bmq/bmqp/bmqp_optionsview.t.cpp | 130 +- src/groups/bmq/bmqp/bmqp_optionutil.t.cpp | 68 +- src/groups/bmq/bmqp/bmqp_protocol.t.cpp | 572 ++--- src/groups/bmq/bmqp/bmqp_protocolutil.t.cpp | 128 +- .../bmq/bmqp/bmqp_pusheventbuilder.t.cpp | 426 ++-- .../bmq/bmqp/bmqp_pushmessageiterator.t.cpp | 286 +-- .../bmq/bmqp/bmqp_puteventbuilder.t.cpp | 970 ++++---- .../bmq/bmqp/bmqp_putmessageiterator.t.cpp | 580 ++--- src/groups/bmq/bmqp/bmqp_queueid.t.cpp | 28 +- src/groups/bmq/bmqp/bmqp_queueutil.t.cpp | 26 +- .../bmq/bmqp/bmqp_recoveryeventbuilder.t.cpp | 116 +- .../bmqp/bmqp_recoverymessageiterator.t.cpp | 190 +- .../bmq/bmqp/bmqp_rejecteventbuilder.t.cpp | 58 +- .../bmq/bmqp/bmqp_rejectmessageiterator.t.cpp | 102 +- src/groups/bmq/bmqp/bmqp_requestmanager.t.cpp | 84 +- .../bmqp/bmqp_routingconfigurationutils.t.cpp | 54 +- .../bmq/bmqp/bmqp_schemaeventbuilder.t.cpp | 140 +- .../bmq/bmqp/bmqp_schemagenerator.t.cpp | 14 +- src/groups/bmq/bmqp/bmqp_schemalearner.t.cpp | 104 +- .../bmq/bmqp/bmqp_storageeventbuilder.t.cpp | 158 +- .../bmqp/bmqp_storagemessageiterator.t.cpp | 150 +- src/groups/bmq/bmqst/bmqst_printutil.t.cpp | 20 +- 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 | 54 +- src/groups/bmq/bmqsys/bmqsys_mocktime.t.cpp | 24 +- .../bmq/bmqsys/bmqsys_statmonitor.t.cpp | 102 +- .../bmqsys_statmonitorsnapshotrecorder.t.cpp | 18 +- src/groups/bmq/bmqsys/bmqsys_time.t.cpp | 12 +- .../bmqt/bmqt_compressionalgorithmtype.t.cpp | 6 +- src/groups/bmq/bmqt/bmqt_correlationid.t.cpp | 150 +- src/groups/bmq/bmqt/bmqt_encodingtype.t.cpp | 22 +- .../bmq/bmqt/bmqt_hosthealthstate.t.cpp | 22 +- .../bmq/bmqt/bmqt_messageeventtype.t.cpp | 20 +- src/groups/bmq/bmqt/bmqt_messageguid.t.cpp | 50 +- src/groups/bmq/bmqt/bmqt_propertytype.t.cpp | 22 +- src/groups/bmq/bmqt/bmqt_queueflags.t.cpp | 62 +- src/groups/bmq/bmqt/bmqt_queueoptions.t.cpp | 70 +- src/groups/bmq/bmqt/bmqt_resultcode.t.cpp | 50 +- .../bmq/bmqt/bmqt_sessioneventtype.t.cpp | 22 +- src/groups/bmq/bmqt/bmqt_sessionoptions.t.cpp | 70 +- src/groups/bmq/bmqt/bmqt_uri.t.cpp | 288 +-- src/groups/bmq/bmqt/bmqt_version.t.cpp | 68 +- .../bmq/bmqtsk/bmqtsk_logcontroller.t.cpp | 16 +- src/groups/bmq/bmqtst/bmqtst_blobtestutil.h | 14 +- .../bmq/bmqtst/bmqtst_blobtestutil.t.cpp | 40 +- .../bmq/bmqtst/bmqtst_scopedlogobserver.t.cpp | 14 +- src/groups/bmq/bmqtst/bmqtst_testhelper.h | 70 +- src/groups/bmq/bmqu/bmqu_atomicstate.t.cpp | 20 +- .../bmq/bmqu/bmqu_atomicvalidator.t.cpp | 4 +- src/groups/bmq/bmqu/bmqu_blob.t.cpp | 140 +- src/groups/bmq/bmqu/bmqu_blobiterator.t.cpp | 46 +- .../bmq/bmqu/bmqu_blobobjectproxy.t.cpp | 40 +- src/groups/bmq/bmqu/bmqu_memoutstream.t.cpp | 48 +- src/groups/bmq/bmqu/bmqu_objectplaceholder.h | 8 +- .../bmq/bmqu/bmqu_objectplaceholder.t.cpp | 36 +- src/groups/bmq/bmqu/bmqu_operationchain.t.cpp | 224 +- .../bmq/bmqu/bmqu_outstreamformatsaver.t.cpp | 8 +- src/groups/bmq/bmqu/bmqu_printutil.t.cpp | 16 +- .../bmq/bmqu/bmqu_samethreadchecker.t.cpp | 6 +- src/groups/bmq/bmqu/bmqu_stringutil.t.cpp | 24 +- .../bmq/bmqu/bmqu_throttledaction.t.cpp | 154 +- src/groups/bmq/bmqu/bmqu_tlsbool.t.cpp | 86 +- src/groups/bmq/bmqu/bmqu_weakmemfn.t.cpp | 36 +- src/groups/bmq/bmqvt/bmqvt_propertybag.t.cpp | 24 +- .../bmq/bmqvt/bmqvt_rcdescriptionerror.t.cpp | 26 +- src/groups/bmq/bmqvt/bmqvt_valueorerror.t.cpp | 40 +- src/groups/mqb/mqba/mqba_adminsession.t.cpp | 12 +- src/groups/mqb/mqba/mqba_application.t.cpp | 2 +- src/groups/mqb/mqba/mqba_clientsession.t.cpp | 134 +- src/groups/mqb/mqba/mqba_dispatcher.t.cpp | 8 +- .../mqbblp/mqbblp_clusterstatemonitor.t.cpp | 236 +- .../mqbblp/mqbblp_messagegroupidmanager.t.cpp | 132 +- src/groups/mqb/mqbblp/mqbblp_pushstream.t.cpp | 20 +- .../mqbblp_queueconsumptionmonitor.t.cpp | 142 +- .../mqb/mqbblp/mqbblp_queueenginetester.h | 12 +- .../mqb/mqbblp/mqbblp_relayqueueengine.t.cpp | 296 +-- .../mqb/mqbblp/mqbblp_remotequeue.t.cpp | 130 +- .../mqb/mqbblp/mqbblp_rootqueueengine.t.cpp | 1076 ++++---- src/groups/mqb/mqbblp/mqbblp_routers.t.cpp | 80 +- .../mqb/mqbc/mqbc_clusterstateledger.t.cpp | 24 +- .../mqbc_clusterstateledgerprotocol.t.cpp | 42 +- .../mqbc/mqbc_clusterstateledgerutil.t.cpp | 76 +- .../mqb/mqbc/mqbc_clusterstatemanager.t.cpp | 188 +- .../mqbc/mqbc_incoreclusterstateledger.t.cpp | 264 +- ...qbc_incoreclusterstateledgeriterator.t.cpp | 22 +- src/groups/mqb/mqbc/mqbc_storagemanager.t.cpp | 132 +- .../mqb/mqbc/test/mqbc_clusterstate.t.cpp | 2 +- .../mqb/mqbcfg/mqbcfg_brokerconfig.t.cpp | 4 +- .../mqbcfg_tcpinterfaceconfigvalidator.t.cpp | 22 +- src/groups/mqb/mqbcmd/mqbcmd_parseutil.t.cpp | 6 +- src/groups/mqb/mqbi/mqbi_queue.t.cpp | 26 +- src/groups/mqb/mqbi/mqbi_queueengine.t.cpp | 8 +- src/groups/mqb/mqbnet/mqbnet_channel.t.cpp | 66 +- src/groups/mqb/mqbnet/mqbnet_cluster.t.cpp | 6 +- .../mqb/mqbnet/mqbnet_dummysession.t.cpp | 8 +- src/groups/mqb/mqbnet/mqbnet_elector.t.cpp | 2192 ++++++++--------- .../mqbnet/mqbnet_multirequestmanager.t.cpp | 20 +- src/groups/mqb/mqbnet/mqbnet_negotiator.t.cpp | 28 +- .../mqb/mqbs/mqbs_datafileiterator.t.cpp | 68 +- src/groups/mqb/mqbs/mqbs_datastore.t.cpp | 48 +- .../mqb/mqbs/mqbs_filebackedstorage.t.cpp | 406 +-- src/groups/mqb/mqbs/mqbs_fileset.t.cpp | 36 +- src/groups/mqb/mqbs/mqbs_filestore.t.cpp | 48 +- .../mqb/mqbs/mqbs_filestoreprotocol.t.cpp | 252 +- .../mqb/mqbs/mqbs_filestoreprotocolutil.t.cpp | 58 +- src/groups/mqb/mqbs/mqbs_filestoreset.t.cpp | 60 +- .../mqb/mqbs/mqbs_inmemorystorage.t.cpp | 344 +-- .../mqb/mqbs/mqbs_journalfileiterator.t.cpp | 284 +-- .../mqb/mqbs/mqbs_mappedfiledescriptor.t.cpp | 24 +- src/groups/mqb/mqbs/mqbs_memoryblock.t.cpp | 28 +- .../mqb/mqbs/mqbs_memoryblockiterator.t.cpp | 174 +- src/groups/mqb/mqbs/mqbs_offsetptr.t.cpp | 8 +- .../mqb/mqbs/mqbs_qlistfileiterator.t.cpp | 144 +- .../mqb/mqbs/mqbs_storageprintutil.t.cpp | 4 +- src/groups/mqb/mqbs/mqbs_storageutil.t.cpp | 44 +- src/groups/mqb/mqbsl/mqbsl_inmemorylog.t.cpp | 208 +- src/groups/mqb/mqbsl/mqbsl_ledger.t.cpp | 518 ++-- .../mqbsl/mqbsl_memorymappedondisklog.t.cpp | 228 +- .../mqb/mqbsl/mqbsl_readwriteondisklog.t.cpp | 200 +- .../mqb/mqbstat/mqbstat_queuestats.t.cpp | 264 +- .../mqb/mqbstat/mqbstat_statcontroller.t.cpp | 2 +- src/groups/mqb/mqbu/mqbu_capacitymeter.t.cpp | 28 +- src/groups/mqb/mqbu/mqbu_exit.t.cpp | 24 +- src/groups/mqb/mqbu/mqbu_loadbalancer.t.cpp | 50 +- .../mqb/mqbu/mqbu_messageguidutil.t.cpp | 38 +- .../mqb/mqbu/mqbu_resourceusagemonitor.t.cpp | 494 ++-- src/groups/mqb/mqbu/mqbu_storagekey.t.cpp | 76 +- 195 files changed, 11478 insertions(+), 11507 deletions(-) diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_filemanagermock.h b/src/applications/bmqstoragetool/m_bmqstoragetool_filemanagermock.h index c0084be135..804f0948f7 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_filemanagermock.h +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_filemanagermock.h @@ -27,37 +27,8 @@ #include #include -// GMOCK -// If bmqst_testhelper.h was defined before gtest.h, preserve macroses values. -// If not, undefine values from gtest.h. -#pragma push_macro("ASSERT_EQ") -#pragma push_macro("ASSERT_NE") -#pragma push_macro("ASSERT_LT") -#pragma push_macro("ASSERT_LE") -#pragma push_macro("ASSERT_GT") -#pragma push_macro("ASSERT_GE") -#pragma push_macro("TEST_F") -#pragma push_macro("TEST") - #include -#undef ASSERT_EQ -#undef ASSERT_NE -#undef ASSERT_LT -#undef ASSERT_LE -#undef ASSERT_GT -#undef ASSERT_GE -#undef TEST_F -#undef TEST -#pragma pop_macro("ASSERT_EQ") -#pragma pop_macro("ASSERT_NE") -#pragma pop_macro("ASSERT_LT") -#pragma pop_macro("ASSERT_LE") -#pragma pop_macro("ASSERT_GT") -#pragma pop_macro("ASSERT_GE") -#pragma pop_macro("TEST_F") -#pragma pop_macro("TEST") - namespace BloombergLP { namespace m_bmqstoragetool { diff --git a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp index b5fd761784..4ba717e4fa 100644 --- a/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp +++ b/src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp @@ -220,7 +220,7 @@ static void test1_breathingTest() expectedStream << foundMessagesCount << " message GUID(s) found." << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test2_searchGuidTest() @@ -288,7 +288,7 @@ static void test2_searchGuidTest() expectedStream << searchGuids.size() << " message GUID(s) found." << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test3_searchNonExistingGuidTest() @@ -349,7 +349,7 @@ static void test3_searchNonExistingGuidTest() expectedStream << searchGuids[0] << bsl::endl << searchGuids[1] << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test4_searchExistingAndNonExistingGuidTest() @@ -433,7 +433,7 @@ static void test4_searchExistingAndNonExistingGuidTest() expectedStream << searchGuids[2] << bsl::endl << searchGuids[3] << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test5_searchOutstandingMessagesTest() @@ -498,7 +498,7 @@ static void test5_searchOutstandingMessagesTest() << outstandingGUIDS.size() << "/" << messageCount << ")" << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test6_searchConfirmedMessagesTest() @@ -562,7 +562,7 @@ static void test6_searchConfirmedMessagesTest() << (messageCount - confirmedGUIDS.size()) << "/" << messageCount << ")" << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test7_searchPartiallyConfirmedMessagesTest() @@ -629,7 +629,7 @@ static void test7_searchPartiallyConfirmedMessagesTest() << partiallyConfirmedGUIDS.size() + 1 << "/" << messageCount << ")" << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test8_searchMessagesByQueueKeyTest() @@ -690,7 +690,7 @@ static void test8_searchMessagesByQueueKeyTest() expectedStream << foundMessagesCount << " message GUID(s) found." << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test9_searchMessagesByQueueNameTest() @@ -761,7 +761,7 @@ static void test9_searchMessagesByQueueNameTest() expectedStream << foundMessagesCount << " message GUID(s) found." << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test10_searchMessagesByQueueNameAndQueueKeyTest() @@ -836,7 +836,7 @@ static void test10_searchMessagesByQueueNameAndQueueKeyTest() expectedStream << foundMessagesCount << " message GUID(s) found." << bsl::endl; - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test11_searchMessagesByTimestamp() @@ -902,7 +902,7 @@ static void test11_searchMessagesByTimestamp() bmqtst::TestHelperUtil::allocator()); searchProcessor->process(); - ASSERT_EQ(resultStream.str(), expectedStream.str()); + BMQTST_ASSERT_EQ(resultStream.str(), expectedStream.str()); } static void test12_printMessagesDetailsTest() @@ -1048,7 +1048,7 @@ static void test13_searchMessagesWithPayloadDumpTest() k_NUM_MSGS, messageOffsets); ASSERT(pd != 0); - ASSERT_GT(mfdData.fileSize(), 0ULL); + BMQTST_ASSERT_GT(mfdData.fileSize(), 0ULL); // Create data file iterator DataFileIterator dataIt(&mfdData, fileHeader); @@ -1211,15 +1211,15 @@ static void test15_timestampSearchTest() static void check(mqbs::JournalFileIterator& it, const bsls::Types::Uint64& ts) { - ASSERT_GT(it.recordHeader().timestamp(), ts); + BMQTST_ASSERT_GT(it.recordHeader().timestamp(), ts); ASSERT(!it.isReverseMode()); // Check previous record it.flipDirection(); - ASSERT_EQ(it.nextRecord(), 1); - ASSERT_LE(it.recordHeader().timestamp(), ts); + BMQTST_ASSERT_EQ(it.nextRecord(), 1); + BMQTST_ASSERT_LE(it.recordHeader().timestamp(), ts); // Set 'it' to its original state it.flipDirection(); - ASSERT_EQ(it.nextRecord(), 1); + BMQTST_ASSERT_EQ(it.nextRecord(), 1); } }; @@ -1232,8 +1232,8 @@ static void test15_timestampSearchTest() journalFile.fileHeader(), false); // Move the iterator to the beginning of the file - ASSERT_EQ(journalFileIt.nextRecord(), 1); - ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts), 1); + BMQTST_ASSERT_EQ(journalFileIt.nextRecord(), 1); + BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts), 1); ResultChecker::check(journalFileIt, ts); } @@ -1247,35 +1247,35 @@ static void test15_timestampSearchTest() false); // Move the iterator to the center of the file - ASSERT_EQ(journalFileIt.nextRecord(), 1); - ASSERT_EQ(journalFileIt.advance(k_NUM_RECORDS / 2), 1); + BMQTST_ASSERT_EQ(journalFileIt.nextRecord(), 1); + BMQTST_ASSERT_EQ(journalFileIt.advance(k_NUM_RECORDS / 2), 1); // Find record with lower timestamp than the record pointed by the // specified iterator, which is initially forward - ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts1); - ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts1), 1); + BMQTST_ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts1); + BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts1), 1); ResultChecker::check(journalFileIt, ts1); // Find record with higher timestamp than the record pointed by the // specified iterator, which is initially forward - ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts2); - ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts2), 1); + BMQTST_ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts2); + BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts2), 1); ResultChecker::check(journalFileIt, ts2); // Find record with lower timestamp than the record pointed by the // specified iterator, which is initially backward - ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts1); + BMQTST_ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts1); journalFileIt.flipDirection(); ASSERT(journalFileIt.isReverseMode()); - ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts1), 1); + BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts1), 1); ResultChecker::check(journalFileIt, ts1); // Find record with higher timestamp than the record pointed by the // specified iterator, which is initially backward - ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts2); + BMQTST_ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts2); journalFileIt.flipDirection(); ASSERT(journalFileIt.isReverseMode()); - ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts2), 1); + BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts2), 1); ResultChecker::check(journalFileIt, ts2); } @@ -1288,10 +1288,10 @@ static void test15_timestampSearchTest() journalFile.fileHeader(), false); // Move the iterator to the beginning of the file - ASSERT_EQ(journalFileIt.nextRecord(), 1); - ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts), 0); - ASSERT_EQ(journalFileIt.recordIndex(), k_NUM_RECORDS - 1); - ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts); + BMQTST_ASSERT_EQ(journalFileIt.nextRecord(), 1); + BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts), 0); + BMQTST_ASSERT_EQ(journalFileIt.recordIndex(), k_NUM_RECORDS - 1); + BMQTST_ASSERT_LT(journalFileIt.recordHeader().timestamp(), ts); ASSERT(!journalFileIt.isReverseMode()); } @@ -1303,10 +1303,10 @@ static void test15_timestampSearchTest() journalFile.fileHeader(), false); // Move the iterator to the beginning of the file - ASSERT_EQ(journalFileIt.nextRecord(), 1); - ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts), 1); - ASSERT_EQ(journalFileIt.recordIndex(), 0U); - ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts); + BMQTST_ASSERT_EQ(journalFileIt.nextRecord(), 1); + BMQTST_ASSERT_EQ(m_bmqstoragetool::moveToLowerBound(&journalFileIt, ts), 1); + BMQTST_ASSERT_EQ(journalFileIt.recordIndex(), 0U); + BMQTST_ASSERT_GT(journalFileIt.recordHeader().timestamp(), ts); ASSERT(!journalFileIt.isReverseMode()); } } diff --git a/src/applications/bmqtool/m_bmqtool_inpututil.t.cpp b/src/applications/bmqtool/m_bmqtool_inpututil.t.cpp index 37fba0b55d..dc8e7dc8fb 100644 --- a/src/applications/bmqtool/m_bmqtool_inpututil.t.cpp +++ b/src/applications/bmqtool/m_bmqtool_inpututil.t.cpp @@ -113,11 +113,11 @@ static void test1_decodeHexDumpTest() input, bmqtst::TestHelperUtil::allocator()); // Check rc - ASSERT_EQ_D(test.d_line, rc, test.d_expectedRc); + BMQTST_ASSERT_EQ_D(test.d_line, rc, test.d_expectedRc); // Check error - ASSERT_EQ_D(test.d_line, error.str(), test.d_expectedError); + BMQTST_ASSERT_EQ_D(test.d_line, error.str(), test.d_expectedError); // Check output - ASSERT_EQ_D(test.d_line, output.str(), test.d_expectedOutput); + BMQTST_ASSERT_EQ_D(test.d_line, output.str(), test.d_expectedOutput); } } @@ -264,8 +264,8 @@ static void test2_loadMessageFromFileTest() &error, "wrongFilePath", bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(rc, false); - ASSERT_EQ(error.str(), "Failed to open file: wrongFilePath"); + BMQTST_ASSERT_EQ(rc, false); + BMQTST_ASSERT_EQ(error.str(), "Failed to open file: wrongFilePath"); } const size_t k_NUM_DATA = sizeof(k_DATA) / sizeof(*k_DATA); @@ -277,7 +277,7 @@ static void test2_loadMessageFromFileTest() const bsl::string filePath = tempFile.path(); { bsl::ofstream ofs(filePath.c_str()); - ASSERT_EQ(ofs.is_open(), true); + BMQTST_ASSERT_EQ(ofs.is_open(), true); ofs << test.d_fileContent; } @@ -291,11 +291,11 @@ static void test2_loadMessageFromFileTest() filePath, bmqtst::TestHelperUtil::allocator()); // Check rc - ASSERT_EQ_D(test.d_line, rc, test.d_expectedRc); + BMQTST_ASSERT_EQ_D(test.d_line, rc, test.d_expectedRc); // Check error - ASSERT_EQ_D(test.d_line, error.str(), test.d_expectedError); + BMQTST_ASSERT_EQ_D(test.d_line, error.str(), test.d_expectedError); // Check payload - ASSERT_EQ_D(test.d_line, payload.str(), test.d_expectedPayload); + BMQTST_ASSERT_EQ_D(test.d_line, payload.str(), test.d_expectedPayload); // Check properties (deserialize into properties instance) bdlbb::PooledBlobBufferFactory bufferFactory( 128, @@ -306,7 +306,7 @@ static void test2_loadMessageFromFileTest() bdlbb::BlobUtil::append(&blob, properties.str().c_str(), static_cast(properties.str().size())); - ASSERT_EQ_D(test.d_line, messageProperties.streamIn(blob), 0); + BMQTST_ASSERT_EQ_D(test.d_line, messageProperties.streamIn(blob), 0); } } diff --git a/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp b/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp index 3355f20be6..b6eeb20900 100644 --- a/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_abstractsession.t.cpp @@ -610,7 +610,7 @@ static void test2_instanceInvariants() PV("Verify that overriden methods execute as intended"); ASSERT_OPT_PASS(testObj.configureMessageDumping("")); - ASSERT_EQ(testObj.configureMessageDumping(""), -1497); + 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 31222e65b2..dc2777ca5e 100644 --- a/src/groups/bmq/bmqa/bmqa_closequeuestatus.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_closequeuestatus.t.cpp @@ -56,9 +56,9 @@ static void test1_breathingTest() PV("Default Constructor"); { bmqa::CloseQueueStatus obj(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj), true); - ASSERT_EQ(obj.result(), bmqt::CloseQueueResult::e_SUCCESS); - ASSERT_EQ(obj.errorDescription(), + BMQTST_ASSERT_EQ(bool(obj), true); + BMQTST_ASSERT_EQ(obj.result(), bmqt::CloseQueueResult::e_SUCCESS); + BMQTST_ASSERT_EQ(obj.errorDescription(), bsl::string("", bmqtst::TestHelperUtil::allocator())); } @@ -78,10 +78,10 @@ static void test1_breathingTest() errorDescription, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj), false); - ASSERT_EQ(obj.queueId(), queueId); - ASSERT_EQ(obj.result(), statusCode); - ASSERT_EQ(obj.errorDescription(), errorDescription); + BMQTST_ASSERT_EQ(bool(obj), false); + BMQTST_ASSERT_EQ(obj.queueId(), queueId); + BMQTST_ASSERT_EQ(obj.result(), statusCode); + BMQTST_ASSERT_EQ(obj.errorDescription(), errorDescription); } PV("Copy Constructor"); @@ -101,10 +101,10 @@ static void test1_breathingTest() bmqtst::TestHelperUtil::allocator()); bmqa::CloseQueueStatus obj2(obj1, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj1), bool(obj2)); - ASSERT_EQ(obj1.queueId(), obj2.queueId()); - ASSERT_EQ(obj1.result(), obj2.result()); - ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); + BMQTST_ASSERT_EQ(bool(obj1), bool(obj2)); + BMQTST_ASSERT_EQ(obj1.queueId(), obj2.queueId()); + BMQTST_ASSERT_EQ(obj1.result(), obj2.result()); + BMQTST_ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); } PV("Assignment Operator"); @@ -125,10 +125,10 @@ static void test1_breathingTest() bmqa::CloseQueueStatus obj2(bmqtst::TestHelperUtil::allocator()); obj2 = obj1; - ASSERT_EQ(bool(obj1), bool(obj2)); - ASSERT_EQ(obj1.queueId(), obj2.queueId()); - ASSERT_EQ(obj1.result(), obj2.result()); - ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); + BMQTST_ASSERT_EQ(bool(obj1), bool(obj2)); + BMQTST_ASSERT_EQ(obj1.queueId(), obj2.queueId()); + BMQTST_ASSERT_EQ(obj1.result(), obj2.result()); + BMQTST_ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); } } @@ -252,13 +252,13 @@ static void test3_print() // operator<< out << obj; - ASSERT_EQ(out.str(), expected); + BMQTST_ASSERT_EQ(out.str(), expected); // Print out.reset(); obj.print(out, 0, -1); - ASSERT_EQ(out.str(), expected); + BMQTST_ASSERT_EQ(out.str(), expected); } // ============================================================================ diff --git a/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp b/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp index f71925a137..77b7492a1a 100644 --- a/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_configurequeuestatus.t.cpp @@ -56,9 +56,9 @@ static void test1_breathingTest() PV("Default Constructor"); { bmqa::ConfigureQueueStatus obj(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj), true); - ASSERT_EQ(obj.result(), bmqt::ConfigureQueueResult::e_SUCCESS); - ASSERT_EQ(obj.errorDescription(), + BMQTST_ASSERT_EQ(bool(obj), true); + BMQTST_ASSERT_EQ(obj.result(), bmqt::ConfigureQueueResult::e_SUCCESS); + BMQTST_ASSERT_EQ(obj.errorDescription(), bsl::string("", bmqtst::TestHelperUtil::allocator())); } @@ -78,10 +78,10 @@ static void test1_breathingTest() errorDescription, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj), false); - ASSERT_EQ(obj.queueId(), queueId); - ASSERT_EQ(obj.result(), result); - ASSERT_EQ(obj.errorDescription(), errorDescription); + BMQTST_ASSERT_EQ(bool(obj), false); + BMQTST_ASSERT_EQ(obj.queueId(), queueId); + BMQTST_ASSERT_EQ(obj.result(), result); + BMQTST_ASSERT_EQ(obj.errorDescription(), errorDescription); } PV("Copy Constructor"); @@ -102,10 +102,10 @@ static void test1_breathingTest() bmqa::ConfigureQueueStatus obj2(obj1, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj1), bool(obj2)); - ASSERT_EQ(obj1.queueId(), obj2.queueId()); - ASSERT_EQ(obj1.result(), obj2.result()); - ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); + BMQTST_ASSERT_EQ(bool(obj1), bool(obj2)); + BMQTST_ASSERT_EQ(obj1.queueId(), obj2.queueId()); + BMQTST_ASSERT_EQ(obj1.result(), obj2.result()); + BMQTST_ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); } PV("Assignment Operator"); @@ -126,10 +126,10 @@ static void test1_breathingTest() bmqa::ConfigureQueueStatus obj2(bmqtst::TestHelperUtil::allocator()); obj2 = obj1; - ASSERT_EQ(bool(obj1), bool(obj2)); - ASSERT_EQ(obj1.queueId(), obj2.queueId()); - ASSERT_EQ(obj1.result(), obj2.result()); - ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); + BMQTST_ASSERT_EQ(bool(obj1), bool(obj2)); + BMQTST_ASSERT_EQ(obj1.queueId(), obj2.queueId()); + BMQTST_ASSERT_EQ(obj1.result(), obj2.result()); + BMQTST_ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); } } @@ -254,13 +254,13 @@ static void test3_print() // operator<< out << obj; - ASSERT_EQ(out.str(), expected); + BMQTST_ASSERT_EQ(out.str(), expected); // Print out.reset(); obj.print(out, 0, -1); - ASSERT_EQ(out.str(), expected); + BMQTST_ASSERT_EQ(out.str(), expected); } // ============================================================================ diff --git a/src/groups/bmq/bmqa/bmqa_event.t.cpp b/src/groups/bmq/bmqa/bmqa_event.t.cpp index 2487288d51..c33ff49598 100644 --- a/src/groups/bmq/bmqa/bmqa_event.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_event.t.cpp @@ -72,8 +72,8 @@ static void test1_breathingTest() bmqtst::TestHelperUtil::allocator()); bmqa::Event event = convertEvent(eventImpl); - ASSERT_EQ(event.isSessionEvent(), false); - ASSERT_EQ(event.isMessageEvent(), false); + BMQTST_ASSERT_EQ(event.isSessionEvent(), false); + BMQTST_ASSERT_EQ(event.isMessageEvent(), false); PV("EmptyEvent: " << event); } @@ -91,15 +91,15 @@ static void test1_breathingTest() bmqa::Event event = convertEvent(eventImpl); // Validate type of the event - ASSERT_EQ(event.isSessionEvent(), true); - ASSERT_EQ(event.isMessageEvent(), false); + BMQTST_ASSERT_EQ(event.isSessionEvent(), true); + BMQTST_ASSERT_EQ(event.isMessageEvent(), false); // Validate session event values bmqa::SessionEvent se = event.sessionEvent(); - ASSERT_EQ(se.type(), bmqt::SessionEventType::e_TIMEOUT); - ASSERT_EQ(se.statusCode(), -3); - ASSERT_EQ(se.correlationId(), bmqt::CorrelationId(13)); - ASSERT_EQ(se.errorDescription(), "test"); + BMQTST_ASSERT_EQ(se.type(), bmqt::SessionEventType::e_TIMEOUT); + BMQTST_ASSERT_EQ(se.statusCode(), -3); + BMQTST_ASSERT_EQ(se.correlationId(), bmqt::CorrelationId(13)); + BMQTST_ASSERT_EQ(se.errorDescription(), "test"); PV("Event: " << event); } } diff --git a/src/groups/bmq/bmqa/bmqa_message.t.cpp b/src/groups/bmq/bmqa/bmqa_message.t.cpp index d12225587d..83e10b6a0c 100644 --- a/src/groups/bmq/bmqa/bmqa_message.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_message.t.cpp @@ -184,25 +184,25 @@ static void test2_validPushMessagePrint() bmqtst::TestHelperUtil::allocator()); bdlbb::Blob payload(&bufferFactory, bmqtst::TestHelperUtil::allocator()); bdlbb::BlobUtil::append(&payload, buffer, bsl::strlen(buffer)); - ASSERT_EQ(static_cast(payload.length()), + BMQTST_ASSERT_EQ(static_cast(payload.length()), bsl::strlen(buffer)); // Create PushEventBuilder bmqp::PushEventBuilder peb(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); - ASSERT_EQ(sizeof(bmqp::EventHeader), + BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); + BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.blob().length())); - ASSERT_EQ(0, peb.messageCount()); + BMQTST_ASSERT_EQ(0, peb.messageCount()); // Add SubQueueInfo option generateSubQueueInfos(&subQueueInfos, numSubQueueInfos); bmqt::EventBuilderResult::Enum rc = peb.addSubQueueInfosOption( subQueueInfos); - ASSERT_EQ(bmqt::EventBuilderResult::e_SUCCESS, rc); - ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); + BMQTST_ASSERT_EQ(bmqt::EventBuilderResult::e_SUCCESS, rc); + BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); // 'eventSize()' excludes unpacked messages - ASSERT_LT(sizeof(bmqp::EventHeader), + BMQTST_ASSERT_LT(sizeof(bmqp::EventHeader), static_cast(peb.blob().length())); // But the option is written to the underlying blob rc = peb.packMessage(payload, @@ -211,9 +211,9 @@ static void test2_validPushMessagePrint() flags, bmqt::CompressionAlgorithmType::e_NONE); - ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); - ASSERT_LT(payload.length(), peb.eventSize()); - ASSERT_EQ(1, peb.messageCount()); + BMQTST_ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); + BMQTST_ASSERT_LT(payload.length(), peb.eventSize()); + BMQTST_ASSERT_EQ(1, peb.messageCount()); bmqp::Event bmqpEvent(&peb.blob(), bmqtst::TestHelperUtil::allocator(), @@ -226,7 +226,7 @@ static void test2_validPushMessagePrint() bmqa::MessageIterator mIter = pushMsgEvt.messageIterator(); mIter.nextMessage(); bmqa::Message message = mIter.message(); - ASSERT_EQ(message.compressionAlgorithmType(), + BMQTST_ASSERT_EQ(message.compressionAlgorithmType(), bmqt::CompressionAlgorithmType::e_NONE); } @@ -286,7 +286,7 @@ static void test3_messageProperties() // Add SubQueueInfo option bmqt::EventBuilderResult::Enum rc = peb.addSubQueueInfosOption( subQueueInfos); - ASSERT_EQ(bmqt::EventBuilderResult::e_SUCCESS, rc); + BMQTST_ASSERT_EQ(bmqt::EventBuilderResult::e_SUCCESS, rc); rc = peb.packMessage(payload, queueId, @@ -295,9 +295,9 @@ static void test3_messageProperties() bmqt::CompressionAlgorithmType::e_NONE, input); - ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); - ASSERT_LT(payload.length(), peb.eventSize()); - ASSERT_EQ(1, peb.messageCount()); + BMQTST_ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); + BMQTST_ASSERT_LT(payload.length(), peb.eventSize()); + BMQTST_ASSERT_EQ(1, peb.messageCount()); bmqa::Event event; bsl::shared_ptr& implPtr = @@ -327,20 +327,20 @@ static void test3_messageProperties() bmqa::Message message = mIter.message(); bmqa::MessageProperties out1(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(0, message.loadProperties(&out1)); + BMQTST_ASSERT_EQ(0, message.loadProperties(&out1)); // 1st setProperty w/o getProperty and then getProperty { bmqa::MessageProperties out2(bmqtst::TestHelperUtil::allocator()); // The second read is/was optimized (only one MPS header) - ASSERT_EQ(0, message.loadProperties(&out2)); + BMQTST_ASSERT_EQ(0, message.loadProperties(&out2)); - ASSERT_EQ(0, out2.setPropertyAsString("y", mod)); - ASSERT_EQ(out1.totalSize() + sizeof(mod) - sizeof(y), + BMQTST_ASSERT_EQ(0, out2.setPropertyAsString("y", mod)); + BMQTST_ASSERT_EQ(out1.totalSize() + sizeof(mod) - sizeof(y), out2.totalSize()); - ASSERT_EQ(out2.getPropertyAsString("z"), z); + BMQTST_ASSERT_EQ(out2.getPropertyAsString("z"), z); } // 2nd getProperty, setProperty and then load all @@ -348,10 +348,10 @@ static void test3_messageProperties() bmqa::MessageProperties out3(bmqtst::TestHelperUtil::allocator()); // The third read is/was optimized (only one MPS header) - ASSERT_EQ(0, message.loadProperties(&out3)); + BMQTST_ASSERT_EQ(0, message.loadProperties(&out3)); - ASSERT_EQ(y, out3.getPropertyAsString("y")); - ASSERT_EQ(0, out3.setPropertyAsString("y", mod)); + BMQTST_ASSERT_EQ(y, out3.getPropertyAsString("y")); + BMQTST_ASSERT_EQ(0, out3.setPropertyAsString("y", mod)); bmqu::MemOutStream os(bmqtst::TestHelperUtil::allocator()); out3.print(os, 0, -1); @@ -361,11 +361,11 @@ static void test3_messageProperties() bmqa::MessagePropertiesIterator it(&out3); ASSERT(it.hasNext()); - ASSERT_EQ(it.getAsString(), x); + BMQTST_ASSERT_EQ(it.getAsString(), x); ASSERT(it.hasNext()); - ASSERT_EQ(it.getAsString(), mod); + BMQTST_ASSERT_EQ(it.getAsString(), mod); ASSERT(it.hasNext()); - ASSERT_EQ(it.getAsString(), z); + BMQTST_ASSERT_EQ(it.getAsString(), z); } // 3rd getProperty, setProperty and then getProperty @@ -373,14 +373,14 @@ static void test3_messageProperties() bmqa::MessageProperties out4(bmqtst::TestHelperUtil::allocator()); // The fourth read is/was optimized (only one MPS header) - ASSERT_EQ(0, message.loadProperties(&out4)); + BMQTST_ASSERT_EQ(0, message.loadProperties(&out4)); - ASSERT_EQ(y, out4.getPropertyAsString("y")); - ASSERT_EQ(0, out4.setPropertyAsString("y", mod)); - ASSERT_EQ(out1.totalSize() + sizeof(mod) - sizeof(y), + BMQTST_ASSERT_EQ(y, out4.getPropertyAsString("y")); + BMQTST_ASSERT_EQ(0, out4.setPropertyAsString("y", mod)); + BMQTST_ASSERT_EQ(out1.totalSize() + sizeof(mod) - sizeof(y), out4.totalSize()); - ASSERT_EQ(out4.getPropertyAsString("z"), z); + BMQTST_ASSERT_EQ(out4.getPropertyAsString("z"), z); } } @@ -427,7 +427,7 @@ static void test4_subscriptionHandle() queueSp->setId(queueId); bdlbb::BlobUtil::append(&payload, buffer, bsl::strlen(buffer)); - ASSERT_EQ(static_cast(payload.length()), + BMQTST_ASSERT_EQ(static_cast(payload.length()), bsl::strlen(buffer)); PV("PUSH MESSAGE - SUBSCRIPTION") @@ -447,18 +447,18 @@ static void test4_subscriptionHandle() // Create PushEventBuilder bmqp::PushEventBuilder peb(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(0, peb.messageCount()); + BMQTST_ASSERT_EQ(0, peb.messageCount()); // Add SubQueueInfo option (subscription Id) subQueueInfos.push_back(bmqp::SubQueueInfo(sId)); bmqt::EventBuilderResult::Enum rc = peb.addSubQueueInfosOption( subQueueInfos); - ASSERT_EQ(bmqt::EventBuilderResult::e_SUCCESS, rc); - ASSERT_EQ(sizeof(bmqp::EventHeader), + BMQTST_ASSERT_EQ(bmqt::EventBuilderResult::e_SUCCESS, rc); + BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader), static_cast(peb.eventSize())); // 'eventSize()' excludes unpacked messages - ASSERT_LT(sizeof(bmqp::EventHeader), + BMQTST_ASSERT_LT(sizeof(bmqp::EventHeader), static_cast(peb.blob().length())); // But the option is written to the underlying blob @@ -469,9 +469,9 @@ static void test4_subscriptionHandle() flags, bmqt::CompressionAlgorithmType::e_NONE); - ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); - ASSERT_LT(payload.length(), peb.eventSize()); - ASSERT_EQ(1, peb.messageCount()); + BMQTST_ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); + BMQTST_ASSERT_LT(payload.length(), peb.eventSize()); + BMQTST_ASSERT_EQ(1, peb.messageCount()); bmqp::Event bmqpEvent(&peb.blob(), bmqtst::TestHelperUtil::allocator(), @@ -491,8 +491,8 @@ static void test4_subscriptionHandle() const bmqt::SubscriptionHandle& actualHandle = message.subscriptionHandle(); PVV("Non-empty subscription handle: " << actualHandle); - ASSERT_EQ(actualHandle.id(), sId); - ASSERT_EQ(actualHandle.correlationId(), sHandle.correlationId()); + BMQTST_ASSERT_EQ(actualHandle.id(), sId); + BMQTST_ASSERT_EQ(actualHandle.correlationId(), sHandle.correlationId()); } PV("PUSH MESSAGE - NO SUBSCRIPTION") @@ -512,7 +512,7 @@ static void test4_subscriptionHandle() // Create PushEventBuilder bmqp::PushEventBuilder peb(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(0, peb.messageCount()); + BMQTST_ASSERT_EQ(0, peb.messageCount()); // Add message bmqt::EventBuilderResult::Enum rc = peb.packMessage( @@ -522,9 +522,9 @@ static void test4_subscriptionHandle() flags, bmqt::CompressionAlgorithmType::e_NONE); - ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); - ASSERT_LT(payload.length(), peb.eventSize()); - ASSERT_EQ(1, peb.messageCount()); + BMQTST_ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); + BMQTST_ASSERT_LT(payload.length(), peb.eventSize()); + BMQTST_ASSERT_EQ(1, peb.messageCount()); bmqp::Event bmqpEvent(&peb.blob(), bmqtst::TestHelperUtil::allocator(), @@ -544,8 +544,8 @@ static void test4_subscriptionHandle() const bmqt::SubscriptionHandle& actualHandle = message.subscriptionHandle(); PVV("Empty subscription handle: " << actualHandle); - ASSERT_EQ(actualHandle.id(), defaultSubscriptionId); - ASSERT_EQ(actualHandle.correlationId(), emptyCorrelationId); + BMQTST_ASSERT_EQ(actualHandle.id(), defaultSubscriptionId); + BMQTST_ASSERT_EQ(actualHandle.correlationId(), emptyCorrelationId); } PV("PUT MESSAGE - FAIL") @@ -560,7 +560,7 @@ static void test4_subscriptionHandle() // Create PutEventBuilder bmqp::PutEventBuilder builder(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(0, builder.messageCount()); + BMQTST_ASSERT_EQ(0, builder.messageCount()); // Add message builder.startMessage(); @@ -569,8 +569,8 @@ static void test4_subscriptionHandle() bmqt::EventBuilderResult::Enum rc = builder.packMessage(queueId); - ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); - ASSERT_EQ(1, builder.messageCount()); + BMQTST_ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); + BMQTST_ASSERT_EQ(1, builder.messageCount()); bmqp::Event bmqpEvent(&builder.blob(), bmqtst::TestHelperUtil::allocator()); @@ -601,13 +601,13 @@ static void test4_subscriptionHandle() // Create AckEventBuilder bmqp::AckEventBuilder builder(&bufferFactory, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(0, builder.messageCount()); + BMQTST_ASSERT_EQ(0, builder.messageCount()); bmqt::EventBuilderResult::Enum rc = builder.appendMessage(0, queueId, guid, queueId); - ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); - ASSERT_EQ(1, builder.messageCount()); + BMQTST_ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); + BMQTST_ASSERT_EQ(1, builder.messageCount()); bmqp::Event bmqpEvent(&builder.blob(), bmqtst::TestHelperUtil::allocator()); diff --git a/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp b/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp index 46e06bbc19..7045bac42d 100644 --- a/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_messageevent.t.cpp @@ -81,7 +81,7 @@ static void appendMessages(bmqp::AckEventBuilder* builder, data.d_corrId, data.d_guid, data.d_queueId); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); vec->push_back(data); } } @@ -200,13 +200,13 @@ static void test2_ackMesageIteratorTest() while (i.nextMessage()) { const bmqa::Message* msg = &(i.message()); - ASSERT_EQ(msg->correlationId(), + BMQTST_ASSERT_EQ(msg->correlationId(), bmqt::CorrelationId(messages[offset].d_corrId)); - ASSERT_EQ(msg->messageGUID(), messages[offset].d_guid); + BMQTST_ASSERT_EQ(msg->messageGUID(), messages[offset].d_guid); ++offset; } - ASSERT_EQ(offset, k_NUM_MSGS); + BMQTST_ASSERT_EQ(offset, k_NUM_MSGS); } } @@ -241,7 +241,7 @@ static void test3_putMessageIteratorTest() &messages, &bufferFactory, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); + BMQTST_ASSERT_EQ(rc, bmqt::EventBuilderResult::e_SUCCESS); } bmqp::Event rawEvent(&builder.blob(), bmqtst::TestHelperUtil::allocator()); @@ -271,17 +271,17 @@ static void test3_putMessageIteratorTest() while (i.nextMessage()) { const bmqa::Message* msg = &(i.message()); - ASSERT_EQ(msg->correlationId(), bmqt::CorrelationId(offset)); + BMQTST_ASSERT_EQ(msg->correlationId(), bmqt::CorrelationId(offset)); bdlbb::Blob payload(&bufferFactory, bmqtst::TestHelperUtil::allocator()); int rc = msg->getData(&payload); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); // Content isn't the same. Length is. Why? ASSERT(payload.length() == messages[offset].d_payload.length()); ++offset; } - ASSERT_EQ(offset, k_NUM_MSGS); + 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 659d633b63..798cf38a8c 100644 --- a/src/groups/bmq/bmqa/bmqa_messageeventbuilder.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_messageeventbuilder.t.cpp @@ -62,7 +62,7 @@ static void test2_testMessageEventSizeCount() // Start session BMQA_EXPECT_CALL(session, start()).returning(0); const int rc = session.start(); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); } bmqt::Uri uri(bmqtst::TestHelperUtil::allocator()); @@ -73,7 +73,7 @@ static void test2_testMessageEventSizeCount() bsl::string input("bmq://my.domain/queue", bmqtst::TestHelperUtil::allocator()); const int rc = bmqt::UriParser::parse(&uri, &error, input); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); } bmqt::CorrelationId queueCId = bmqt::CorrelationId::autoValue(); @@ -87,7 +87,7 @@ static void test2_testMessageEventSizeCount() const int rc = session.openQueue(&queueId, uri, bmqt::QueueFlags::e_WRITE); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); } // Stage 2: populate MessageEventBuilder @@ -96,7 +96,7 @@ static void test2_testMessageEventSizeCount() // Empty MessageEvent should contain at least its header ASSERT(builder.messageEventSize() > 0); - ASSERT_EQ(0, builder.messageCount()); + BMQTST_ASSERT_EQ(0, builder.messageCount()); const bsl::string payload("test payload", bmqtst::TestHelperUtil::allocator()); @@ -112,16 +112,16 @@ static void test2_testMessageEventSizeCount() // Make sure that 'messageEventSize' and 'messageCount' remain the same // before packing the message - ASSERT_EQ(messageEventSizeBefore, builder.messageEventSize()); - ASSERT_EQ(messageCountBefore, builder.messageCount()); + BMQTST_ASSERT_EQ(messageEventSizeBefore, builder.messageEventSize()); + BMQTST_ASSERT_EQ(messageCountBefore, builder.messageCount()); builder.packMessage(queueId); // Make sure that 'messageEventSize' and 'messageCount' increase // after packing the message - ASSERT_LT(messageEventSizeBefore, builder.messageEventSize()); - ASSERT_LT(messageCountBefore, builder.messageCount()); - ASSERT_EQ(i, builder.messageCount()); + BMQTST_ASSERT_LT(messageEventSizeBefore, builder.messageEventSize()); + BMQTST_ASSERT_LT(messageCountBefore, builder.messageCount()); + BMQTST_ASSERT_EQ(i, builder.messageCount()); } // Stage 3: start a new message but do not pack @@ -137,8 +137,8 @@ static void test2_testMessageEventSizeCount() // Make sure that 'messageEventSize' and 'messageCount' remain the same // since we do not pack the last started message - ASSERT_EQ(messageEventSizeFinal, builder.messageEventSize()); - ASSERT_EQ(messageCountFinal, builder.messageCount()); + BMQTST_ASSERT_EQ(messageEventSizeFinal, builder.messageEventSize()); + BMQTST_ASSERT_EQ(messageCountFinal, builder.messageCount()); // Stage 4: build MessageEvent // MessageEventBuilder switches from WRITE mode to READ: @@ -148,8 +148,8 @@ static void test2_testMessageEventSizeCount() } // We had non-packed Message before, make sure it was not added to the blob - ASSERT_EQ(messageEventSizeFinal, builder.messageEventSize()); - ASSERT_EQ(messageCountFinal, builder.messageCount()); + BMQTST_ASSERT_EQ(messageEventSizeFinal, builder.messageEventSize()); + BMQTST_ASSERT_EQ(messageCountFinal, builder.messageCount()); // Stage 5: reset MessageEventBuilder // MessageEventBuilder switches from READ mode to WRITE: @@ -157,8 +157,8 @@ static void test2_testMessageEventSizeCount() // Since we resetted the MessageEventBuilder, the currently built message // event is smaller than the populated one from the previous steps - ASSERT_LT(builder.messageEventSize(), messageEventSizeFinal); - ASSERT_EQ(0, builder.messageCount()); + BMQTST_ASSERT_LT(builder.messageEventSize(), messageEventSizeFinal); + BMQTST_ASSERT_EQ(0, builder.messageCount()); } // ============================================================================ diff --git a/src/groups/bmq/bmqa/bmqa_mocksession.h b/src/groups/bmq/bmqa/bmqa_mocksession.h index b9ba02dd81..ec10d0d57a 100644 --- a/src/groups/bmq/bmqa/bmqa_mocksession.h +++ b/src/groups/bmq/bmqa/bmqa_mocksession.h @@ -241,19 +241,19 @@ /// /// // Make a call to startAsync and emit the event that is enqueued from /// // that call. -/// ASSERT_EQ(mockSession.startAsync(), 0); +/// BMQTST_ASSERT_EQ(mockSession.startAsync(), 0); /// /// // Emit our enqueued event. This fully sets up the session which is /// // now ready to use. Typically you would have some business logic on /// // 'e_CONNECTED' that makes your application ready to use. -/// ASSERT_EQ(mockSession.emitEvent(), true); +/// BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); /// /// // Our event handler internally just stores the event emitted, so pop /// // it out and examine. /// bmqa::SessionEvent startEvent(eventHandler.popSessionEvent()); /// -/// ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); -/// ASSERT_EQ(startEvent.status Code(), 0); +/// BMQTST_ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); +/// BMQTST_ASSERT_EQ(startEvent.status Code(), 0); /// /// // Create the uri to your queue as you would in your application. /// const bmqt::Uri uri("bmq://my.domain/queue"); @@ -297,11 +297,11 @@ /// /// // We just enqueued a 'bmqa::OpenQueueStatus' to be emitted. We can /// // emit it using 'emitEvent'. -/// ASSERT_EQ(mockSession.emitEvent(), true); +/// BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); /// /// // Pop out this event from the handler and examine it. /// bmqa::OpenQueueStatus result = eventHandler.popOpenQueueStatus(); -/// ASSERT_EQ(result, openQueueResult); +/// BMQTST_ASSERT_EQ(result, openQueueResult); /// /// // On emission of 'bmqa::OpenQueueStatus', the queue is fully open and /// // we can now post to it. @@ -317,7 +317,7 @@ /// // been elided for brevity. /// /// // Now that the event has been built we can 'post' it to BMQ. -/// ASSERT_EQ(mockSession.post(builder.messageEvent()), 0); +/// BMQTST_ASSERT_EQ(mockSession.post(builder.messageEvent()), 0); /// /// // Simply creating a blob buffer factory on the stack to be used by /// // 'createAckEvent'. Typically you would have one for the component. @@ -342,14 +342,14 @@ /// d_allocator_p)); /// /// // Emit the enqueued ack event. -/// ASSERT_EQ(mockSession.emitEvent(), true); +/// BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); /// /// // As we did earlier, pop it out and examine. /// bmqa::MessageEvent ackEvent(eventHandler.popMessageEvent()); -/// ASSERT_EQ(ackEvent.type(), bmqt::MessageEventType::e_ACK); +/// BMQTST_ASSERT_EQ(ackEvent.type(), bmqt::MessageEventType::e_ACK); /// bmqa::MessageIterator mIter = ackEvent.messageIterator(); /// mIter.nextMessage(); -/// ASSERT_EQ(mIter.message().ackStatus(), bmqt::AckResult::e_SUCCESS); +/// BMQTST_ASSERT_EQ(mIter.message().ackStatus(), bmqt::AckResult::e_SUCCESS); /// /// // This is a simple test. After posting our message and receiving the /// // ack, we are now shutting down our application. Therefore we expect @@ -366,13 +366,13 @@ /// 0, // statusCode /// "", // errorDescription /// d_allocator_p)); -/// ASSERT_EQ(mockSession.emitEvent(), true); +/// BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); /// /// // Our event handler internally just stores the event emitted, so pop /// // it out and examine. /// bmqa::SessionEvent stopEvent(eventHandler.popSessionEvent()); -/// ASSERT_EQ(stopEvent.type(), bmqt::SessionEventType::e_DISCONNECTED); -/// ASSERT_EQ(stopEvent.statusCode(), 0); +/// BMQTST_ASSERT_EQ(stopEvent.type(), bmqt::SessionEventType::e_DISCONNECTED); +/// BMQTST_ASSERT_EQ(stopEvent.statusCode(), 0); /// /// // The corresponding pendant operation of the 'initialize' which would /// // need to be called only if 'initialize' was explicitly called. @@ -488,30 +488,30 @@ /// // 'startAsync' is the first call. We expect it to return 0 and we /// // expect 'nextEvent' to return the 'e_CONNECTED' session event. /// int rc = mockSession.startAsync(); -/// ASSERT_EQ(rc, 0); +/// BMQTST_ASSERT_EQ(rc, 0); /// bmqa::SessionEvent startEvent = mockSession.nextEvent( /// bsls::TimeInterval()) /// .sessionEvent(); -/// ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); -/// ASSERT_EQ(startEvent.statusCode(), 0); -/// ASSERT_EQ(startEvent.errorDescription(), ""); +/// BMQTST_ASSERT_EQ(startEvent.type(), bmqt::SessionEventType::e_CONNECTED); +/// BMQTST_ASSERT_EQ(startEvent.statusCode(), 0); +/// BMQTST_ASSERT_EQ(startEvent.errorDescription(), ""); /// /// // Next we expect a call to 'openQueue' to open the queue. /// bmqa::OpenQueueStatus result = mockSession.openQueueSync(&queueId, /// uri, /// flags); -/// ASSERT_EQ(result, expectedResult); +/// BMQTST_ASSERT_EQ(result, expectedResult); /// /// // Now our call to 'nextEvent' will generate a push message from the /// // broker, which we will then go on to confirm. /// bmqa::MessageEvent pushMsgEvt(mockSession.nextEvent( /// bsls::TimeInterval()) /// .messageEvent()); -/// ASSERT_EQ(pushMsgEvt.type(), bmqt::MessageEventType::e_PUSH); +/// BMQTST_ASSERT_EQ(pushMsgEvt.type(), bmqt::MessageEventType::e_PUSH); /// /// // Now that we have received a push message which has yet to be /// // confirmed, we can confirm that 1 unconfirmed message exists. -/// ASSERT_EQ(mockSession.unconfirmedMessages(), 1U); +/// BMQTST_ASSERT_EQ(mockSession.unconfirmedMessages(), 1U); /// /// // Since there is only 1 message in our message event, we dont have to /// // iterate over the event but in reality you will want to iterate over @@ -519,14 +519,14 @@ /// bmqa::MessageIterator mIter = pushMsgEvt.messageIterator(); /// mIter.nextMessage(); /// confirmBuilder.addMessageConfirmation(mIter.message()); -/// ASSERT_EQ(confirmBuilder.messageCount(), 1); +/// BMQTST_ASSERT_EQ(confirmBuilder.messageCount(), 1); /// /// // Confirm the messages using the builder that has been populated. /// rc = mockSession.confirmMessages(&confirmBuilder); -/// ASSERT_EQ(rc, 0); +/// BMQTST_ASSERT_EQ(rc, 0); /// /// // Voila! We now have no unconfirmed messages. -/// ASSERT_EQ(mockSession.unconfirmedMessages(), 0u); +/// BMQTST_ASSERT_EQ(mockSession.unconfirmedMessages(), 0u); /// // 'stop' has been elided for brevity and is analogous to 'start' /// /// // The corresponding pendant operation of the 'initialize' which would diff --git a/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp b/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp index 7e25c03a2b..e076ef3207 100644 --- a/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_mocksession.t.cpp @@ -281,10 +281,10 @@ static void test1_staticMethods() bmqtst::TestHelperUtil::allocator()); bmqa::SessionEvent sessionEvent = event.sessionEvent(); - ASSERT_EQ(sessionEvent.type(), bmqt::SessionEventType::e_CONNECTED); - ASSERT_EQ(sessionEvent.statusCode(), 0); - ASSERT_EQ(sessionEvent.errorDescription(), errorDescription); - ASSERT_EQ(sessionEvent.correlationId(), bmqt::CorrelationId(1)); + BMQTST_ASSERT_EQ(sessionEvent.type(), bmqt::SessionEventType::e_CONNECTED); + BMQTST_ASSERT_EQ(sessionEvent.statusCode(), 0); + BMQTST_ASSERT_EQ(sessionEvent.errorDescription(), errorDescription); + BMQTST_ASSERT_EQ(sessionEvent.correlationId(), bmqt::CorrelationId(1)); } { @@ -319,13 +319,13 @@ static void test1_staticMethods() bmqtst::TestHelperUtil::allocator()); bmqa::MessageEvent ackEvent = event.messageEvent(); - ASSERT_EQ(ackEvent.type(), bmqt::MessageEventType::e_ACK); + BMQTST_ASSERT_EQ(ackEvent.type(), bmqt::MessageEventType::e_ACK); bmqa::MessageIterator mIter = ackEvent.messageIterator(); mIter.nextMessage(); - ASSERT_EQ(mIter.message().ackStatus(), bmqt::AckResult::e_SUCCESS); - ASSERT_EQ(mIter.message().queueId(), queueId); - ASSERT_EQ(mIter.message().correlationId(), corrId); + BMQTST_ASSERT_EQ(mIter.message().ackStatus(), bmqt::AckResult::e_SUCCESS); + BMQTST_ASSERT_EQ(mIter.message().queueId(), queueId); + BMQTST_ASSERT_EQ(mIter.message().correlationId(), corrId); } { @@ -344,11 +344,11 @@ static void test1_staticMethods() bmqtst::TestHelperUtil::allocator()); bmqa::SessionEvent openQueueEvent = event.sessionEvent(); - ASSERT_EQ(openQueueEvent.type(), + BMQTST_ASSERT_EQ(openQueueEvent.type(), bmqt::SessionEventType::e_QUEUE_OPEN_RESULT); - ASSERT_EQ(openQueueEvent.statusCode(), 0); - ASSERT_EQ(openQueueEvent.errorDescription(), ""); - ASSERT_EQ(openQueueEvent.correlationId(), corrId); + BMQTST_ASSERT_EQ(openQueueEvent.statusCode(), 0); + BMQTST_ASSERT_EQ(openQueueEvent.errorDescription(), ""); + BMQTST_ASSERT_EQ(openQueueEvent.correlationId(), corrId); } { @@ -378,19 +378,19 @@ static void test1_staticMethods() bmqa::MessageEvent pushMsgEvt = event.messageEvent(); - ASSERT_EQ(pushMsgEvt.type(), bmqt::MessageEventType::e_PUSH); + BMQTST_ASSERT_EQ(pushMsgEvt.type(), bmqt::MessageEventType::e_PUSH); bmqa::MessageIterator mIter = pushMsgEvt.messageIterator(); mIter.nextMessage(); - ASSERT_EQ(mIter.message().queueId(), queueId); - ASSERT_EQ(mIter.message().messageGUID(), guid); - ASSERT_EQ(mIter.message().dataSize(), 6); + BMQTST_ASSERT_EQ(mIter.message().queueId(), queueId); + BMQTST_ASSERT_EQ(mIter.message().messageGUID(), guid); + BMQTST_ASSERT_EQ(mIter.message().dataSize(), 6); bmqa::MessageProperties out; - ASSERT_EQ(mIter.message().loadProperties(&out), 0); + BMQTST_ASSERT_EQ(mIter.message().loadProperties(&out), 0); - ASSERT_EQ(out.totalSize(), properties.totalSize()); - ASSERT_EQ(out.getPropertyAsInt32("x"), + BMQTST_ASSERT_EQ(out.totalSize(), properties.totalSize()); + BMQTST_ASSERT_EQ(out.getPropertyAsInt32("x"), properties.getPropertyAsInt32("x")); } @@ -414,7 +414,7 @@ static void test2_call() PVV("Incorrect call"); BMQA_EXPECT_CALL(mockSession, start()).returning(0); ASSERT_FAIL(mockSession.stop()); - ASSERT_EQ(mockSession.start(), 0); + BMQTST_ASSERT_EQ(mockSession.start(), 0); } { @@ -428,7 +428,7 @@ static void test2_call() .returning(0); ASSERT_FAIL(mockSession.startAsync(bsls::TimeInterval(1))); // To clear the expected queue. - ASSERT_EQ(mockSession.startAsync(bsls::TimeInterval(10)), 0); + BMQTST_ASSERT_EQ(mockSession.startAsync(bsls::TimeInterval(10)), 0); } { @@ -452,7 +452,7 @@ static void test2_call() mockSession_sp.clear(); // Our mockSession reference is also invalid at this point. - ASSERT_EQ(eventHandler.d_assertsInvoked, 1u); + BMQTST_ASSERT_EQ(eventHandler.d_assertsInvoked, 1u); } } @@ -526,21 +526,21 @@ static void test3_queueManagement() typedef bsl::shared_ptr& QueueImplPtr; QueueImplPtr implPtr = reinterpret_cast(queueId1); - ASSERT_EQ(implPtr->uri(), uri1); - ASSERT_EQ(implPtr->correlationId(), corrId1); + BMQTST_ASSERT_EQ(implPtr->uri(), uri1); + BMQTST_ASSERT_EQ(implPtr->correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); bmqa::OpenQueueStatus result = eventHandler.popResult(); - ASSERT_EQ(result.queueId(), openQueueResult.queueId()); - ASSERT_EQ(result.result(), openQueueResult.result()); - ASSERT_EQ(result.errorDescription(), + BMQTST_ASSERT_EQ(result.queueId(), openQueueResult.queueId()); + BMQTST_ASSERT_EQ(result.result(), openQueueResult.result()); + BMQTST_ASSERT_EQ(result.errorDescription(), openQueueResult.errorDescription()); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_CLOSED); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_CLOSED); } { @@ -564,21 +564,21 @@ static void test3_queueManagement() typedef bsl::shared_ptr& QueueImplPtr; QueueImplPtr implPtr = reinterpret_cast(queueId1); - ASSERT_EQ(implPtr->uri(), uri1); - ASSERT_EQ(implPtr->correlationId(), corrId1); + BMQTST_ASSERT_EQ(implPtr->uri(), uri1); + BMQTST_ASSERT_EQ(implPtr->correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); bmqa::OpenQueueStatus result = eventHandler.popResult(); - ASSERT_EQ(result.result(), 0); - ASSERT_EQ(result.errorDescription(), ""); - ASSERT_EQ(result.queueId().correlationId(), corrId1); + BMQTST_ASSERT_EQ(result.result(), 0); + BMQTST_ASSERT_EQ(result.errorDescription(), ""); + BMQTST_ASSERT_EQ(result.queueId().correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENED); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENED); } } @@ -589,22 +589,22 @@ static void test3_queueManagement() { PVVV("Valid queue by uri"); bmqa::QueueId queueIdFound(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), 0); - ASSERT_EQ(queueIdFound, queueId1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), 0); + BMQTST_ASSERT_EQ(queueIdFound, queueId1); } { PVVV("Valid queue by uri"); bmqa::QueueId queueIdFound(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId1), 0); - ASSERT_EQ(queueIdFound, queueId1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId1), 0); + BMQTST_ASSERT_EQ(queueIdFound, queueId1); } { PVVV("Registered but unused queue"); bmqa::QueueId queueIdFound(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri2), -1); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId2), -1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri2), -1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId2), -1); } { @@ -620,14 +620,14 @@ static void test3_queueManagement() // Close queue and then attempt to get queue BMQA_EXPECT_CALL(mockSession, closeQueueSync(&queueId1)) .returning(closeResult1); - ASSERT_EQ(mockSession.closeQueueSync(&queueId1), closeResult1); - ASSERT_EQ(closeResult1.queueId(), queueId1); - ASSERT_EQ(closeResult1.result(), + BMQTST_ASSERT_EQ(mockSession.closeQueueSync(&queueId1), closeResult1); + BMQTST_ASSERT_EQ(closeResult1.queueId(), queueId1); + BMQTST_ASSERT_EQ(closeResult1.result(), bmqt::CloseQueueResult::e_SUCCESS); bmqa::QueueId queueIdFound(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), -1); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId1), -1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), -1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId1), -1); // Close queue successfully and then attempt to get queue bmqa::CloseQueueStatus closeResult2 = @@ -639,10 +639,10 @@ static void test3_queueManagement() BMQA_EXPECT_CALL(mockSession, closeQueueSync(&queueId1)) .returning(closeResult2); - ASSERT_EQ(mockSession.closeQueueSync(&queueId1), closeResult2); + BMQTST_ASSERT_EQ(mockSession.closeQueueSync(&queueId1), closeResult2); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), -1); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId1), -1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), -1); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, corrId1), -1); } } @@ -672,7 +672,7 @@ static void test3_queueManagement() openQueueSync(&queueId1, uri1, bmqt::QueueFlags::e_READ)) .returning(testOpenQueueResult); - ASSERT_EQ(mockSession.openQueueSync(&queueId1, + BMQTST_ASSERT_EQ(mockSession.openQueueSync(&queueId1, uri1, bmqt::QueueFlags::e_READ), testOpenQueueResult); @@ -680,15 +680,15 @@ static void test3_queueManagement() typedef bsl::shared_ptr& QueueImplPtr; QueueImplPtr implPtr = reinterpret_cast(queueId1); - ASSERT_EQ(implPtr->uri(), uri1); - ASSERT_EQ(implPtr->correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENED); + BMQTST_ASSERT_EQ(implPtr->uri(), uri1); + BMQTST_ASSERT_EQ(implPtr->correlationId(), corrId1); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENED); bmqa::QueueId queueIdFound(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), 0); + BMQTST_ASSERT_EQ(mockSession.getQueueId(&queueIdFound, uri1), 0); ASSERT(queueId1 == queueIdFound); - ASSERT_NE(queueId1, savedQueueId); + BMQTST_ASSERT_NE(queueId1, savedQueueId); bmqa::CloseQueueStatus closeResult1 = bmqa::MockSessionUtil::createCloseQueueStatus( @@ -700,7 +700,7 @@ static void test3_queueManagement() // Close queue and then attempt to get queue BMQA_EXPECT_CALL(mockSession, closeQueueSync(&queueId1)) .returning(closeResult1); - ASSERT_EQ(mockSession.closeQueueSync(&queueId1), closeResult1); + BMQTST_ASSERT_EQ(mockSession.closeQueueSync(&queueId1), closeResult1); } } @@ -742,24 +742,24 @@ static void test4_queueManagementSync() "", bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(mockSession.openQueueAsync(&queueId1, uri1, 10), 0); + BMQTST_ASSERT_EQ(mockSession.openQueueAsync(&queueId1, uri1, 10), 0); typedef bsl::shared_ptr& QueueImplPtr; QueueImplPtr implPtr = reinterpret_cast(queueId1); - ASSERT_EQ(implPtr->uri(), uri1); - ASSERT_EQ(implPtr->correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); + BMQTST_ASSERT_EQ(implPtr->uri(), uri1); + BMQTST_ASSERT_EQ(implPtr->correlationId(), corrId1); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); bmqa::SessionEvent openQueueEvent = mockSession.nextEvent().sessionEvent(); - ASSERT_EQ(openQueueEvent.type(), + BMQTST_ASSERT_EQ(openQueueEvent.type(), bmqt::SessionEventType::e_QUEUE_OPEN_RESULT); - ASSERT_EQ(openQueueEvent.statusCode(), 1); - ASSERT_EQ(openQueueEvent.errorDescription(), ""); - ASSERT_EQ(openQueueEvent.correlationId(), corrId1); + BMQTST_ASSERT_EQ(openQueueEvent.statusCode(), 1); + BMQTST_ASSERT_EQ(openQueueEvent.errorDescription(), ""); + BMQTST_ASSERT_EQ(openQueueEvent.correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_CLOSED); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_CLOSED); } { @@ -775,23 +775,23 @@ static void test4_queueManagementSync() "", bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(mockSession.openQueueAsync(&queueId1, uri1, 10), 0); + BMQTST_ASSERT_EQ(mockSession.openQueueAsync(&queueId1, uri1, 10), 0); typedef bsl::shared_ptr& QueueImplPtr; QueueImplPtr implPtr = reinterpret_cast(queueId1); - ASSERT_EQ(implPtr->uri(), uri1); - ASSERT_EQ(implPtr->correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); + BMQTST_ASSERT_EQ(implPtr->uri(), uri1); + BMQTST_ASSERT_EQ(implPtr->correlationId(), corrId1); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENING_OPN); bmqa::SessionEvent openQueueEvent = mockSession.nextEvent().sessionEvent(); - ASSERT_EQ(openQueueEvent.type(), + BMQTST_ASSERT_EQ(openQueueEvent.type(), bmqt::SessionEventType::e_QUEUE_OPEN_RESULT); - ASSERT_EQ(openQueueEvent.statusCode(), 0); - ASSERT_EQ(openQueueEvent.errorDescription(), ""); - ASSERT_EQ(openQueueEvent.correlationId(), corrId1); + BMQTST_ASSERT_EQ(openQueueEvent.statusCode(), 0); + BMQTST_ASSERT_EQ(openQueueEvent.errorDescription(), ""); + BMQTST_ASSERT_EQ(openQueueEvent.correlationId(), corrId1); - ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENED); + BMQTST_ASSERT_EQ(implPtr->state(), bmqimp::QueueState::e_OPENED); } } @@ -852,9 +852,9 @@ static void test5_confirmingMessages() &bufferFactory, bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); - ASSERT_EQ(mockSession.unconfirmedMessages(), 3u); + BMQTST_ASSERT_EQ(mockSession.unconfirmedMessages(), 3u); bmqa::MessageEvent messageEvent = eventHandler.popMessageEvent(); { PVV("Confirm push message"); @@ -888,26 +888,26 @@ static void test5_confirmingMessages() mIter.nextMessage(); int rc = confirmBuilder.addMessageConfirmation(mIter.message()); - ASSERT_EQ(rc, 0); - ASSERT_EQ(confirmBuilder.messageCount(), 1); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(confirmBuilder.messageCount(), 1); // we know the guid is invalid so we say the return value is -1. BMQA_EXPECT_CALL(mockSession, confirmMessages(&confirmBuilder)) .returning(bmqt::GenericResult::e_INVALID_ARGUMENT); rc = mockSession.confirmMessages(&confirmBuilder); - ASSERT_EQ(rc, bmqt::GenericResult::e_INVALID_ARGUMENT); + BMQTST_ASSERT_EQ(rc, bmqt::GenericResult::e_INVALID_ARGUMENT); // we know the guid is invalid so we say the return value is -1. BMQA_EXPECT_CALL(mockSession, confirmMessage(mIter.message())) .returning(bmqt::GenericResult::e_INVALID_ARGUMENT); rc = mockSession.confirmMessage(mIter.message()); - ASSERT_EQ(rc, bmqt::GenericResult::e_INVALID_ARGUMENT); + BMQTST_ASSERT_EQ(rc, bmqt::GenericResult::e_INVALID_ARGUMENT); // Finally ensure that no messages were confirmed. (3 messages were // consumed/received from the broker) - ASSERT_EQ(mockSession.unconfirmedMessages(), 3u); + BMQTST_ASSERT_EQ(mockSession.unconfirmedMessages(), 3u); } { @@ -920,13 +920,13 @@ static void test5_confirmingMessages() mIter.nextMessage(); confirmBuilder.addMessageConfirmation(mIter.message()); - ASSERT_EQ(confirmBuilder.messageCount(), 1); + BMQTST_ASSERT_EQ(confirmBuilder.messageCount(), 1); BMQA_EXPECT_CALL(mockSession, confirmMessages(&confirmBuilder)) .returning(0); int rc = mockSession.confirmMessages(&confirmBuilder); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.unconfirmedMessages(), 2u); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.unconfirmedMessages(), 2u); } { @@ -940,14 +940,14 @@ static void test5_confirmingMessages() mIter.nextMessage(); confirmBuilder.addMessageConfirmation(mIter.message()); - ASSERT_EQ(confirmBuilder.messageCount(), 1); + BMQTST_ASSERT_EQ(confirmBuilder.messageCount(), 1); BMQA_EXPECT_CALL(mockSession, confirmMessages(&confirmBuilder)) .returning(0); int rc = mockSession.confirmMessages(&confirmBuilder); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.unconfirmedMessages(), 2u); + BMQTST_ASSERT_EQ(mockSession.unconfirmedMessages(), 2u); } { @@ -964,8 +964,8 @@ static void test5_confirmingMessages() BMQA_EXPECT_CALL(mockSession, confirmMessage(mIter.message())) .returning(0); int rc = mockSession.confirmMessage(mIter.message()); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.unconfirmedMessages(), 1u); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.unconfirmedMessages(), 1u); } } } @@ -1043,74 +1043,74 @@ static void test6_runThrough() .returning(0) .emitting(testEvent); int rc = mockSession.start(); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, startAsync()) .returning(0) .emitting(testEvent); rc = mockSession.startAsync(); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, stop()).emitting(testEvent); mockSession.stop(); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, stopAsync()).emitting(testEvent); mockSession.stopAsync(); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, finalizeStop()).emitting(testEvent); mockSession.finalizeStop(); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, openQueue(&queueId, uri, 0)) .returning(0) .emitting(testEvent); rc = mockSession.openQueue(&queueId, uri, 0); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, closeQueue(&queueId)) .returning(0) .emitting(testEvent); rc = mockSession.closeQueue(&queueId); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, openQueueAsync(&queueId, uri, 0)) .returning(0) .emitting(testEvent); rc = mockSession.openQueueAsync(&queueId, uri, 0); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, closeQueueAsync(&queueId)) .returning(0) .emitting(testEvent); rc = mockSession.closeQueueAsync(&queueId); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, closeQueueAsync(&queueId, closeQueueCallback)) .emitting(testCloseQueueResult); mockSession.closeQueueAsync(&queueId, closeQueueCallback); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, openQueueAsync(&queueId, uri, 0, openQueueCallback)) .emitting(testOpenQueueResult); mockSession.openQueueAsync(&queueId, uri, 0, openQueueCallback); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, configureQueue(&queueId)) .returning(0) .emitting(testEvent); rc = mockSession.configureQueue(&queueId); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, configureQueueSync(&queueId, @@ -1118,18 +1118,18 @@ static void test6_runThrough() bsls::TimeInterval())) .returning(testConfigureQueueResult) .emitting(testEvent); - ASSERT_EQ(mockSession.configureQueueSync(&queueId, + BMQTST_ASSERT_EQ(mockSession.configureQueueSync(&queueId, bmqt::QueueOptions(), bsls::TimeInterval()), testConfigureQueueResult); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, configureQueueAsync(&queueId)) .returning(0) .emitting(testEvent); rc = mockSession.configureQueueAsync(&queueId); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, configureQueueAsync(&queueId, @@ -1139,14 +1139,14 @@ static void test6_runThrough() mockSession.configureQueueAsync(&queueId, bmqt::QueueOptions(), configureQueueCallback); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); BMQA_EXPECT_CALL(mockSession, post(bmqa::MessageEvent())) .returning(0) .emitting(testEvent); rc = mockSession.post(bmqa::MessageEvent()); - ASSERT_EQ(rc, 0); - ASSERT_EQ(mockSession.emitEvent(), true); + BMQTST_ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(mockSession.emitEvent(), true); } { @@ -1188,23 +1188,23 @@ static void test6_runThrough() BMQA_EXPECT_CALL(mockSession, confirmMessage(mIter.message())) .returning(0); int rc = mockSession.confirmMessage(mIter.message()); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); BMQA_EXPECT_CALL(mockSession, confirmMessage(mIter.message().confirmationCookie())) .returning(0); rc = mockSession.confirmMessage(mIter.message()); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); // Create confirm builder and confirm messages bmqa::ConfirmEventBuilder confirmBuilder; mockSession.loadConfirmEventBuilder(&confirmBuilder); rc = confirmBuilder.addMessageConfirmation(mIter.message()); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); BMQA_EXPECT_CALL(mockSession, confirmMessages(&confirmBuilder)) .returning(0); rc = mockSession.confirmMessages(&confirmBuilder); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); } { @@ -1220,10 +1220,10 @@ static void test6_runThrough() // removed from the two key hash map yet and can still be looked up. bmqa::QueueId foundId; int rc = mockSession.getQueueId(&foundId, uri); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); rc = mockSession.getQueueId(&foundId, corrId); - ASSERT_EQ(rc, 0); + BMQTST_ASSERT_EQ(rc, 0); } // Clear the handler since we dont care about the events emitted @@ -1274,77 +1274,77 @@ static void test7_postAndAccess() bmqa::Message& bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload1); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload2); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload3); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); bmqa::MessageEvent retrievedPostedEvent; - ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), false); + BMQTST_ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), false); bmqa::MessageEvent postedEvent(builder.messageEvent()); BMQA_EXPECT_CALL(mockSession, post(builder.messageEvent())).returning(0); - ASSERT_EQ(mockSession.post(postedEvent), 0); + BMQTST_ASSERT_EQ(mockSession.post(postedEvent), 0); - ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), true); + BMQTST_ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), true); // Please see description of 'compareEvents' for additional details on // messageEvent comparison. // NOTE: Comparison is implementation specific. - ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent, postedEvent), + BMQTST_ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent, postedEvent), true); - ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), false); + BMQTST_ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), false); // Append another 2 events builder.reset(); bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload1); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload2); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload3); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload4); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); bmqa::MessageEvent postedEvent2(builder.messageEvent()); bmqa::MessageEvent postedEvent3(builder.messageEvent()); BMQA_EXPECT_CALL(mockSession, post(postedEvent2)).returning(0); - ASSERT_EQ(mockSession.post(postedEvent2), 0); + BMQTST_ASSERT_EQ(mockSession.post(postedEvent2), 0); BMQA_EXPECT_CALL(mockSession, post(postedEvent3)).returning(0); - ASSERT_EQ(mockSession.post(postedEvent3), 0); + BMQTST_ASSERT_EQ(mockSession.post(postedEvent3), 0); bmqa::MessageEvent retrievedPostedEvent2; bmqa::MessageEvent retrievedPostedEvent3; // ASSERT that the compare fails for different events - ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent2, postedEvent), + BMQTST_ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent2, postedEvent), false); - ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent2), true); - ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent2, postedEvent2), + BMQTST_ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent2), true); + BMQTST_ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent2, postedEvent2), true); - ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent3), true); - ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent3, postedEvent3), + BMQTST_ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent3), true); + BMQTST_ASSERT_EQ(EventHandler::compareEvents(retrievedPostedEvent3, postedEvent3), true); // We are out of posted messages again. - ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), false); + BMQTST_ASSERT_EQ(mockSession.popPostedEvent(&retrievedPostedEvent), false); eventHandler.clearEvents(); @@ -1396,12 +1396,12 @@ static void test8_postBlockedToSuspendedQueue() // Ensure that the message cannot be packed. bmqa::Message& bmqMessage = builder.startMessage(); bmqMessage.setDataRef(&payload); - ASSERT_EQ(builder.packMessage(queueId), + BMQTST_ASSERT_EQ(builder.packMessage(queueId), bmqt::EventBuilderResult::e_QUEUE_SUSPENDED); // Unsuspend the queue, and try again. implPtr->setIsSuspended(false); - ASSERT_EQ(builder.packMessage(queueId), 0); + BMQTST_ASSERT_EQ(builder.packMessage(queueId), 0); eventHandler.clearEvents(); // Ensure that the builder is clear to ensure that the blob held by the diff --git a/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp b/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp index beefb5cc1a..78f7603087 100644 --- a/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_openqueuestatus.t.cpp @@ -57,9 +57,9 @@ static void test1_breathingTest() PV("Default Constructor"); { bmqa::OpenQueueStatus obj(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj), true); - ASSERT_EQ(obj.result(), bmqt::OpenQueueResult::e_SUCCESS); - ASSERT_EQ(obj.errorDescription(), + BMQTST_ASSERT_EQ(bool(obj), true); + BMQTST_ASSERT_EQ(obj.result(), bmqt::OpenQueueResult::e_SUCCESS); + BMQTST_ASSERT_EQ(obj.errorDescription(), bsl::string("", bmqtst::TestHelperUtil::allocator())); } @@ -79,10 +79,10 @@ static void test1_breathingTest() errorDescription, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj), false); - ASSERT_EQ(obj.queueId(), queueId); - ASSERT_EQ(obj.result(), result); - ASSERT_EQ(obj.errorDescription(), errorDescription); + BMQTST_ASSERT_EQ(bool(obj), false); + BMQTST_ASSERT_EQ(obj.queueId(), queueId); + BMQTST_ASSERT_EQ(obj.result(), result); + BMQTST_ASSERT_EQ(obj.errorDescription(), errorDescription); } PV("Copy Constructor"); @@ -102,10 +102,10 @@ static void test1_breathingTest() bmqtst::TestHelperUtil::allocator()); bmqa::OpenQueueStatus obj2(obj1, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(bool(obj2), bool(obj1)); - ASSERT_EQ(obj1.queueId(), obj2.queueId()); - ASSERT_EQ(obj1.result(), obj2.result()); - ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); + BMQTST_ASSERT_EQ(bool(obj2), bool(obj1)); + BMQTST_ASSERT_EQ(obj1.queueId(), obj2.queueId()); + BMQTST_ASSERT_EQ(obj1.result(), obj2.result()); + BMQTST_ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); } PV("Assignment Operator"); @@ -126,10 +126,10 @@ static void test1_breathingTest() bmqa::OpenQueueStatus obj2(bmqtst::TestHelperUtil::allocator()); obj2 = obj1; - ASSERT_EQ(bool(obj1), bool(obj2)); - ASSERT_EQ(obj1.queueId(), obj2.queueId()); - ASSERT_EQ(obj1.result(), obj2.result()); - ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); + BMQTST_ASSERT_EQ(bool(obj1), bool(obj2)); + BMQTST_ASSERT_EQ(obj1.queueId(), obj2.queueId()); + BMQTST_ASSERT_EQ(obj1.result(), obj2.result()); + BMQTST_ASSERT_EQ(obj1.errorDescription(), obj2.errorDescription()); } } @@ -253,13 +253,13 @@ static void test3_print() // operator<< out << obj; - ASSERT_EQ(out.str(), expected); + BMQTST_ASSERT_EQ(out.str(), expected); // Print out.reset(); obj.print(out, 0, -1); - ASSERT_EQ(out.str(), expected); + BMQTST_ASSERT_EQ(out.str(), expected); } // ============================================================================ diff --git a/src/groups/bmq/bmqa/bmqa_queueid.t.cpp b/src/groups/bmq/bmqa/bmqa_queueid.t.cpp index fdfc9cf595..d4ba28b46d 100644 --- a/src/groups/bmq/bmqa/bmqa_queueid.t.cpp +++ b/src/groups/bmq/bmqa/bmqa_queueid.t.cpp @@ -64,7 +64,7 @@ static void test1_breathingTest() PV("Default Constructor"); { bmqa::QueueId obj(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(obj.isValid(), false); + BMQTST_ASSERT_EQ(obj.isValid(), false); } PV("Valued Constructor - correlationId"); @@ -73,11 +73,11 @@ static void test1_breathingTest() const bmqt::CorrelationId corrId(id); bmqa::QueueId obj(corrId, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(obj.correlationId(), corrId); - ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); - ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.options(), k_NULL_OPTIONS); - ASSERT_EQ(obj.isValid(), false); + BMQTST_ASSERT_EQ(obj.correlationId(), corrId); + BMQTST_ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); + BMQTST_ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_EQ(obj.options(), k_NULL_OPTIONS); + BMQTST_ASSERT_EQ(obj.isValid(), false); } PV("Valued Constructor - numeric"); @@ -85,11 +85,11 @@ static void test1_breathingTest() const bsls::Types::Int64 id = 5; bmqa::QueueId obj(id, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(id)); - ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); - ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.options(), k_NULL_OPTIONS); - ASSERT_EQ(obj.isValid(), false); + BMQTST_ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(id)); + BMQTST_ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); + BMQTST_ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_EQ(obj.options(), k_NULL_OPTIONS); + BMQTST_ASSERT_EQ(obj.isValid(), false); } PV("Valued Constructor - void ptr"); @@ -98,11 +98,11 @@ static void test1_breathingTest() void* ptr = static_cast(const_cast(buffer)); bmqa::QueueId obj(ptr, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(ptr)); - ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); - ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.options(), k_NULL_OPTIONS); - ASSERT_EQ(obj.isValid(), false); + BMQTST_ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(ptr)); + BMQTST_ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); + BMQTST_ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_EQ(obj.options(), k_NULL_OPTIONS); + BMQTST_ASSERT_EQ(obj.isValid(), false); } PV("Valued Constructor - shared ptr to void"); @@ -113,11 +113,11 @@ static void test1_breathingTest() sptr.createInplace(bmqtst::TestHelperUtil::allocator(), k_VALUE); bmqa::QueueId obj(sptr, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(sptr)); - ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); - ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.options(), k_NULL_OPTIONS); - ASSERT_EQ(obj.isValid(), false); + BMQTST_ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(sptr)); + BMQTST_ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); + BMQTST_ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_EQ(obj.options(), k_NULL_OPTIONS); + BMQTST_ASSERT_EQ(obj.isValid(), false); } PV("Copy Constructor"); @@ -126,11 +126,11 @@ static void test1_breathingTest() bmqa::QueueId obj1(id, bmqtst::TestHelperUtil::allocator()); bmqa::QueueId obj2(obj1, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(obj1.correlationId(), obj2.correlationId()); - ASSERT_EQ(obj1.flags(), obj2.flags()); - ASSERT_EQ(obj1.uri(), obj2.uri()); - ASSERT_EQ(obj1.options(), obj2.options()); - ASSERT_EQ(obj1.isValid(), obj2.isValid()); + BMQTST_ASSERT_EQ(obj1.correlationId(), obj2.correlationId()); + BMQTST_ASSERT_EQ(obj1.flags(), obj2.flags()); + BMQTST_ASSERT_EQ(obj1.uri(), obj2.uri()); + BMQTST_ASSERT_EQ(obj1.options(), obj2.options()); + BMQTST_ASSERT_EQ(obj1.isValid(), obj2.isValid()); } PV("Assignment Operator"); @@ -140,11 +140,11 @@ static void test1_breathingTest() bmqa::QueueId obj1(id, bmqtst::TestHelperUtil::allocator()); bmqa::QueueId obj2(bmqtst::TestHelperUtil::allocator()); obj2 = obj1; - ASSERT_EQ(obj1.correlationId(), obj2.correlationId()); - ASSERT_EQ(obj1.flags(), obj2.flags()); - ASSERT_EQ(obj1.uri(), obj2.uri()); - ASSERT_EQ(obj1.options(), obj2.options()); - ASSERT_EQ(obj1.isValid(), obj2.isValid()); + BMQTST_ASSERT_EQ(obj1.correlationId(), obj2.correlationId()); + BMQTST_ASSERT_EQ(obj1.flags(), obj2.flags()); + BMQTST_ASSERT_EQ(obj1.uri(), obj2.uri()); + BMQTST_ASSERT_EQ(obj1.options(), obj2.options()); + BMQTST_ASSERT_EQ(obj1.isValid(), obj2.isValid()); } PV("Uri Method"); @@ -153,11 +153,11 @@ static void test1_breathingTest() const char k_QUEUE_URL[] = "bmq://ts.trades.myapp.~bt/my.queue?id=foo"; bmqa::QueueId obj(id, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(id)); - ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); - ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.options(), k_NULL_OPTIONS); - ASSERT_EQ(obj.isValid(), false); + BMQTST_ASSERT_EQ(obj.correlationId(), bmqt::CorrelationId(id)); + BMQTST_ASSERT_EQ(obj.flags(), bmqt::QueueFlagsUtil::empty()); + BMQTST_ASSERT_EQ(obj.uri(), bmqt::Uri(bmqtst::TestHelperUtil::allocator())); + BMQTST_ASSERT_EQ(obj.options(), k_NULL_OPTIONS); + BMQTST_ASSERT_EQ(obj.isValid(), false); // Convert to bmqimp::Queue bsl::shared_ptr& queue = @@ -165,11 +165,11 @@ static void test1_breathingTest() // Set uri to impl object const bmqt::Uri uri(k_QUEUE_URL, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(uri.isValid(), true); + BMQTST_ASSERT_EQ(uri.isValid(), true); queue->setUri(uri); - ASSERT_EQ(obj.uri().asString(), k_QUEUE_URL); + BMQTST_ASSERT_EQ(obj.uri().asString(), k_QUEUE_URL); } } @@ -200,13 +200,13 @@ static void test2_comparison() bmqa::QueueId obj1(k_ID, bmqtst::TestHelperUtil::allocator()); bmqa::QueueId obj2(k_ID, bmqtst::TestHelperUtil::allocator()); - ASSERT_NE(obj1, obj2); + BMQTST_ASSERT_NE(obj1, obj2); } PV("Equality"); { // Different defaults are never equal - ASSERT_NE(bmqa::QueueId(bmqtst::TestHelperUtil::allocator()), + BMQTST_ASSERT_NE(bmqa::QueueId(bmqtst::TestHelperUtil::allocator()), bmqa::QueueId(bmqtst::TestHelperUtil::allocator())); // Assignment makes equal @@ -218,7 +218,7 @@ static void test2_comparison() BSLS_ASSERT_OPT(obj1 != obj2); obj1 = obj2; - ASSERT_EQ(obj1, obj2); + BMQTST_ASSERT_EQ(obj1, obj2); } } diff --git a/src/groups/bmq/bmqc/bmqc_array.t.cpp b/src/groups/bmq/bmqc/bmqc_array.t.cpp index 00b91d679a..531574cd43 100644 --- a/src/groups/bmq/bmqc/bmqc_array.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_array.t.cpp @@ -143,12 +143,12 @@ static void test1_breathingTest() ObjType obj(bmqtst::TestHelperUtil::allocator()); const ObjType& constObj = obj; - ASSERT_EQ(true, obj.empty()); - ASSERT_EQ(0UL, obj.size()); - ASSERT_EQ(bmqtst::TestHelperUtil::allocator(), + BMQTST_ASSERT_EQ(true, obj.empty()); + BMQTST_ASSERT_EQ(0UL, obj.size()); + BMQTST_ASSERT_EQ(bmqtst::TestHelperUtil::allocator(), obj.get_allocator().mechanism()); - ASSERT_EQ(true, obj.begin() == obj.end()); - ASSERT_EQ(true, constObj.begin() == constObj.end()); + BMQTST_ASSERT_EQ(true, obj.begin() == obj.end()); + BMQTST_ASSERT_EQ(true, constObj.begin() == constObj.end()); } { @@ -162,26 +162,26 @@ static void test1_breathingTest() obj.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); } - ASSERT_EQ(false, obj.empty()); - ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); - ASSERT_EQ(true, obj.begin() != obj.end()); + BMQTST_ASSERT_EQ(false, obj.empty()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); + BMQTST_ASSERT_EQ(true, obj.begin() != obj.end()); for (int idx = 0, i = 1; idx < k_NB_ITEMS; ++idx, ++i) { - ASSERT_EQ_D(idx, i, obj[idx].valueAsInt()); - ASSERT_EQ_D(idx, i, constObj[idx].valueAsInt()); + BMQTST_ASSERT_EQ_D(idx, i, obj[idx].valueAsInt()); + BMQTST_ASSERT_EQ_D(idx, i, constObj[idx].valueAsInt()); } int i = 1; for (ObjType::iterator it = obj.begin(); it != obj.end(); ++it, ++i) { - ASSERT_EQ_D(i, it->valueAsInt(), i); - ASSERT_EQ_D(i, (*it).valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, it->valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, (*it).valueAsInt(), i); } i = 1; for (ObjType::const_iterator it = constObj.begin(); it != constObj.end(); ++it, ++i) { - ASSERT_EQ_D(i, it->valueAsInt(), i); - ASSERT_EQ_D(i, (*it).valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, it->valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, (*it).valueAsInt(), i); } } @@ -199,29 +199,29 @@ static void test1_breathingTest() int i = 1; for (ObjType::iterator it = obj.begin(); it != obj.end(); it += 1, ++i) { - ASSERT_EQ_D(i, it->valueAsInt(), i); - ASSERT_EQ_D(i, (*it).valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, it->valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, (*it).valueAsInt(), i); } // Iterator operator-= i = k_NB_ITEMS; for (ObjType::iterator it = obj.end(); i > 0; --i) { it -= 1; - ASSERT_EQ_D(i, it->valueAsInt(), i); - ASSERT_EQ_D(i, (*it).valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, it->valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, (*it).valueAsInt(), i); } { // Misc. iterator expressions ObjType::iterator it = obj.begin(); - ASSERT_EQ(it->valueAsInt(), 1); - ASSERT_EQ((++it)->valueAsInt(), 2); - ASSERT_EQ((--it)->valueAsInt(), 1); - ASSERT_EQ(it[0].valueAsInt(), 1); + BMQTST_ASSERT_EQ(it->valueAsInt(), 1); + BMQTST_ASSERT_EQ((++it)->valueAsInt(), 2); + BMQTST_ASSERT_EQ((--it)->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it[0].valueAsInt(), 1); ObjType::iterator it2 = it++; - ASSERT_EQ(it2->valueAsInt(), 1); - ASSERT_EQ(it->valueAsInt(), 2); + BMQTST_ASSERT_EQ(it2->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it->valueAsInt(), 2); ASSERT(it != it2); ASSERT(it > it2); ASSERT(it >= it2); @@ -234,8 +234,8 @@ static void test1_breathingTest() ASSERT(it[0] == it2[1]); ObjType::iterator it3 = --it; - ASSERT_EQ(it3->valueAsInt(), 1); - ASSERT_EQ(it2->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it3->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it2->valueAsInt(), 1); ASSERT(it == it3); ASSERT(it >= it3); ASSERT(it <= it3); @@ -251,17 +251,17 @@ static void test1_breathingTest() { // const-iterator ObjType::const_iterator it = obj.begin(); - ASSERT_EQ(it->valueAsInt(), 1); - ASSERT_EQ((++it)->valueAsInt(), 2); - ASSERT_EQ((--it)->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it->valueAsInt(), 1); + BMQTST_ASSERT_EQ((++it)->valueAsInt(), 2); + BMQTST_ASSERT_EQ((--it)->valueAsInt(), 1); ObjType::const_iterator it2 = it++; - ASSERT_EQ(it2->valueAsInt(), 1); - ASSERT_EQ(it->valueAsInt(), 2); + BMQTST_ASSERT_EQ(it2->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it->valueAsInt(), 2); ObjType::const_iterator it3 = --it; - ASSERT_EQ(it3->valueAsInt(), 1); - ASSERT_EQ(it2->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it3->valueAsInt(), 1); + BMQTST_ASSERT_EQ(it2->valueAsInt(), 1); } } @@ -273,9 +273,9 @@ static void test1_breathingTest() ObjType obj(k_NB_ITEMS, TestType(1, bmqtst::TestHelperUtil::allocator()), bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(false, obj.empty()); - ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); - ASSERT_EQ( + BMQTST_ASSERT_EQ(false, obj.empty()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); + BMQTST_ASSERT_EQ( k_NB_ITEMS, bsl::count(obj.begin(), obj.end(), @@ -292,9 +292,9 @@ static void test1_breathingTest() bmqtst::TestHelperUtil::allocator()); ObjType obj(v.begin(), v.end(), bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(false, obj.empty()); - ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); - ASSERT_EQ( + BMQTST_ASSERT_EQ(false, obj.empty()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); + BMQTST_ASSERT_EQ( k_NB_ITEMS, bsl::count(obj.begin(), obj.end(), @@ -313,23 +313,23 @@ static void test1_breathingTest() } ObjType objCopy(obj, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(false, objCopy.empty()); - ASSERT_EQ(static_cast(k_NB_ITEMS), objCopy.size()); - ASSERT_EQ(true, objCopy.begin() != objCopy.end()); + BMQTST_ASSERT_EQ(false, objCopy.empty()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS), objCopy.size()); + BMQTST_ASSERT_EQ(true, objCopy.begin() != objCopy.end()); int i = 1; for (ObjType::iterator it = objCopy.begin(); it != objCopy.end(); ++it) { - ASSERT_EQ_D(i, it->valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, it->valueAsInt(), i); ++i; } objCopy.clear(); - ASSERT_EQ(true, objCopy.empty()); - ASSERT_EQ(0UL, objCopy.size()); - ASSERT_EQ(true, objCopy.begin() == objCopy.end()); + BMQTST_ASSERT_EQ(true, objCopy.empty()); + BMQTST_ASSERT_EQ(0UL, objCopy.size()); + BMQTST_ASSERT_EQ(true, objCopy.begin() == objCopy.end()); - ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS), obj.size()); } { @@ -349,21 +349,21 @@ static void test1_breathingTest() obj2.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); } - ASSERT_EQ(false, obj2.empty()); - ASSERT_EQ(static_cast(k_NB_ITEMS_2), obj2.size()); - ASSERT_EQ(true, obj2.begin() != obj2.end()); + BMQTST_ASSERT_EQ(false, obj2.empty()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS_2), obj2.size()); + BMQTST_ASSERT_EQ(true, obj2.begin() != obj2.end()); // Self assignment obj1 = obj1; - ASSERT_EQ(false, obj1.empty()); - ASSERT_EQ(static_cast(k_NB_ITEMS_1), obj1.size()); - ASSERT_EQ(true, obj1.begin() != obj1.end()); + BMQTST_ASSERT_EQ(false, obj1.empty()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS_1), obj1.size()); + BMQTST_ASSERT_EQ(true, obj1.begin() != obj1.end()); obj2 = obj1; - ASSERT_EQ(false, obj2.empty()); - ASSERT_EQ(static_cast(k_NB_ITEMS_1), obj2.size()); - ASSERT_EQ(true, obj2.begin() != obj2.end()); + BMQTST_ASSERT_EQ(false, obj2.empty()); + BMQTST_ASSERT_EQ(static_cast(k_NB_ITEMS_1), obj2.size()); + BMQTST_ASSERT_EQ(true, obj2.begin() != obj2.end()); } { @@ -374,11 +374,11 @@ static void test1_breathingTest() for (int i = 1; i <= 2 * k_STATIC_LEN; ++i) { obj.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(1, obj.front().valueAsInt()); - ASSERT_EQ(i, obj.back().valueAsInt()); + BMQTST_ASSERT_EQ(1, obj.front().valueAsInt()); + BMQTST_ASSERT_EQ(i, obj.back().valueAsInt()); - ASSERT_EQ(1, constObj.front().valueAsInt()); - ASSERT_EQ(i, constObj.back().valueAsInt()); + BMQTST_ASSERT_EQ(1, constObj.front().valueAsInt()); + BMQTST_ASSERT_EQ(i, constObj.back().valueAsInt()); } } @@ -395,11 +395,11 @@ static void test1_breathingTest() TestType("a", bmqtst::TestHelperUtil::allocator())); } - ASSERT_EQ(k_NB_ITEMS, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(k_NB_ITEMS, TestType::s_numAliveInstances); obj.clear(); - ASSERT_EQ(0, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(0, TestType::s_numAliveInstances); } { @@ -416,11 +416,11 @@ static void test1_breathingTest() TestType("b", bmqtst::TestHelperUtil::allocator())); } - ASSERT_EQ(150, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(150, TestType::s_numAliveInstances); obj2 = obj1; - ASSERT_EQ(100, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(100, TestType::s_numAliveInstances); } { @@ -437,11 +437,11 @@ static void test1_breathingTest() TestType("b", bmqtst::TestHelperUtil::allocator())); } - ASSERT_EQ(150, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(150, TestType::s_numAliveInstances); obj1 = obj2; - ASSERT_EQ(200, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(200, TestType::s_numAliveInstances); } { @@ -453,11 +453,11 @@ static void test1_breathingTest() TestType("a", bmqtst::TestHelperUtil::allocator())); } - ASSERT_EQ(50, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(50, TestType::s_numAliveInstances); bmqtst::TestHelperUtil::allocator()->deleteObject(obj); - ASSERT_EQ(0, TestType::s_numAliveInstances); + BMQTST_ASSERT_EQ(0, TestType::s_numAliveInstances); } } } @@ -518,17 +518,17 @@ static void test3_noMemoryAllocation() ObjType obj(&ta); - ASSERT_EQ(ta.numBlocksInUse(), 0); + BMQTST_ASSERT_EQ(ta.numBlocksInUse(), 0); // Add up to k_STATIC_LEN, no allocations for (int i = 1; i <= k_STATIC_LEN; ++i) { obj.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(ta.numBlocksInUse(), 0); + BMQTST_ASSERT_EQ(ta.numBlocksInUse(), 0); } // Adding one more, allocation" obj.push_back(TestType(0, bmqtst::TestHelperUtil::allocator())); - ASSERT_NE(ta.numBlocksInUse(), 0); + BMQTST_ASSERT_NE(ta.numBlocksInUse(), 0); } static void test4_reserve() @@ -556,7 +556,7 @@ static void test4_reserve() for (int i = 1; i <= k_CAPACITY; ++i) { obj.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); } - ASSERT_EQ(ta.numAllocations(), numAllocations); + BMQTST_ASSERT_EQ(ta.numAllocations(), numAllocations); } static void test5_resize() @@ -579,20 +579,20 @@ static void test5_resize() // 1) Resize to static length obj.resize(k_STATIC_LEN, TestType(1, bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.size(), static_cast(k_STATIC_LEN)); - ASSERT_EQ(TestType::s_numAliveInstances, k_STATIC_LEN); - ASSERT_EQ(ta.numAllocations(), numAllocations); + BMQTST_ASSERT_EQ(obj.size(), static_cast(k_STATIC_LEN)); + BMQTST_ASSERT_EQ(TestType::s_numAliveInstances, k_STATIC_LEN); + BMQTST_ASSERT_EQ(ta.numAllocations(), numAllocations); // 2) Resize to half the static length obj.resize(k_STATIC_LEN / 2, TestType(2, bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.size(), static_cast(k_STATIC_LEN / 2)); - ASSERT_EQ(TestType::s_numAliveInstances, k_STATIC_LEN / 2); - ASSERT_EQ(ta.numAllocations(), numAllocations); + BMQTST_ASSERT_EQ(obj.size(), static_cast(k_STATIC_LEN / 2)); + BMQTST_ASSERT_EQ(TestType::s_numAliveInstances, k_STATIC_LEN / 2); + BMQTST_ASSERT_EQ(ta.numAllocations(), numAllocations); for (size_t i = 0; i < obj.size(); ++i) { - ASSERT_EQ_D(i, obj[i].valueAsInt(), 1); + BMQTST_ASSERT_EQ_D(i, obj[i].valueAsInt(), 1); } // k_FULL_LENGTH exercises both static and dynamic parts of 'bmqc_array'. @@ -602,34 +602,34 @@ static void test5_resize() obj.resize(2 * k_STATIC_LEN, TestType(3, bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.size(), static_cast(k_FULL_LEN)); - ASSERT_EQ(TestType::s_numAliveInstances, 2 * k_STATIC_LEN); - ASSERT_EQ(ta.numAllocations(), numAllocations + 1); + BMQTST_ASSERT_EQ(obj.size(), static_cast(k_FULL_LEN)); + BMQTST_ASSERT_EQ(TestType::s_numAliveInstances, 2 * k_STATIC_LEN); + BMQTST_ASSERT_EQ(ta.numAllocations(), numAllocations + 1); for (size_t i = 0; i < k_FULL_LEN; ++i) { const int expected = (i < (k_STATIC_LEN / 2)) ? 1 : 3; - ASSERT_EQ_D(i, obj[i].valueAsInt(), expected); + BMQTST_ASSERT_EQ_D(i, obj[i].valueAsInt(), expected); } // 4) Again resize to twice the static length (i.e. same size) obj.resize(k_FULL_LEN, TestType(4, bmqtst::TestHelperUtil::allocator())); - ASSERT_EQ(obj.size(), static_cast(k_FULL_LEN)); - ASSERT_EQ(TestType::s_numAliveInstances, 2 * k_STATIC_LEN); - ASSERT_EQ(ta.numAllocations(), numAllocations + 1); + BMQTST_ASSERT_EQ(obj.size(), static_cast(k_FULL_LEN)); + BMQTST_ASSERT_EQ(TestType::s_numAliveInstances, 2 * k_STATIC_LEN); + BMQTST_ASSERT_EQ(ta.numAllocations(), numAllocations + 1); for (size_t i = 0; i < k_FULL_LEN; ++i) { const int expected = (i < (k_STATIC_LEN / 2)) ? 1 : 3; - ASSERT_EQ_D(i, obj[i].valueAsInt(), expected); + BMQTST_ASSERT_EQ_D(i, obj[i].valueAsInt(), expected); } // 5) Resize to zero obj.resize(0, TestType(5, bmqtst::TestHelperUtil::allocator())); ASSERT(obj.empty()); - ASSERT_EQ(obj.size(), 0UL); - ASSERT_EQ(TestType::s_numAliveInstances, 0); - ASSERT_EQ(ta.numAllocations(), numAllocations + 1); + BMQTST_ASSERT_EQ(obj.size(), 0UL); + BMQTST_ASSERT_EQ(TestType::s_numAliveInstances, 0); + BMQTST_ASSERT_EQ(ta.numAllocations(), numAllocations + 1); } static void test6_assign() @@ -660,9 +660,9 @@ static void test6_assign() obj.assign(srcVec.begin(), srcVec.end()); // Verify - ASSERT_EQ(obj.size(), srcVec.size()); + BMQTST_ASSERT_EQ(obj.size(), srcVec.size()); for (size_t i = 0; i < obj.size(); ++i) { - ASSERT_EQ_D(i, obj[i].valueAsInt(), srcVec[i].valueAsInt()); + BMQTST_ASSERT_EQ_D(i, obj[i].valueAsInt(), srcVec[i].valueAsInt()); } } @@ -692,7 +692,7 @@ static void test7_algorithms() // Verify: {1, 2, ..., 30} for (int i = 0; i <= 30; ++i) { - ASSERT_EQ_D(i, obj[i].valueAsInt(), i); + BMQTST_ASSERT_EQ_D(i, obj[i].valueAsInt(), i); } } } @@ -716,7 +716,7 @@ static void test8_allocatorProp() ObjType obj(&ta); obj.push_back(TestType(0, &ta)); - ASSERT_EQ(true, obj.back().d_allocator_p != &ta); + BMQTST_ASSERT_EQ(true, obj.back().d_allocator_p != &ta); } { @@ -727,7 +727,7 @@ static void test8_allocatorProp() bmqc::Array obj(&ta); obj.push_back("foo"); - ASSERT_EQ(true, obj.back().get_allocator().mechanism() == &ta); + BMQTST_ASSERT_EQ(true, obj.back().get_allocator().mechanism() == &ta); } } @@ -751,18 +751,18 @@ static void test9_copyAssignDifferentStaticLength() { ObjType obj(rhs, &ta); - ASSERT_EQ(obj.size(), 2u); - ASSERT_EQ(obj.capacity(), 10u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 2u); + BMQTST_ASSERT_EQ(obj.capacity(), 10u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } rhs.resize(42, TestType(2)); { ObjType obj(rhs, &ta); - ASSERT_EQ(obj.size(), 42u); - ASSERT_EQ(obj.capacity(), 42u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 42u); + BMQTST_ASSERT_EQ(obj.capacity(), 42u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } } @@ -776,9 +776,9 @@ static void test9_copyAssignDifferentStaticLength() { ObjType obj(&ta); obj = rhs; - ASSERT_EQ(obj.size(), 2u); - ASSERT_EQ(obj.capacity(), 10u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 2u); + BMQTST_ASSERT_EQ(obj.capacity(), 10u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } rhs.resize(42, TestType(2)); @@ -786,9 +786,9 @@ static void test9_copyAssignDifferentStaticLength() { ObjType obj(&ta); obj = rhs; - ASSERT_EQ(obj.size(), 42u); - ASSERT_EQ(obj.capacity(), 42u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 42u); + BMQTST_ASSERT_EQ(obj.capacity(), 42u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } } @@ -801,18 +801,18 @@ static void test9_copyAssignDifferentStaticLength() { ObjType obj(rhs, &ta); - ASSERT_EQ(obj.size(), 2u); - ASSERT_EQ(obj.capacity(), 10u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 2u); + BMQTST_ASSERT_EQ(obj.capacity(), 10u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } rhs.resize(42, TestType(2)); { ObjType obj(rhs, &ta); - ASSERT_EQ(obj.size(), 42u); - ASSERT_EQ(obj.capacity(), 42u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 42u); + BMQTST_ASSERT_EQ(obj.capacity(), 42u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } } @@ -826,9 +826,9 @@ static void test9_copyAssignDifferentStaticLength() { ObjType obj(&ta); obj = rhs; - ASSERT_EQ(obj.size(), 2u); - ASSERT_EQ(obj.capacity(), 10u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 2u); + BMQTST_ASSERT_EQ(obj.capacity(), 10u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } rhs.resize(42, TestType(2)); @@ -836,9 +836,9 @@ static void test9_copyAssignDifferentStaticLength() { ObjType obj(&ta); obj = rhs; - ASSERT_EQ(obj.size(), 42u); - ASSERT_EQ(obj.capacity(), 42u); - ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); + BMQTST_ASSERT_EQ(obj.size(), 42u); + BMQTST_ASSERT_EQ(obj.capacity(), 42u); + BMQTST_ASSERT_EQ(true, bsl::equal(obj.begin(), obj.end(), rhs.begin())); } } } @@ -864,8 +864,8 @@ static void test10_pushBackSelfRef() obj.push_back(TestType(i, bmqtst::TestHelperUtil::allocator())); } ASSERT_PASS(obj.push_back(obj[k_STATIC_LEN])); - ASSERT_EQ(k_STATIC_LEN, obj[k_STATIC_LEN].valueAsInt()); - ASSERT_EQ(k_STATIC_LEN, obj[k_SIZE].valueAsInt()); + 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.t.cpp b/src/groups/bmq/bmqc/bmqc_monitoredqueue.t.cpp index eb61862bb3..8d7efd7865 100644 --- a/src/groups/bmq/bmqc/bmqc_monitoredqueue.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_monitoredqueue.t.cpp @@ -87,7 +87,7 @@ static void test1_MonitoredQueueState_toAscii() ascii = bmqc::MonitoredQueueState::toAscii( bmqc::MonitoredQueueState::Enum(test.d_value)); - ASSERT_EQ_D(test.d_line, ascii, test.d_expected); + BMQTST_ASSERT_EQ_D(test.d_line, ascii, test.d_expected); } } @@ -145,20 +145,20 @@ static void test2_MonitoredQueueState_print() bsl::string expected(bmqtst::TestHelperUtil::allocator()); expected.assign(test.d_expected); expected.append("\n"); - ASSERT_EQ_D(test.d_line, out.str(), expected); + BMQTST_ASSERT_EQ_D(test.d_line, out.str(), expected); // operator<< out.reset(); out << obj; - ASSERT_EQ_D(test.d_line, out.str(), test.d_expected); + BMQTST_ASSERT_EQ_D(test.d_line, out.str(), test.d_expected); // 2. 'badbit' set out.reset(); out.setstate(bsl::ios_base::badbit); bmqc::MonitoredQueueState::print(out, obj, 0, -1); - ASSERT_EQ_D(test.d_line, out.str(), ""); + BMQTST_ASSERT_EQ_D(test.d_line, out.str(), ""); } } diff --git a/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp b/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp index 74cfd3d490..15c7e9acf8 100644 --- a/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccfixedqueue.t.cpp @@ -167,34 +167,34 @@ static void test1_MonitoredQueue_breathingTest() k_QUEUE_SIZE, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); queue.setWatermarks(k_LOW_WATERMARK, k_HIGH_WATERMARK, k_HIGH_WATERMARK2); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); - ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); - ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); - ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); + BMQTST_ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); // pushBack two items - ASSERT_EQ(queue.pushBack(1), 0); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.pushBack(1), 0); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); - ASSERT_EQ(queue.tryPushBack(2), 0); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 2); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.tryPushBack(2), 0); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 2); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); int item = -1; @@ -211,18 +211,18 @@ static void test1_MonitoredQueue_breathingTest() // popfront two items item = -1; - ASSERT_EQ(queue.tryPopFront(&item), 0); - ASSERT_EQ(item, 1); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.tryPopFront(&item), 0); + BMQTST_ASSERT_EQ(item, 1); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); item = -1; queue.popFront(&item); - ASSERT_EQ(item, 2); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(item, 2); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); } { @@ -233,34 +233,34 @@ static void test1_MonitoredQueue_breathingTest() true, // supportTimedOperations bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); queue.setWatermarks(k_LOW_WATERMARK, k_HIGH_WATERMARK, k_HIGH_WATERMARK2); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); - ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); - ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); - ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); + BMQTST_ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); // pushBack two items - ASSERT_EQ(queue.pushBack(1), 0); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.pushBack(1), 0); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); - ASSERT_EQ(queue.pushBack(2), 0); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 2); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.pushBack(2), 0); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 2); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); // popFront two items // 1. timedPopFront @@ -268,19 +268,19 @@ static void test1_MonitoredQueue_breathingTest() const bsls::TimeInterval timeout = bsls::TimeInterval( 0, 5 * bdlt::TimeUnitRatio::k_NANOSECONDS_PER_MILLISECOND); - ASSERT_EQ(queue.timedPopFront(&item, timeout), 0); - ASSERT_EQ(item, 1) - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.timedPopFront(&item, timeout), 0); + BMQTST_ASSERT_EQ(item, 1) + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); // 2. popFront item = -1; queue.popFront(&item); - ASSERT_EQ(item, 2); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(item, 2); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); } } @@ -326,21 +326,21 @@ static void test2_MonitoredQueue_reset() queue.tryPushBack(8); queue.tryPushBack(9); - ASSERT_EQ(queue.tryPushBack(10), -1); + BMQTST_ASSERT_EQ(queue.tryPushBack(10), -1); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), k_QUEUE_SIZE); - ASSERT_EQ(queue.isEmpty(), false); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_QUEUE_FILLED); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_QUEUE_FILLED); // 2. Reset the queue and verify that items were removed and state is reset // to an empty queue. queue.reset(); - ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.capacity(), k_QUEUE_SIZE); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); } BSLA_MAYBE_UNUSED diff --git a/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccsingleconsumerqueue.t.cpp b/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccsingleconsumerqueue.t.cpp index 5187413e31..10dc5a5905 100644 --- a/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccsingleconsumerqueue.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_monitoredqueue_bdlccsingleconsumerqueue.t.cpp @@ -170,46 +170,46 @@ static void test1_MonitoredSingleConsumerQueue_breathingTest() k_QUEUE_SIZE, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); queue.setWatermarks(k_LOW_WATERMARK, k_HIGH_WATERMARK, k_HIGH_WATERMARK2); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); - ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); - ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); - ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); + BMQTST_ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); // pushBack two items - ASSERT_EQ(queue.pushBack(1), 0); - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.pushBack(1), 0); + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); - ASSERT_EQ(queue.tryPushBack(2), 0); - ASSERT_EQ(queue.numElements(), 2); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.tryPushBack(2), 0); + BMQTST_ASSERT_EQ(queue.numElements(), 2); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); // Verify timed popFront is undefined int item = -1; // popFront two items item = -1; - ASSERT_EQ(queue.tryPopFront(&item), 0); - ASSERT_EQ(item, 1); - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.tryPopFront(&item), 0); + BMQTST_ASSERT_EQ(item, 1); + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); item = -1; queue.popFront(&item); - ASSERT_EQ(item, 2); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(item, 2); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); } { @@ -221,30 +221,30 @@ static void test1_MonitoredSingleConsumerQueue_breathingTest() // supportTimedOperations bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); queue.setWatermarks(k_LOW_WATERMARK, k_HIGH_WATERMARK, k_HIGH_WATERMARK2); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); - ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); - ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); - ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); + BMQTST_ASSERT_EQ(queue.lowWatermark(), k_LOW_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark(), k_HIGH_WATERMARK); + BMQTST_ASSERT_EQ(queue.highWatermark2(), k_HIGH_WATERMARK2); // pushBack two items - ASSERT_EQ(queue.pushBack(1), 0); - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.pushBack(1), 0); + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); - ASSERT_EQ(queue.pushBack(2), 0); - ASSERT_EQ(queue.numElements(), 2); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.pushBack(2), 0); + BMQTST_ASSERT_EQ(queue.numElements(), 2); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); // popFront two items // 1. timedPopFront @@ -252,17 +252,17 @@ static void test1_MonitoredSingleConsumerQueue_breathingTest() const bsls::TimeInterval timeout = bsls::TimeInterval( 0, 5 * bdlt::TimeUnitRatio::k_NANOSECONDS_PER_MILLISECOND); - ASSERT_EQ(queue.timedPopFront(&item, timeout), 0); - ASSERT_EQ(item, 1) - ASSERT_EQ(queue.numElements(), 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.timedPopFront(&item, timeout), 0); + BMQTST_ASSERT_EQ(item, 1) + BMQTST_ASSERT_EQ(queue.numElements(), 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); // 2. popFront item = -1; queue.popFront(&item); - ASSERT_EQ(item, 2); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(item, 2); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); } } @@ -309,18 +309,18 @@ static void test2_MonitoredSingleConsumerQueue_exceed_reset() queue.tryPushBack(8); queue.tryPushBack(9); - ASSERT_EQ(queue.tryPushBack(10), 0); + BMQTST_ASSERT_EQ(queue.tryPushBack(10), 0); - ASSERT_EQ(queue.numElements(), k_QUEUE_SIZE + 1); - ASSERT_EQ(queue.isEmpty(), false); + BMQTST_ASSERT_EQ(queue.numElements(), k_QUEUE_SIZE + 1); + BMQTST_ASSERT_EQ(queue.isEmpty(), false); // 2. Reset the queue and verify that items were removed and state is reset // to an empty queue. queue.reset(); - ASSERT_EQ(queue.numElements(), 0); - ASSERT_EQ(queue.isEmpty(), true); - ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); + BMQTST_ASSERT_EQ(queue.numElements(), 0); + BMQTST_ASSERT_EQ(queue.isEmpty(), true); + BMQTST_ASSERT_EQ(queue.state(), bmqc::MonitoredQueueState::e_NORMAL); } BSLA_MAYBE_UNUSED diff --git a/src/groups/bmq/bmqc/bmqc_multiqueuethreadpool.t.cpp b/src/groups/bmq/bmqc/bmqc_multiqueuethreadpool.t.cpp index 33af002bbc..cf37370083 100644 --- a/src/groups/bmq/bmqc/bmqc_multiqueuethreadpool.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_multiqueuethreadpool.t.cpp @@ -187,12 +187,12 @@ static void test1_breathingTest() bmqtst::TestHelperUtil::allocator()); MQTP mfqtp(config, bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(mfqtp.isStarted(), false); - ASSERT_EQ(mfqtp.numQueues(), k_NUM_QUEUES); - ASSERT_EQ(mfqtp.isSingleThreaded(), false); - ASSERT_EQ(mfqtp.start(), 0); - ASSERT_NE(mfqtp.start(), 0); // MQTP has already been started - ASSERT_EQ(mfqtp.isStarted(), true); + BMQTST_ASSERT_EQ(mfqtp.isStarted(), false); + BMQTST_ASSERT_EQ(mfqtp.numQueues(), k_NUM_QUEUES); + BMQTST_ASSERT_EQ(mfqtp.isSingleThreaded(), false); + BMQTST_ASSERT_EQ(mfqtp.start(), 0); + BMQTST_ASSERT_NE(mfqtp.start(), 0); // MQTP has already been started + BMQTST_ASSERT_EQ(mfqtp.isStarted(), true); MQTP::Event* event = mfqtp.getUnmanagedEvent(); event->object() = 0; @@ -211,19 +211,19 @@ static void test1_breathingTest() mfqtp.enqueueEventOnAllQueues(event); mfqtp.stop(); - ASSERT_EQ(mfqtp.isStarted(), false); + BMQTST_ASSERT_EQ(mfqtp.isStarted(), false); - ASSERT_EQ(queueContextMap[0].size(), 2U); - ASSERT_EQ(queueContextMap[0][0], 0); - ASSERT_EQ(queueContextMap[0][1], 3); + BMQTST_ASSERT_EQ(queueContextMap[0].size(), 2U); + BMQTST_ASSERT_EQ(queueContextMap[0][0], 0); + BMQTST_ASSERT_EQ(queueContextMap[0][1], 3); - ASSERT_EQ(queueContextMap[0].size(), 2U); - ASSERT_EQ(queueContextMap[1][0], 1); - ASSERT_EQ(queueContextMap[1][1], 3); + BMQTST_ASSERT_EQ(queueContextMap[0].size(), 2U); + BMQTST_ASSERT_EQ(queueContextMap[1][0], 1); + BMQTST_ASSERT_EQ(queueContextMap[1][1], 3); - ASSERT_EQ(queueContextMap[0].size(), 2U); - ASSERT_EQ(queueContextMap[2][0], 2); - ASSERT_EQ(queueContextMap[2][1], 3); + BMQTST_ASSERT_EQ(queueContextMap[0].size(), 2U); + BMQTST_ASSERT_EQ(queueContextMap[2][0], 2); + BMQTST_ASSERT_EQ(queueContextMap[2][1], 3); threadPool.stop(); } @@ -543,4 +543,4 @@ int main(int argc, char* argv[]) } // ---------------------------------------------------------------------------- -// NOTICE: \ No newline at end of file +// NOTICE: diff --git a/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp b/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp index 26adbfa8fc..29cc81be93 100644 --- a/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_orderedhashmap.t.cpp @@ -129,34 +129,34 @@ static void test1_breathingTest() MyMapType map(bmqtst::TestHelperUtil::allocator()); const MyMapType& cmap = map; - ASSERT_EQ(true, map.begin() == map.end()); - ASSERT_EQ(true, cmap.begin() == cmap.end()); + BMQTST_ASSERT_EQ(true, map.begin() == map.end()); + BMQTST_ASSERT_EQ(true, cmap.begin() == cmap.end()); map.clear(); - ASSERT_EQ(0U, map.count(1)); - ASSERT_EQ(0U, map.erase(1)); - ASSERT_EQ(true, map.end() == map.find(1)); - ASSERT_EQ(true, cmap.empty()); - ASSERT_EQ(true, cmap.end() == cmap.find(1)); - ASSERT_EQ(0U, cmap.count(1)); - ASSERT_EQ(0U, cmap.size()); + BMQTST_ASSERT_EQ(0U, map.count(1)); + BMQTST_ASSERT_EQ(0U, map.erase(1)); + BMQTST_ASSERT_EQ(true, map.end() == map.find(1)); + BMQTST_ASSERT_EQ(true, cmap.empty()); + BMQTST_ASSERT_EQ(true, cmap.end() == cmap.find(1)); + BMQTST_ASSERT_EQ(0U, cmap.count(1)); + BMQTST_ASSERT_EQ(0U, cmap.size()); bsl::pair rc = map.insert(bsl::make_pair(1, s)); - ASSERT_EQ(true, rc.first != map.end()); - ASSERT_EQ(rc.second, true); - ASSERT_EQ(1U, rc.first->first); - ASSERT_EQ(s, rc.first->second); - ASSERT_EQ(1U, cmap.count(1)); + BMQTST_ASSERT_EQ(true, rc.first != map.end()); + BMQTST_ASSERT_EQ(rc.second, true); + BMQTST_ASSERT_EQ(1U, rc.first->first); + BMQTST_ASSERT_EQ(s, rc.first->second); + BMQTST_ASSERT_EQ(1U, cmap.count(1)); ConstIterType cit = cmap.find(1); - ASSERT_EQ(true, cmap.end() != cit); - ASSERT_EQ(1U, cmap.size()); - ASSERT_EQ(false, cmap.empty()); - ASSERT_EQ(1U, map.erase(1)); - ASSERT_EQ(true, map.begin() == map.end()); - ASSERT_EQ(true, cmap.begin() == cmap.end()); - ASSERT_EQ(true, cmap.end() == cmap.find(1)); + BMQTST_ASSERT_EQ(true, cmap.end() != cit); + BMQTST_ASSERT_EQ(1U, cmap.size()); + BMQTST_ASSERT_EQ(false, cmap.empty()); + BMQTST_ASSERT_EQ(1U, map.erase(1)); + BMQTST_ASSERT_EQ(true, map.begin() == map.end()); + BMQTST_ASSERT_EQ(true, cmap.begin() == cmap.end()); + BMQTST_ASSERT_EQ(true, cmap.end() == cmap.find(1)); } static void test2_impDetails_nextPrime() @@ -190,11 +190,11 @@ static void test2_impDetails_nextPrime() break; // RETURN } - ASSERT_EQ(isPrime(currPrime), true); - ASSERT_GT(currPrime, prevPrime); + BMQTST_ASSERT_EQ(isPrime(currPrime), true); + BMQTST_ASSERT_GT(currPrime, prevPrime); } - ASSERT_EQ(lastPrime, 0U); + BMQTST_ASSERT_EQ(lastPrime, 0U); } static void test3_insert() @@ -229,23 +229,23 @@ static void test3_insert() // Insert 1M elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); - ASSERT_EQ_D(i, true, rc.second); - ASSERT_EQ_D(i, true, rc.first != map.end()); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, (i + 1), rc.first->second); - ASSERT_EQ_D(i, true, 1.5 >= map.load_factor()); + BMQTST_ASSERT_EQ_D(i, true, rc.second); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), rc.first->second); + BMQTST_ASSERT_EQ_D(i, true, 1.5 >= map.load_factor()); } - ASSERT_EQ(map.size(), k_NUM_ELEMENTS); + BMQTST_ASSERT_EQ(map.size(), k_NUM_ELEMENTS); // Iterate and confirm { const MyMapType& cmap = map; size_t i = 0; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { - ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); - ASSERT_EQ_D(i, i, cit->first); - ASSERT_EQ_D(i, (i + 1), cit->second); + BMQTST_ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); + BMQTST_ASSERT_EQ_D(i, i, cit->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), cit->second); ++i; } } @@ -256,14 +256,14 @@ static void test3_insert() size_t i = k_NUM_ELEMENTS - 1; ConstIterType cit = --(cmap.end()); // last element for (; cit != cmap.begin(); --cit) { - ASSERT_EQ_D(i, true, i > 0); - ASSERT_EQ_D(i, i, cit->first); - ASSERT_EQ_D(i, (i + 1), cit->second); + BMQTST_ASSERT_EQ_D(i, true, i > 0); + BMQTST_ASSERT_EQ_D(i, i, cit->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), cit->second); --i; } - ASSERT_EQ(true, cit == cmap.begin()); - ASSERT_EQ(cit->first, i); - ASSERT_EQ(cit->second, (i + 1)); + BMQTST_ASSERT_EQ(true, cit == cmap.begin()); + BMQTST_ASSERT_EQ(cit->first, i); + BMQTST_ASSERT_EQ(cit->second, (i + 1)); } } @@ -300,22 +300,22 @@ static void test4_rinsert() // Insert 1M elements for (int i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.rinsert(bsl::make_pair(i, i + 1)); - ASSERT_EQ_D(i, true, rc.second); - ASSERT_EQ_D(i, true, rc.first != map.end()); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, (i + 1), rc.first->second); - ASSERT_EQ_D(i, true, 1.5 >= map.load_factor()); + BMQTST_ASSERT_EQ_D(i, true, rc.second); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), rc.first->second); + BMQTST_ASSERT_EQ_D(i, true, 1.5 >= map.load_factor()); } - ASSERT_EQ(map.size(), static_cast(k_NUM_ELEMENTS)); + BMQTST_ASSERT_EQ(map.size(), static_cast(k_NUM_ELEMENTS)); // Iterate and confirm { const MyMapType& cmap = map; int i = k_NUM_ELEMENTS - 1; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { - ASSERT_EQ_D(i, i, cit->first); - ASSERT_EQ_D(i, (i + 1), cit->second); + BMQTST_ASSERT_EQ_D(i, i, cit->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), cit->second); --i; } } @@ -326,14 +326,14 @@ static void test4_rinsert() int i = 0; ConstIterType cit = --(cmap.end()); // last element for (; cit != cmap.begin(); --cit) { - ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); - ASSERT_EQ_D(i, i, cit->first); - ASSERT_EQ_D(i, (i + 1), cit->second); + BMQTST_ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); + BMQTST_ASSERT_EQ_D(i, i, cit->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), cit->second); ++i; } - ASSERT_EQ(true, cit == cmap.begin()); - ASSERT_EQ(i, cit->first); - ASSERT_EQ(cit->second, (i + 1)); + BMQTST_ASSERT_EQ(true, cit == cmap.begin()); + BMQTST_ASSERT_EQ(i, cit->first); + BMQTST_ASSERT_EQ(cit->second, (i + 1)); } } @@ -358,10 +358,10 @@ static void test5_insertEraseInsert() // Insert elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != map.end()); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, (i + 1), rc.first->second); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), rc.first->second); } // Iterate and confirm @@ -369,21 +369,21 @@ static void test5_insertEraseInsert() const MyMapType& cmap = map; size_t i = 0; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { - ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); - ASSERT_EQ_D(i, i, cit->first); - ASSERT_EQ_D(i, (i + 1), cit->second); + BMQTST_ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); + BMQTST_ASSERT_EQ_D(i, i, cit->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), cit->second); ++i; } } // Erase few elements for (size_t i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { - ASSERT_EQ_D(i, 1U, map.erase(i)); + BMQTST_ASSERT_EQ_D(i, 1U, map.erase(i)); } // Find erased elements for (size_t i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { - ASSERT_EQ_D(i, true, map.end() == map.find(i)); + BMQTST_ASSERT_EQ_D(i, true, map.end() == map.find(i)); } // Iterate and confirm @@ -391,9 +391,9 @@ static void test5_insertEraseInsert() const MyMapType& cmap = map; size_t i = 1; for (ConstIterType cit = cmap.begin(); cit != cmap.end(); ++cit) { - ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); - ASSERT_EQ_D(i, i, cit->first); - ASSERT_EQ_D(i, (i + 1), cit->second); + BMQTST_ASSERT_EQ_D(i, true, i < k_NUM_ELEMENTS); + BMQTST_ASSERT_EQ_D(i, i, cit->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), cit->second); ++i; if (i % k_STEP == 0) { ++i; @@ -404,10 +404,10 @@ static void test5_insertEraseInsert() // Insert elements which were erased earlier for (size_t i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); - ASSERT_EQ_D(i, true, rc.second); - ASSERT_EQ_D(i, true, rc.first != map.end()); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, (i + 1), rc.first->second); + BMQTST_ASSERT_EQ_D(i, true, rc.second); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), rc.first->second); } // Iterate and confirm @@ -417,9 +417,9 @@ static void test5_insertEraseInsert() // Iterate over original elements for (; it != map.end(); ++it) { - ASSERT_EQ_D(i, true, it != map.end()); - ASSERT_EQ_D(i, i, it->first); - ASSERT_EQ_D(i, (i + 1), it->second); + BMQTST_ASSERT_EQ_D(i, true, it != map.end()); + BMQTST_ASSERT_EQ_D(i, i, it->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), it->second); if (it->first == (k_NUM_ELEMENTS - 1)) { ++it; break; @@ -432,13 +432,13 @@ static void test5_insertEraseInsert() // Iterate ove elements inserted after erase operation for (i = 0; i < k_NUM_ELEMENTS; i += k_STEP) { - ASSERT_EQ_D(i, true, it != map.end()); - ASSERT_EQ_D(i, i, it->first); - ASSERT_EQ_D(i, (i + 1), it->second); + BMQTST_ASSERT_EQ_D(i, true, it != map.end()); + BMQTST_ASSERT_EQ_D(i, i, it->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), it->second); ++it; } - ASSERT_EQ(true, it == map.end()); + BMQTST_ASSERT_EQ(true, it == map.end()); } } @@ -455,37 +455,37 @@ static void test6_clear() typedef bsl::pair RcType; MyMapType map(bmqtst::TestHelperUtil::allocator()); - ASSERT_EQ(true, map.empty()); - ASSERT_EQ(true, map.begin() == map.end()); - ASSERT_EQ(0U, map.size()); - ASSERT_EQ(true, map.load_factor() == 0.0); + BMQTST_ASSERT_EQ(true, map.empty()); + BMQTST_ASSERT_EQ(true, map.begin() == map.end()); + BMQTST_ASSERT_EQ(0U, map.size()); + BMQTST_ASSERT_EQ(true, map.load_factor() == 0.0); map.clear(); - ASSERT_EQ(true, map.empty()); - ASSERT_EQ(true, map.begin() == map.end()); - ASSERT_EQ(0U, map.size()); - ASSERT_EQ(true, map.load_factor() == 0.0); + BMQTST_ASSERT_EQ(true, map.empty()); + BMQTST_ASSERT_EQ(true, map.begin() == map.end()); + BMQTST_ASSERT_EQ(0U, map.size()); + BMQTST_ASSERT_EQ(true, map.load_factor() == 0.0); const int k_NUM_ELEMENTS = 100; // Insert elements for (int i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i + 1)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != map.end()); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, (i + 1), rc.first->second); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, (i + 1), rc.first->second); } - ASSERT_EQ(false, map.empty()); - ASSERT_EQ(true, map.begin() != map.end()); - ASSERT_EQ(static_cast(k_NUM_ELEMENTS), map.size()); + BMQTST_ASSERT_EQ(false, map.empty()); + BMQTST_ASSERT_EQ(true, map.begin() != map.end()); + BMQTST_ASSERT_EQ(static_cast(k_NUM_ELEMENTS), map.size()); map.clear(); - ASSERT_EQ(true, map.empty()); - ASSERT_EQ(true, map.begin() == map.end()); - ASSERT_EQ(0U, map.size()); - ASSERT_EQ(true, map.load_factor() == 0.0); + BMQTST_ASSERT_EQ(true, map.empty()); + BMQTST_ASSERT_EQ(true, map.begin() == map.end()); + BMQTST_ASSERT_EQ(0U, map.size()); + BMQTST_ASSERT_EQ(true, map.load_factor() == 0.0); } static void test7_erase() @@ -507,10 +507,10 @@ static void test7_erase() // Insert elements for (int i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != map.end()); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, i, rc.first->second); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, i, rc.first->second); } const MyMapType& cmap = map; @@ -519,8 +519,8 @@ static void test7_erase() map.erase(cit++); } - ASSERT_EQ(0U, map.size()); - ASSERT_EQ(true, map.empty()); + BMQTST_ASSERT_EQ(0U, map.size()); + BMQTST_ASSERT_EQ(true, map.empty()); } static void test8_eraseClear() @@ -545,11 +545,11 @@ static void test8_eraseClear() for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert( bsl::make_pair(TestKeyType(i), TestValueType(i))); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); } - ASSERT_EQ(k_NUM_ELEMENTS, map.size()); + BMQTST_ASSERT_EQ(k_NUM_ELEMENTS, map.size()); // Reset static counters TestKeyType::s_numDeletions = 0; @@ -560,8 +560,8 @@ static void test8_eraseClear() map.erase(it++); } - ASSERT_EQ(TestKeyType::s_numDeletions, k_NUM_ELEMENTS); - ASSERT_EQ(TestValueType::s_numDeletions, k_NUM_ELEMENTS); + BMQTST_ASSERT_EQ(TestKeyType::s_numDeletions, k_NUM_ELEMENTS); + BMQTST_ASSERT_EQ(TestValueType::s_numDeletions, k_NUM_ELEMENTS); } static void test9_insertFailure() @@ -586,15 +586,15 @@ static void test9_insertFailure() // Insert elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, true, rc.second); - ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, true, rc.second); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); } // insert same keys again for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, rc.second, false); - ASSERT_EQ_D(i, true, rc.first == map.find(i)); + BMQTST_ASSERT_EQ_D(i, rc.second, false); + BMQTST_ASSERT_EQ_D(i, true, rc.first == map.find(i)); } } @@ -619,23 +619,23 @@ static void test10_erasureIterator() // Insert elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); } // Find IterType iter = map.find(9000); - ASSERT_EQ(true, iter != map.end()); - ASSERT_EQ(iter->first, 9000U); + BMQTST_ASSERT_EQ(true, iter != map.end()); + BMQTST_ASSERT_EQ(iter->first, 9000U); // erase IterType it = map.erase(iter); - ASSERT_EQ(true, it != map.end()); - ASSERT_EQ(true, it == map.find(9001)); + BMQTST_ASSERT_EQ(true, it != map.end()); + BMQTST_ASSERT_EQ(true, it == map.find(9001)); size_t i = 9001; for (; it != map.end(); ++it) { - ASSERT_EQ_D(i, i, it->first); + BMQTST_ASSERT_EQ_D(i, i, it->first); ++i; } } @@ -668,8 +668,8 @@ static void test11_copyConstructor() // Insert elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = m1p->insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != m1p->end()); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != m1p->end()); } MyMapType m2(*m1p, bmqtst::TestHelperUtil::allocator()); @@ -677,8 +677,8 @@ static void test11_copyConstructor() // Iterate and confirm size_t i = 0; for (ConstIterType cit = m2.begin(); cit != m2.end(); ++cit) { - ASSERT_EQ_D(i, cit->first, i); - ASSERT_EQ_D(i, cit->second, i); + BMQTST_ASSERT_EQ_D(i, cit->first, i); + BMQTST_ASSERT_EQ_D(i, cit->second, i); ++i; } @@ -687,8 +687,8 @@ static void test11_copyConstructor() i = 0; for (ConstIterType cit = m2.begin(); cit != m2.end(); ++cit) { - ASSERT_EQ_D(i, cit->first, i); - ASSERT_EQ_D(i, cit->second, i); + BMQTST_ASSERT_EQ_D(i, cit->first, i); + BMQTST_ASSERT_EQ_D(i, cit->second, i); ++i; } } @@ -722,8 +722,8 @@ static void test12_assignmentOperator() // Insert elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = m1p->insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != m1p->end()); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != m1p->end()); } MyMapType m2(bmqtst::TestHelperUtil::allocator()); @@ -731,8 +731,8 @@ static void test12_assignmentOperator() // Insert elements for (size_t i = k_NUM_ELEMENTS; i > 0; --i) { RcType rc = m2.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != m2.end()); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != m2.end()); } m2 = *m1p; @@ -740,8 +740,8 @@ static void test12_assignmentOperator() // Iterate and confirm size_t i = 0; for (ConstIterType cit = m2.begin(); cit != m2.end(); ++cit) { - ASSERT_EQ_D(i, cit->first, i); - ASSERT_EQ_D(i, cit->second, i); + BMQTST_ASSERT_EQ_D(i, cit->first, i); + BMQTST_ASSERT_EQ_D(i, cit->second, i); ++i; } @@ -749,8 +749,8 @@ static void test12_assignmentOperator() bmqtst::TestHelperUtil::allocator()->deleteObject(m1p); i = 0; for (ConstIterType cit = m2.begin(); cit != m2.end(); ++cit) { - ASSERT_EQ_D(i, cit->first, i); - ASSERT_EQ_D(i, cit->second, i); + BMQTST_ASSERT_EQ_D(i, cit->first, i); + BMQTST_ASSERT_EQ_D(i, cit->second, i); ++i; } } @@ -773,9 +773,9 @@ static void test13_previousEndIterator() MyMapType map(bmqtst::TestHelperUtil::allocator()); const MyMapType& cmap = map; - ASSERT_EQ(true, map.begin() == map.end()); - ASSERT_EQ(true, cmap.begin() == cmap.end()); - ASSERT_EQ(true, cmap.empty()); + BMQTST_ASSERT_EQ(true, map.begin() == map.end()); + BMQTST_ASSERT_EQ(true, cmap.begin() == cmap.end()); + BMQTST_ASSERT_EQ(true, cmap.empty()); IterType endIt = map.end(); ConstIterType endCit = cmap.end(); @@ -783,41 +783,41 @@ static void test13_previousEndIterator() int i = 0; bsl::pair rc = map.insert(bsl::make_pair(i, i * i)); - ASSERT_EQ(true, rc.first == endIt); - ASSERT_EQ(true, rc.first == endCit); + BMQTST_ASSERT_EQ(true, rc.first == endIt); + BMQTST_ASSERT_EQ(true, rc.first == endCit); - ASSERT_EQ(i, endIt->first); - ASSERT_EQ((i * i), endIt->second); + BMQTST_ASSERT_EQ(i, endIt->first); + BMQTST_ASSERT_EQ((i * i), endIt->second); ++i; for (; i < 10000; ++i) { endIt = map.end(); rc = map.insert(bsl::make_pair(i, i * i)); - ASSERT_EQ_D(i, true, rc.first == endIt); - ASSERT_EQ_D(i, i, endIt->first); - ASSERT_EQ_D(i, (i * i), endIt->second); + BMQTST_ASSERT_EQ_D(i, true, rc.first == endIt); + BMQTST_ASSERT_EQ_D(i, i, endIt->first); + BMQTST_ASSERT_EQ_D(i, (i * i), endIt->second); } // Erase last element map.erase(i - 1); - ASSERT_EQ((i - 2), (--map.end())->first); + BMQTST_ASSERT_EQ((i - 2), (--map.end())->first); endIt = map.end(); ++i; rc = map.insert(bsl::make_pair(i, i * i)); - ASSERT_EQ(true, rc.first == endIt); - ASSERT_EQ(i, endIt->first); - ASSERT_EQ((i * i), endIt->second); + BMQTST_ASSERT_EQ(true, rc.first == endIt); + BMQTST_ASSERT_EQ(i, endIt->first); + BMQTST_ASSERT_EQ((i * i), endIt->second); // rinsert an element, which doesn't affect end(). ++i; endIt = map.end(); rc = map.rinsert(bsl::make_pair(i, i * i)); - ASSERT_EQ(true, endIt == map.end()); + BMQTST_ASSERT_EQ(true, endIt == map.end()); ++i; rc = map.insert(bsl::make_pair(i, i * i)); - ASSERT_EQ(true, endIt == rc.first); - ASSERT_EQ(i, endIt->first); - ASSERT_EQ((i * i), endIt->second); + BMQTST_ASSERT_EQ(true, endIt == rc.first); + BMQTST_ASSERT_EQ(i, endIt->first); + BMQTST_ASSERT_EQ((i * i), endIt->second); } static void test14_localIterator() @@ -853,20 +853,20 @@ static void test14_localIterator() LocalIterType localIt = map.begin(bucket); LocalIterType localEndIt = map.end(bucket); - ASSERT_EQ(false, localIt == localEndIt); - ASSERT_EQ(localIt->first, key); - ASSERT_EQ(localIt->second, key * key); + BMQTST_ASSERT_EQ(false, localIt == localEndIt); + BMQTST_ASSERT_EQ(localIt->first, key); + BMQTST_ASSERT_EQ(localIt->second, key * key); ++localIt; - ASSERT_EQ(true, localIt == localEndIt); + BMQTST_ASSERT_EQ(true, localIt == localEndIt); ConstLocalIterType cLocalIt = cmap.begin(bucket); ConstLocalIterType cLocalEndIt = cmap.end(bucket); - ASSERT_EQ(false, cLocalIt == cLocalEndIt); - ASSERT_EQ(cLocalIt->first, key); - ASSERT_EQ(cLocalIt->second, key * key); + BMQTST_ASSERT_EQ(false, cLocalIt == cLocalEndIt); + BMQTST_ASSERT_EQ(cLocalIt->first, key); + BMQTST_ASSERT_EQ(cLocalIt->second, key * key); ++cLocalIt; - ASSERT_EQ(true, cLocalIt == cLocalEndIt); + BMQTST_ASSERT_EQ(true, cLocalIt == cLocalEndIt); // Add keys such that they all map to same bucket in the table, while // ensuring that table is not rehashed. @@ -880,8 +880,8 @@ static void test14_localIterator() key = originalKey; for (; localIt != localEndIt; ++localIt, key += bucketCount) { - ASSERT_EQ(localIt->first, key); - ASSERT_EQ(localIt->second, key * key); + BMQTST_ASSERT_EQ(localIt->first, key); + BMQTST_ASSERT_EQ(localIt->second, key * key); } } @@ -917,37 +917,37 @@ static void test15_eraseRange() // Insert elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, rc.second, true); - ASSERT_EQ_D(i, true, rc.first != map.end()); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, i, rc.first->second); + BMQTST_ASSERT_EQ_D(i, rc.second, true); + BMQTST_ASSERT_EQ_D(i, true, rc.first != map.end()); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, i, rc.first->second); } - ASSERT_EQ(k_NUM_ELEMENTS, map.size()); + BMQTST_ASSERT_EQ(k_NUM_ELEMENTS, map.size()); ASSERT(map.erase(map.begin(), map.begin()) == map.begin()); - ASSERT_EQ(k_NUM_ELEMENTS, map.size()); + BMQTST_ASSERT_EQ(k_NUM_ELEMENTS, map.size()); ASSERT(map.erase(map.end(), map.end()) == map.end()); - ASSERT_EQ(k_NUM_ELEMENTS, map.size()); + BMQTST_ASSERT_EQ(k_NUM_ELEMENTS, map.size()); ConstIterType second = ++map.begin(); ASSERT(map.erase(map.begin(), second) == second); ASSERT(map.begin() == second); - ASSERT_EQ(k_NUM_ELEMENTS - 1, map.size()); - ASSERT_EQ_D(1, 1U, map.begin()->first); - ASSERT_EQ_D(1, 1U, 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()); - ASSERT_EQ(k_NUM_ELEMENTS - 2, map.size()); - ASSERT_EQ_D(k_NUM_ELEMENTS - 2, k_NUM_ELEMENTS - 2, (--map.end())->first); - ASSERT_EQ_D(k_NUM_ELEMENTS - 2, k_NUM_ELEMENTS - 2, (--map.end())->second); + BMQTST_ASSERT_EQ(k_NUM_ELEMENTS - 2, map.size()); + BMQTST_ASSERT_EQ_D(k_NUM_ELEMENTS - 2, k_NUM_ELEMENTS - 2, (--map.end())->first); + BMQTST_ASSERT_EQ_D(k_NUM_ELEMENTS - 2, k_NUM_ELEMENTS - 2, (--map.end())->second); ASSERT(map.erase(map.begin(), map.end()) == map.end()); - ASSERT_EQ(0U, map.size()); + BMQTST_ASSERT_EQ(0U, map.size()); - ASSERT_EQ(true, map.empty()); + BMQTST_ASSERT_EQ(true, map.empty()); } BSLA_MAYBE_UNUSED @@ -1028,8 +1028,8 @@ BSLA_MAYBE_UNUSED static void testN2_erasePerformanceOrdered() // Insert 1M elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, i, rc.first->second); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, i, rc.first->second); } // Iterate and erase @@ -1066,8 +1066,8 @@ BSLA_MAYBE_UNUSED static void testN2_erasePerformanceUnordered() // Insert 1M elements for (size_t i = 0; i < k_NUM_ELEMENTS; ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, i, rc.first->second); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, i, rc.first->second); } // Iterate and erase @@ -1156,8 +1156,8 @@ testN2_erasePerformanceUnordered_GoogleBenchmark(benchmark::State& state) state.PauseTiming(); for (size_t i = 0; i < static_cast(state.range(0)); ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, i, rc.first->second); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, i, rc.first->second); } // Iterate and erase IterType it = map.begin(); @@ -1186,8 +1186,8 @@ testN2_erasePerformanceOrdered_GoogleBenchmark(benchmark::State& state) state.PauseTiming(); for (size_t i = 0; i < static_cast(state.range(0)); ++i) { RcType rc = map.insert(bsl::make_pair(i, i)); - ASSERT_EQ_D(i, i, rc.first->first); - ASSERT_EQ_D(i, i, rc.first->second); + BMQTST_ASSERT_EQ_D(i, i, rc.first->first); + BMQTST_ASSERT_EQ_D(i, i, rc.first->second); } // Iterate and erase IterType it = map.begin(); diff --git a/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp b/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp index d034bd8137..8e0a471bc2 100644 --- a/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_orderedhashmapwithhistory.t.cpp @@ -33,17 +33,17 @@ static void setup(ObjectUnderTest& obj, size_t total, int timeout) for (size_t key = 0; key < total; ++key) { bsl::pair rc = obj.insert(bsl::make_pair(key, key + 1), now); - ASSERT_EQ(true, rc.second); - ASSERT_EQ(true, rc.first != obj.end()); - ASSERT_EQ(true, rc.first == obj.begin() || key); - ASSERT_EQ(key, rc.first->first); - ASSERT_EQ(key + 1, rc.first->second); + BMQTST_ASSERT_EQ(true, rc.second); + BMQTST_ASSERT_EQ(true, rc.first != obj.end()); + BMQTST_ASSERT_EQ(true, rc.first == obj.begin() || key); + BMQTST_ASSERT_EQ(key, rc.first->first); + BMQTST_ASSERT_EQ(key + 1, rc.first->second); - ASSERT_EQ(key + 1, obj.size()); + BMQTST_ASSERT_EQ(key + 1, obj.size()); for (size_t i = 0; i <= key; ++i) { - ASSERT_EQ(true, obj.isInHistory(i)); - ASSERT_EQ(true, obj.find(i) != obj.end()); + BMQTST_ASSERT_EQ(true, obj.isInHistory(i)); + BMQTST_ASSERT_EQ(true, obj.find(i) != obj.end()); } now += timeout; } @@ -98,20 +98,20 @@ static void test2_eraseMiddleToEnd() // erase middle to end for (size_t key = HALF; key < TOTAL; ++key) { - ASSERT_EQ(true, obj.isInHistory(key)); + BMQTST_ASSERT_EQ(true, obj.isInHistory(key)); Iterator it = obj.find(key); - ASSERT_EQ(true, it != obj.end()); + BMQTST_ASSERT_EQ(true, it != obj.end()); obj.erase(it); // should be down by 1 - ASSERT_EQ(TOTAL + HALF - key - 1, obj.size()); + BMQTST_ASSERT_EQ(TOTAL + HALF - key - 1, obj.size()); for (size_t i = HALF; i <= key; ++i) { - ASSERT_EQ(true, obj.isInHistory(i)); - ASSERT_EQ(false, obj.find(i) != obj.end()); + BMQTST_ASSERT_EQ(true, obj.isInHistory(i)); + BMQTST_ASSERT_EQ(false, obj.find(i) != obj.end()); } } @@ -119,8 +119,8 @@ static void test2_eraseMiddleToEnd() bsls::Types::Int64 now = (HALF + 2) * timeout; for (size_t key = HALF; key < TOTAL; ++key, now += timeout) { obj.gc(now); - ASSERT_EQ(false, obj.isInHistory(key)); - ASSERT_EQ(false, obj.find(key) != obj.end()); + BMQTST_ASSERT_EQ(false, obj.isInHistory(key)); + BMQTST_ASSERT_EQ(false, obj.find(key) != obj.end()); } } @@ -152,21 +152,21 @@ static void test3_eraseMiddleToBegin() // erase end to middle for (size_t key = HALF; key-- > 0;) { - ASSERT_EQ(true, obj.isInHistory(key)); - ASSERT_EQ(true, obj.find(key) != obj.end()); + BMQTST_ASSERT_EQ(true, obj.isInHistory(key)); + BMQTST_ASSERT_EQ(true, obj.find(key) != obj.end()); Iterator it = obj.find(key); - ASSERT_EQ(true, it != obj.end()); + BMQTST_ASSERT_EQ(true, it != obj.end()); obj.erase(it); // should be down by 1 - ASSERT_EQ(key + HALF, obj.size()); + BMQTST_ASSERT_EQ(key + HALF, obj.size()); for (size_t i = HALF; i-- > key;) { - ASSERT_EQ(true, obj.isInHistory(i)); - ASSERT_EQ(false, obj.find(i) != obj.end()); + BMQTST_ASSERT_EQ(true, obj.isInHistory(i)); + BMQTST_ASSERT_EQ(false, obj.find(i) != obj.end()); } } @@ -174,8 +174,8 @@ static void test3_eraseMiddleToBegin() bsls::Types::Int64 now = 2 * timeout; for (size_t key = 0; key < HALF; ++key, now += timeout) { obj.gc(now); - ASSERT_EQ(false, obj.isInHistory(key)); - ASSERT_EQ(false, obj.find(key) != obj.end()); + BMQTST_ASSERT_EQ(false, obj.isInHistory(key)); + BMQTST_ASSERT_EQ(false, obj.find(key) != obj.end()); } } @@ -207,45 +207,45 @@ static void test4_gc() // erase end to middle for (size_t key = TOTAL; key-- > HALF;) { - ASSERT_EQ(true, obj.isInHistory(key)); - ASSERT_EQ(true, obj.find(key) != obj.end()); + BMQTST_ASSERT_EQ(true, obj.isInHistory(key)); + BMQTST_ASSERT_EQ(true, obj.find(key) != obj.end()); Iterator it = obj.find(key); - ASSERT_EQ(true, it != obj.end()); + BMQTST_ASSERT_EQ(true, it != obj.end()); obj.erase(it, 1 * timeout); // 'it' is not expired yet // should be down by 1 - ASSERT_EQ(key, obj.size()); + BMQTST_ASSERT_EQ(key, obj.size()); for (size_t i = TOTAL; i-- > key;) { - ASSERT_EQ(true, obj.isInHistory(i)); - ASSERT_EQ(false, obj.find(i) != obj.end()); + BMQTST_ASSERT_EQ(true, obj.isInHistory(i)); + BMQTST_ASSERT_EQ(false, obj.find(i) != obj.end()); } } // erase middle to begin for (size_t key = HALF; key-- > 0;) { - ASSERT_EQ(true, obj.isInHistory(key)); - ASSERT_EQ(true, obj.find(key) != obj.end()); + BMQTST_ASSERT_EQ(true, obj.isInHistory(key)); + BMQTST_ASSERT_EQ(true, obj.find(key) != obj.end()); Iterator it = obj.find(key); - ASSERT_EQ(true, it != obj.end()); + BMQTST_ASSERT_EQ(true, it != obj.end()); obj.erase(it, (TOTAL + 1) * timeout); // 'it' is expired // should be down by 1 - ASSERT_EQ(key, obj.size()); + BMQTST_ASSERT_EQ(key, obj.size()); for (size_t i = HALF; i-- > key;) { - ASSERT_EQ(false, obj.isInHistory(i)); - ASSERT_EQ(false, obj.find(i) != obj.end()); + BMQTST_ASSERT_EQ(false, obj.isInHistory(i)); + BMQTST_ASSERT_EQ(false, obj.find(i) != obj.end()); } } - ASSERT_EQ(0U, obj.size()); + BMQTST_ASSERT_EQ(0U, obj.size()); } static void test5_insertAfterEnd() @@ -279,8 +279,8 @@ static void test5_insertAfterEnd() ASSERT(begin == end); ASSERT(end != obj.end()); - ASSERT_EQ(0U, end->first); // key - ASSERT_EQ(1U, end->second); // value + BMQTST_ASSERT_EQ(0U, end->first); // key + BMQTST_ASSERT_EQ(1U, end->second); // value } static void test6_eraseThenGc() diff --git a/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp b/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp index 04b440d2b5..595f3e4ab4 100644 --- a/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp +++ b/src/groups/bmq/bmqc/bmqc_twokeyhashmap.t.cpp @@ -198,7 +198,7 @@ static void test0_usageExample() map.insert("first", 1, "Hello"); // size - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.size(), 1u); bsl::pair p = map.insert("second", 2, "World"); @@ -206,7 +206,7 @@ static void test0_usageExample() BSLS_ASSERT(p.first != map.end()); // size - ASSERT_EQ(map.size(), 2u); + BMQTST_ASSERT_EQ(map.size(), 2u); // find elements using 'findByKey()' methods { @@ -250,7 +250,7 @@ static void test0_usageExample() // clearing the map { map.clear(); - ASSERT_EQ(map.size(), 0u); + BMQTST_ASSERT_EQ(map.size(), 0u); ASSERT(map.begin() == map.end()); ASSERT(map.begin() == map.end()); } @@ -295,12 +295,12 @@ static void test1_basicCreators() bmqc::TwoKeyHashMap, TestHasher > map(&alloc); - ASSERT_EQ(map.empty(), true); - ASSERT_EQ(map.size(), 0u); - ASSERT_EQ(map.begin() == map.end(), true); - ASSERT_EQ(map.hash1().id(), 0); - ASSERT_EQ(map.hash2().id(), 0); - ASSERT_EQ(map.allocator() == &alloc, true); + BMQTST_ASSERT_EQ(map.empty(), true); + BMQTST_ASSERT_EQ(map.size(), 0u); + BMQTST_ASSERT_EQ(map.begin() == map.end(), true); + BMQTST_ASSERT_EQ(map.hash1().id(), 0); + BMQTST_ASSERT_EQ(map.hash2().id(), 0); + BMQTST_ASSERT_EQ(map.allocator() == &alloc, true); } // 3. one-hasher constructor @@ -308,12 +308,12 @@ static void test1_basicCreators() bmqc::TwoKeyHashMap, TestHasher > map(TestHasher(1), &alloc); - ASSERT_EQ(map.empty(), true); - ASSERT_EQ(map.size(), 0u); - ASSERT_EQ(map.begin() == map.end(), true); - ASSERT_EQ(map.hash1().id(), 1); - ASSERT_EQ(map.hash2().id(), 0); - ASSERT_EQ(map.allocator() == &alloc, true); + BMQTST_ASSERT_EQ(map.empty(), true); + BMQTST_ASSERT_EQ(map.size(), 0u); + BMQTST_ASSERT_EQ(map.begin() == map.end(), true); + BMQTST_ASSERT_EQ(map.hash1().id(), 1); + BMQTST_ASSERT_EQ(map.hash2().id(), 0); + BMQTST_ASSERT_EQ(map.allocator() == &alloc, true); } // 4. two-hasher constructor @@ -321,12 +321,12 @@ static void test1_basicCreators() bmqc::TwoKeyHashMap, TestHasher > map(TestHasher(1), TestHasher(2), &alloc); - ASSERT_EQ(map.empty(), true); - ASSERT_EQ(map.size(), 0u); - ASSERT_EQ(map.begin() == map.end(), true); - ASSERT_EQ(map.hash1().id(), 1); - ASSERT_EQ(map.hash2().id(), 2); - ASSERT_EQ(map.allocator() == &alloc, true); + BMQTST_ASSERT_EQ(map.empty(), true); + BMQTST_ASSERT_EQ(map.size(), 0u); + BMQTST_ASSERT_EQ(map.begin() == map.end(), true); + BMQTST_ASSERT_EQ(map.hash1().id(), 1); + BMQTST_ASSERT_EQ(map.hash2().id(), 2); + BMQTST_ASSERT_EQ(map.allocator() == &alloc, true); } } @@ -374,8 +374,8 @@ static void test2_copyAndMove() original.insert(4, "forth", "value4"); original.insert(5, "fifth", "value5"); - ASSERT_EQ(original.size(), 5u); - ASSERT_EQ(original.findByKey1(1) != original.end() && + BMQTST_ASSERT_EQ(original.size(), 5u); + BMQTST_ASSERT_EQ(original.findByKey1(1) != original.end() && original.findByKey1(2) != original.end() && original.findByKey1(3) != original.end() && original.findByKey1(4) != original.end() && @@ -388,25 +388,25 @@ static void test2_copyAndMove() Map copy(original, &alloc); // the copy's contents is identical to original's - ASSERT_EQ(copy.size(), 5u); + BMQTST_ASSERT_EQ(copy.size(), 5u); - ASSERT_EQ(copy.findByKey1(1) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(1) != copy.end() && *original.findByKey1(1) == *copy.findByKey1(1), true); - ASSERT_EQ(copy.findByKey1(2) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(2) != copy.end() && *original.findByKey1(2) == *copy.findByKey1(2), true); - ASSERT_EQ(copy.findByKey1(3) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(3) != copy.end() && *original.findByKey1(3) == *copy.findByKey1(3), true); - ASSERT_EQ(copy.findByKey1(4) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(4) != copy.end() && *original.findByKey1(4) == *copy.findByKey1(4), true); - ASSERT_EQ(copy.findByKey1(5) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(5) != copy.end() && *original.findByKey1(5) == *copy.findByKey1(5), true); } @@ -420,25 +420,25 @@ static void test2_copyAndMove() Map movedTo(bslmf::MovableRefUtil::move(movedFrom), &alloc); // the moved-to object contents is identical to original's - ASSERT_EQ(movedTo.size(), 5u); + BMQTST_ASSERT_EQ(movedTo.size(), 5u); - ASSERT_EQ(movedTo.findByKey1(1) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(1) != movedTo.end() && *original.findByKey1(1) == *movedTo.findByKey1(1), true); - ASSERT_EQ(movedTo.findByKey1(2) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(2) != movedTo.end() && *original.findByKey1(2) == *movedTo.findByKey1(2), true); - ASSERT_EQ(movedTo.findByKey1(3) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(3) != movedTo.end() && *original.findByKey1(3) == *movedTo.findByKey1(3), true); - ASSERT_EQ(movedTo.findByKey1(4) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(4) != movedTo.end() && *original.findByKey1(4) == *movedTo.findByKey1(4), true); - ASSERT_EQ(movedTo.findByKey1(5) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(5) != movedTo.end() && *original.findByKey1(5) == *movedTo.findByKey1(5), true); } @@ -450,31 +450,31 @@ static void test2_copyAndMove() // insert elements into copy copy.insert(1, "first", "value1"); copy.insert(999, "999-th", "value999"); - ASSERT_EQ(copy.size(), 2u); + BMQTST_ASSERT_EQ(copy.size(), 2u); // do copy copy = original; // the copy's contents is identical to original's - ASSERT_EQ(copy.size(), 5u); + BMQTST_ASSERT_EQ(copy.size(), 5u); - ASSERT_EQ(copy.findByKey1(1) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(1) != copy.end() && *original.findByKey1(1) == *copy.findByKey1(1), true); - ASSERT_EQ(copy.findByKey1(2) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(2) != copy.end() && *original.findByKey1(2) == *copy.findByKey1(2), true); - ASSERT_EQ(copy.findByKey1(3) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(3) != copy.end() && *original.findByKey1(3) == *copy.findByKey1(3), true); - ASSERT_EQ(copy.findByKey1(4) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(4) != copy.end() && *original.findByKey1(4) == *copy.findByKey1(4), true); - ASSERT_EQ(copy.findByKey1(5) != copy.end() && + BMQTST_ASSERT_EQ(copy.findByKey1(5) != copy.end() && *original.findByKey1(5) == *copy.findByKey1(5), true); } @@ -489,31 +489,31 @@ static void test2_copyAndMove() // insert elements into 'movedTo' movedTo.insert(1, "first", "value1"); movedTo.insert(999, "999-th", "value999"); - ASSERT_EQ(movedTo.size(), 2u); + BMQTST_ASSERT_EQ(movedTo.size(), 2u); // do move movedTo = bslmf::MovableRefUtil::move(movedFrom); // the moved-to object contents is identical to original's - ASSERT_EQ(movedTo.size(), 5u); + BMQTST_ASSERT_EQ(movedTo.size(), 5u); - ASSERT_EQ(movedTo.findByKey1(1) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(1) != movedTo.end() && *original.findByKey1(1) == *movedTo.findByKey1(1), true); - ASSERT_EQ(movedTo.findByKey1(2) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(2) != movedTo.end() && *original.findByKey1(2) == *movedTo.findByKey1(2), true); - ASSERT_EQ(movedTo.findByKey1(3) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(3) != movedTo.end() && *original.findByKey1(3) == *movedTo.findByKey1(3), true); - ASSERT_EQ(movedTo.findByKey1(4) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(4) != movedTo.end() && *original.findByKey1(4) == *movedTo.findByKey1(4), true); - ASSERT_EQ(movedTo.findByKey1(5) != movedTo.end() && + BMQTST_ASSERT_EQ(movedTo.findByKey1(5) != movedTo.end() && *original.findByKey1(5) == *movedTo.findByKey1(5), true); } @@ -585,16 +585,16 @@ static void test3_insert() Map::iterator iterator1 = pair1.first; // element inserted - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(result1, Map::e_INSERTED); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(result1, Map::e_INSERTED); // returned iterator refers to the inserted element and is bound to the // first key - ASSERT_EQ(iterator1 == map.end(), false); - ASSERT_EQ(iterator1.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(iterator1->key1(), 1); - ASSERT_EQ(iterator1->key2(), "first"); - ASSERT_EQ(iterator1->value(), "value1"); + BMQTST_ASSERT_EQ(iterator1 == map.end(), false); + BMQTST_ASSERT_EQ(iterator1.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(iterator1->key1(), 1); + BMQTST_ASSERT_EQ(iterator1->key2(), "first"); + BMQTST_ASSERT_EQ(iterator1->value(), "value1"); // insert second element InsertPair pair2 = @@ -604,22 +604,22 @@ static void test3_insert() Map::iterator iterator2 = pair2.first; // element inserted - ASSERT_EQ(map.size(), 2u); - ASSERT_EQ(result2, Map::e_INSERTED); + BMQTST_ASSERT_EQ(map.size(), 2u); + BMQTST_ASSERT_EQ(result2, Map::e_INSERTED); // returned iterator refers to the inserted element and is bound to the // second key - ASSERT_EQ(iterator2 == map.end(), false); - ASSERT_EQ(iterator2.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(iterator2->key1(), 2); - ASSERT_EQ(iterator2->key2(), "second"); - ASSERT_EQ(iterator2->value(), "value2"); + BMQTST_ASSERT_EQ(iterator2 == map.end(), false); + BMQTST_ASSERT_EQ(iterator2.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(iterator2->key1(), 2); + BMQTST_ASSERT_EQ(iterator2->key2(), "second"); + BMQTST_ASSERT_EQ(iterator2->value(), "value2"); // the first element is intact - ASSERT_EQ(map.size(), 2u); - ASSERT_EQ(iterator1->key1(), 1); - ASSERT_EQ(iterator1->key2(), "first"); - ASSERT_EQ(iterator1->value(), "value1"); + BMQTST_ASSERT_EQ(map.size(), 2u); + BMQTST_ASSERT_EQ(iterator1->key1(), 1); + BMQTST_ASSERT_EQ(iterator1->key2(), "first"); + BMQTST_ASSERT_EQ(iterator1->value(), "value1"); } // 2. first key already exists @@ -636,19 +636,19 @@ static void test3_insert() map.insert(1, "second", "value2", Map::e_SECOND_KEY); // nothing inserted - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.size(), 1u); // check returned values and that the map contents hasn't changed Map::InsertResult result = pair.second; Map::iterator iterator = pair.first; - ASSERT_EQ(result, Map::e_FIRST_KEY_EXISTS); + BMQTST_ASSERT_EQ(result, Map::e_FIRST_KEY_EXISTS); - ASSERT_EQ(iterator == map.end(), false); - ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(iterator->key1(), 1); - ASSERT_EQ(iterator->key2(), "first"); - ASSERT_EQ(iterator->value(), "value1"); + BMQTST_ASSERT_EQ(iterator == map.end(), false); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(iterator->key1(), 1); + BMQTST_ASSERT_EQ(iterator->key2(), "first"); + BMQTST_ASSERT_EQ(iterator->value(), "value1"); } // 3. second key already exists @@ -668,13 +668,13 @@ static void test3_insert() Map::InsertResult result = pair.second; Map::iterator iterator = pair.first; - ASSERT_EQ(result, Map::e_SECOND_KEY_EXISTS); + BMQTST_ASSERT_EQ(result, Map::e_SECOND_KEY_EXISTS); - ASSERT_EQ(iterator == map.end(), false); - ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(iterator->key1(), 1); - ASSERT_EQ(iterator->key2(), "first"); - ASSERT_EQ(iterator->value(), "value1"); + BMQTST_ASSERT_EQ(iterator == map.end(), false); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(iterator->key1(), 1); + BMQTST_ASSERT_EQ(iterator->key2(), "first"); + BMQTST_ASSERT_EQ(iterator->value(), "value1"); } // 4. check exception safety @@ -703,13 +703,13 @@ static void test3_insert() } // an exception was thrown - ASSERT_EQ(exceptionThrown, true); + BMQTST_ASSERT_EQ(exceptionThrown, true); // the map state hasn't changed - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(map.begin()->key1().value(), 0); - ASSERT_EQ(map.begin()->key2().value(), 0); - ASSERT_EQ(map.begin()->value().value(), 0); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.begin()->key1().value(), 0); + BMQTST_ASSERT_EQ(map.begin()->key2().value(), 0); + BMQTST_ASSERT_EQ(map.begin()->value().value(), 0); // try inserting another element, given that the second key copy // constructor throws @@ -724,13 +724,13 @@ static void test3_insert() } // an exception was thrown - ASSERT_EQ(exceptionThrown, true); + BMQTST_ASSERT_EQ(exceptionThrown, true); // the map state hasn't changed - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(map.begin()->key1().value(), 0); - ASSERT_EQ(map.begin()->key2().value(), 0); - ASSERT_EQ(map.begin()->value().value(), 0); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.begin()->key1().value(), 0); + BMQTST_ASSERT_EQ(map.begin()->key2().value(), 0); + BMQTST_ASSERT_EQ(map.begin()->value().value(), 0); // try inserting another element, given that the value copy // constructor throws @@ -745,13 +745,13 @@ static void test3_insert() } // an exception was thrown - ASSERT_EQ(exceptionThrown, true); + BMQTST_ASSERT_EQ(exceptionThrown, true); // the map state hasn't changed - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(map.begin()->key1().value(), 0); - ASSERT_EQ(map.begin()->key2().value(), 0); - ASSERT_EQ(map.begin()->value().value(), 0); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.begin()->key1().value(), 0); + BMQTST_ASSERT_EQ(map.begin()->key2().value(), 0); + BMQTST_ASSERT_EQ(map.begin()->value().value(), 0); } } @@ -812,7 +812,7 @@ static void test4_erase() map.insert(3, "third", "value3"); map.insert(4, "forth", "value4"); map.insert(5, "fifth", "value5"); - ASSERT_EQ(map.size(), 5u); + BMQTST_ASSERT_EQ(map.size(), 5u); // make a list of elements ordered according to the first key it = map.begin(Map::e_FIRST_KEY); @@ -834,9 +834,9 @@ static void test4_erase() // find element with first key equal to 3 Map::iterator erased = map.findByKey1(3); - ASSERT_EQ(erased == map.end(), false) - ASSERT_EQ(erased->key1(), 3); - ASSERT_EQ(erased.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(erased == map.end(), false) + BMQTST_ASSERT_EQ(erased->key1(), 3); + BMQTST_ASSERT_EQ(erased.keyIndex(), Map::e_FIRST_KEY); const Map::value_type* erased_p = &*erased; @@ -844,41 +844,41 @@ static void test4_erase() map.erase(erased); // element removed - ASSERT_EQ(map.size(), 4u); - ASSERT_EQ(map.findByKey1(3) == map.end(), true); + BMQTST_ASSERT_EQ(map.size(), 4u); + BMQTST_ASSERT_EQ(map.findByKey1(3) == map.end(), true); // order of remaining elements indexed by the first key hasn't changed it = map.begin(Map::e_FIRST_KEY); - ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, true); - ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, true); - ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, true); - ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, true); - ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, true); // order of remaining elements indexed by the second key hasn't changed it = map.begin(Map::e_SECOND_KEY); - ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, true); - ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, true); - ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, true); - ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, true); - ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, true); } @@ -893,7 +893,7 @@ static void test4_erase() map.insert(3, "third", "value3"); map.insert(4, "forth", "value4"); map.insert(5, "fifth", "value5"); - ASSERT_EQ(map.size(), 5u); + BMQTST_ASSERT_EQ(map.size(), 5u); // make a list of elements ordered according to the first key it = map.begin(Map::e_FIRST_KEY); @@ -915,9 +915,9 @@ static void test4_erase() // find element with second key equal to "third" Map::iterator erased = map.findByKey2("third"); - ASSERT_EQ(erased == map.end(), false) - ASSERT_EQ(erased->key2(), "third"); - ASSERT_EQ(erased.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(erased == map.end(), false) + BMQTST_ASSERT_EQ(erased->key2(), "third"); + BMQTST_ASSERT_EQ(erased.keyIndex(), Map::e_SECOND_KEY); const Map::value_type* erased_p = &*erased; @@ -925,41 +925,41 @@ static void test4_erase() map.erase(erased); // element removed - ASSERT_EQ(map.size(), 4u); - ASSERT_EQ(map.findByKey2("third") == map.end(), true); + BMQTST_ASSERT_EQ(map.size(), 4u); + BMQTST_ASSERT_EQ(map.findByKey2("third") == map.end(), true); // order of remaining elements indexed by the first key hasn't changed it = map.begin(Map::e_FIRST_KEY); - ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, true); - ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, true); - ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, true); - ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, true); - ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, true); // order of remaining elements indexed by the second key hasn't changed it = map.begin(Map::e_SECOND_KEY); - ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, true); - ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, true); - ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, true); - ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, true); - ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, true); } @@ -974,7 +974,7 @@ static void test4_erase() map.insert(3, "third", "value3"); map.insert(4, "forth", "value4"); map.insert(5, "fifth", "value5"); - ASSERT_EQ(map.size(), 5u); + BMQTST_ASSERT_EQ(map.size(), 5u); while (!map.empty()) { // erase first element, as ordered by the first key @@ -982,8 +982,8 @@ static void test4_erase() map.begin(Map::e_FIRST_KEY)); // 'erase()' returned an iterator to the next element - ASSERT_EQ(nextAfterErased == map.begin(Map::e_FIRST_KEY), true); - ASSERT_EQ(nextAfterErased.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(nextAfterErased == map.begin(Map::e_FIRST_KEY), true); + BMQTST_ASSERT_EQ(nextAfterErased.keyIndex(), Map::e_FIRST_KEY); } } @@ -999,7 +999,7 @@ static void test4_erase() map.insert(3, "third", "value3"); map.insert(4, "forth", "value4"); map.insert(5, "fifth", "value5"); - ASSERT_EQ(map.size(), 5u); + BMQTST_ASSERT_EQ(map.size(), 5u); while (!map.empty()) { // erase first element, as ordered by the second key @@ -1007,8 +1007,8 @@ static void test4_erase() map.begin(Map::e_SECOND_KEY)); // 'erase()' returned an iterator to the next element - ASSERT_EQ(nextAfterErased == map.begin(Map::e_SECOND_KEY), true); - ASSERT_EQ(nextAfterErased.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(nextAfterErased == map.begin(Map::e_SECOND_KEY), true); + BMQTST_ASSERT_EQ(nextAfterErased.keyIndex(), Map::e_SECOND_KEY); } } } @@ -1056,7 +1056,7 @@ static void test5_eraseByKey1() map.insert(3, "third", "value3"); map.insert(4, "forth", "value4"); map.insert(5, "fifth", "value5"); - ASSERT_EQ(map.size(), 5u); + BMQTST_ASSERT_EQ(map.size(), 5u); // make a list of elements ordered according to the first key it = map.begin(Map::e_FIRST_KEY); @@ -1078,8 +1078,8 @@ static void test5_eraseByKey1() // find element with first key equal to 3 Map::iterator erased = map.findByKey1(3); - ASSERT_EQ(erased == map.end(), false) - ASSERT_EQ(erased->key1(), 3); + BMQTST_ASSERT_EQ(erased == map.end(), false) + BMQTST_ASSERT_EQ(erased->key1(), 3); const Map::value_type* erased_p = &*erased; @@ -1087,44 +1087,44 @@ static void test5_eraseByKey1() int eraseRc = map.eraseByKey1(3); // return value is 0 - ASSERT_EQ(eraseRc, 0); + BMQTST_ASSERT_EQ(eraseRc, 0); // element removed - ASSERT_EQ(map.size(), 4u); - ASSERT_EQ(map.findByKey1(3) == map.end(), true); + BMQTST_ASSERT_EQ(map.size(), 4u); + BMQTST_ASSERT_EQ(map.findByKey1(3) == map.end(), true); // order of remaining elements indexed by the first key hasn't changed it = map.begin(Map::e_FIRST_KEY); - ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, true); - ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, true); - ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, true); - ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, true); - ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, true); // order of remaining elements indexed by the second key hasn't changed it = map.begin(Map::e_SECOND_KEY); - ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, true); - ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, true); - ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, true); - ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, true); - ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, true); } @@ -1136,19 +1136,19 @@ static void test5_eraseByKey1() // insert elements map.insert(1, "first", "value1"); - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.size(), 1u); // try erasing by key that doesn't exist int eraseRc = map.eraseByKey1(2); // returned value is non-zero - ASSERT_NE(eraseRc, 0); + BMQTST_ASSERT_NE(eraseRc, 0); // the map is intact - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(map.begin()->key1(), 1); - ASSERT_EQ(map.begin()->key2(), "first"); - ASSERT_EQ(map.begin()->value(), "value1"); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.begin()->key1(), 1); + BMQTST_ASSERT_EQ(map.begin()->key2(), "first"); + BMQTST_ASSERT_EQ(map.begin()->value(), "value1"); } // 3. erase by first key, which exists, but throws on comparison @@ -1160,7 +1160,7 @@ static void test5_eraseByKey1() // insert elements map.insert(1, "first", "value1"); - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.size(), 1u); bool exceptionThrown = false; @@ -1173,13 +1173,13 @@ static void test5_eraseByKey1() } // exception was thrown - ASSERT_EQ(exceptionThrown, true); + BMQTST_ASSERT_EQ(exceptionThrown, true); // the map is intact - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(map.begin()->key1().value(), 1); - ASSERT_EQ(map.begin()->key2(), "first"); - ASSERT_EQ(map.begin()->value(), "value1"); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.begin()->key1().value(), 1); + BMQTST_ASSERT_EQ(map.begin()->key2(), "first"); + BMQTST_ASSERT_EQ(map.begin()->value(), "value1"); } } @@ -1226,7 +1226,7 @@ static void test6_eraseByKey2() map.insert(3, "third", "value3"); map.insert(4, "forth", "value4"); map.insert(5, "fifth", "value5"); - ASSERT_EQ(map.size(), 5u); + BMQTST_ASSERT_EQ(map.size(), 5u); // make a list of elements ordered according to the first key it = map.begin(Map::e_FIRST_KEY); @@ -1248,8 +1248,8 @@ static void test6_eraseByKey2() // find element with second key equal to "third" Map::iterator erased = map.findByKey2("third"); - ASSERT_EQ(erased == map.end(), false) - ASSERT_EQ(erased->key2(), "third"); + BMQTST_ASSERT_EQ(erased == map.end(), false) + BMQTST_ASSERT_EQ(erased->key2(), "third"); const Map::value_type* erased_p = &*erased; @@ -1257,44 +1257,44 @@ static void test6_eraseByKey2() int eraseRc = map.eraseByKey2("third"); // return value is 0 - ASSERT_EQ(eraseRc, 0); + BMQTST_ASSERT_EQ(eraseRc, 0); // element removed - ASSERT_EQ(map.size(), 4u); - ASSERT_EQ(map.findByKey2("third") == map.end(), true); + BMQTST_ASSERT_EQ(map.size(), 4u); + BMQTST_ASSERT_EQ(map.findByKey2("third") == map.end(), true); // order of remaining elements indexed by the first key hasn't changed it = map.begin(Map::e_FIRST_KEY); - ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[0] == erased_p || elementsByKey1[0] == &*it++, true); - ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[1] == erased_p || elementsByKey1[1] == &*it++, true); - ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[2] == erased_p || elementsByKey1[2] == &*it++, true); - ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[3] == erased_p || elementsByKey1[3] == &*it++, true); - ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey1[4] == erased_p || elementsByKey1[4] == &*it++, true); // order of remaining elements indexed by the second key hasn't changed it = map.begin(Map::e_SECOND_KEY); - ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[0] == erased_p || elementsByKey2[0] == &*it++, true); - ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[1] == erased_p || elementsByKey2[1] == &*it++, true); - ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[2] == erased_p || elementsByKey2[2] == &*it++, true); - ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[3] == erased_p || elementsByKey2[3] == &*it++, true); - ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, + BMQTST_ASSERT_EQ(elementsByKey2[4] == erased_p || elementsByKey2[4] == &*it++, true); } @@ -1306,19 +1306,19 @@ static void test6_eraseByKey2() // insert elements map.insert(1, "first", "value1"); - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.size(), 1u); // try erasing by key that doesn't exist int eraseRc = map.eraseByKey2("second"); // returned value is non-zero - ASSERT_NE(eraseRc, 0); + BMQTST_ASSERT_NE(eraseRc, 0); // the map is intact - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(map.begin()->key1(), 1); - ASSERT_EQ(map.begin()->key2(), "first"); - ASSERT_EQ(map.begin()->value(), "value1"); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.begin()->key1(), 1); + BMQTST_ASSERT_EQ(map.begin()->key2(), "first"); + BMQTST_ASSERT_EQ(map.begin()->value(), "value1"); } // 3. erase by second key, which exists, but throws on comparison @@ -1330,7 +1330,7 @@ static void test6_eraseByKey2() // insert elements map.insert("first", 1, "value1"); - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.size(), 1u); bool exceptionThrown = false; @@ -1343,13 +1343,13 @@ static void test6_eraseByKey2() } // exception was thrown - ASSERT_EQ(exceptionThrown, true); + BMQTST_ASSERT_EQ(exceptionThrown, true); // the map is intact - ASSERT_EQ(map.size(), 1u); - ASSERT_EQ(map.begin()->key1(), "first"); - ASSERT_EQ(map.begin()->key2().value(), 1); - ASSERT_EQ(map.begin()->value(), "value1"); + BMQTST_ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.begin()->key1(), "first"); + BMQTST_ASSERT_EQ(map.begin()->key2().value(), 1); + BMQTST_ASSERT_EQ(map.begin()->value(), "value1"); } } @@ -1378,19 +1378,19 @@ static void test7_clear() map.insert(1, "first", "value1"); map.insert(2, "second", "value2"); map.insert(3, "third", "value3"); - ASSERT_EQ(map.size(), 3u); + BMQTST_ASSERT_EQ(map.size(), 3u); // do clear map.clear(); // the map is now empty - ASSERT_EQ(map.empty(), true); + BMQTST_ASSERT_EQ(map.empty(), true); // clear again map.clear(); // the map is still empty - ASSERT_EQ(map.empty(), true); + BMQTST_ASSERT_EQ(map.empty(), true); } static void test8_swap() @@ -1417,36 +1417,36 @@ static void test8_swap() // insert 1 element to map1 map1.insert(1, "first", "value1"); - ASSERT_EQ(map1.size(), 1u); + BMQTST_ASSERT_EQ(map1.size(), 1u); // insert 2 elements to map2 map2.insert(2, "second", "value2"); map2.insert(3, "third", "value3"); - ASSERT_EQ(map2.size(), 2u); + BMQTST_ASSERT_EQ(map2.size(), 2u); // swap maps swap(map1, map2); // map1 now have the contents of map2 - ASSERT_EQ(map1.size(), 2u); + BMQTST_ASSERT_EQ(map1.size(), 2u); - ASSERT_EQ((it = map1.findByKey1(2)) == map1.end(), false); - ASSERT_EQ(it->key1(), 2); - ASSERT_EQ(it->key2(), "second"); - ASSERT_EQ(it->value(), "value2"); + BMQTST_ASSERT_EQ((it = map1.findByKey1(2)) == map1.end(), false); + BMQTST_ASSERT_EQ(it->key1(), 2); + BMQTST_ASSERT_EQ(it->key2(), "second"); + BMQTST_ASSERT_EQ(it->value(), "value2"); - ASSERT_EQ((it = map1.findByKey1(3)) == map1.end(), false); - ASSERT_EQ(it->key1(), 3); - ASSERT_EQ(it->key2(), "third"); - ASSERT_EQ(it->value(), "value3"); + BMQTST_ASSERT_EQ((it = map1.findByKey1(3)) == map1.end(), false); + BMQTST_ASSERT_EQ(it->key1(), 3); + BMQTST_ASSERT_EQ(it->key2(), "third"); + BMQTST_ASSERT_EQ(it->value(), "value3"); // map2 now have the contents of map1 - ASSERT_EQ(map2.size(), 1u); + BMQTST_ASSERT_EQ(map2.size(), 1u); - ASSERT_EQ((it = map2.findByKey1(1)) == map2.end(), false); - ASSERT_EQ(it->key1(), 1); - ASSERT_EQ(it->key2(), "first"); - ASSERT_EQ(it->value(), "value1"); + BMQTST_ASSERT_EQ((it = map2.findByKey1(1)) == map2.end(), false); + BMQTST_ASSERT_EQ(it->key1(), 1); + BMQTST_ASSERT_EQ(it->key2(), "first"); + BMQTST_ASSERT_EQ(it->value(), "value1"); } static void test9_rangeObservers() @@ -1478,7 +1478,7 @@ static void test9_rangeObservers() // insert 1 element to nonEmptyMap nonEmptyMap.insert(1, "first", "value1"); - ASSERT_EQ(nonEmptyMap.size(), 1u); + BMQTST_ASSERT_EQ(nonEmptyMap.size(), 1u); const Map::value_type* element_p = &*nonEmptyMap.begin(); @@ -1486,164 +1486,164 @@ static void test9_rangeObservers() { // begin(), first key iterator = emptyMap.begin(Map::e_FIRST_KEY); - ASSERT_EQ(iterator == emptyMap.end(), true); - ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(iterator == emptyMap.end(), true); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); // begin(), second key iterator = emptyMap.begin(Map::e_SECOND_KEY); - ASSERT_EQ(iterator == emptyMap.end(), true); - ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(iterator == emptyMap.end(), true); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); // cbegin(), first key constIterator = emptyMap.cbegin(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator == emptyMap.cend(), true); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator == emptyMap.cend(), true); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // cbegin(), second key constIterator = emptyMap.cbegin(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator == emptyMap.cend(), true); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator == emptyMap.cend(), true); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); // end(), first key iterator = emptyMap.end(Map::e_FIRST_KEY); - ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); // end(), second key iterator = emptyMap.end(Map::e_SECOND_KEY); - ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); // cend(), first key constIterator = emptyMap.cend(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // cend(), second key constIterator = emptyMap.cend(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); } // non-const non-empty map { // begin(), first key iterator = nonEmptyMap.begin(Map::e_FIRST_KEY); - ASSERT_EQ(iterator == nonEmptyMap.end(), false); - ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(*iterator == *element_p, true); + BMQTST_ASSERT_EQ(iterator == nonEmptyMap.end(), false); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(*iterator == *element_p, true); // begin(), second key iterator = nonEmptyMap.begin(Map::e_SECOND_KEY); - ASSERT_EQ(iterator == nonEmptyMap.end(), false); - ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(*iterator == *element_p, true); + BMQTST_ASSERT_EQ(iterator == nonEmptyMap.end(), false); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(*iterator == *element_p, true); // cbegin(), first key constIterator = nonEmptyMap.cbegin(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(*constIterator == *element_p, true); + BMQTST_ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(*constIterator == *element_p, true); // cbegin(), second key constIterator = nonEmptyMap.cbegin(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(*constIterator == *element_p, true); + BMQTST_ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(*constIterator == *element_p, true); // end(), first key iterator = nonEmptyMap.end(Map::e_FIRST_KEY); - ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_FIRST_KEY); // end(), second key iterator = nonEmptyMap.end(Map::e_SECOND_KEY); - ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(iterator.keyIndex(), Map::e_SECOND_KEY); // cend(), first key constIterator = nonEmptyMap.cend(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // cend(), second key constIterator = nonEmptyMap.cend(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); } // const empty map { // begin(), first key constIterator = bsl::cref(emptyMap).get().begin(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator == emptyMap.end(), true); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator == emptyMap.end(), true); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // begin(), second key constIterator = bsl::cref(emptyMap).get().begin(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator == emptyMap.end(), true); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator == emptyMap.end(), true); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); // cbegin(), first key constIterator = bsl::cref(emptyMap).get().cbegin(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator == emptyMap.cend(), true); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator == emptyMap.cend(), true); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // cbegin(), second key constIterator = bsl::cref(emptyMap).get().cbegin(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator == emptyMap.cend(), true); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator == emptyMap.cend(), true); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); // end(), first key constIterator = bsl::cref(emptyMap).get().end(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // end(), second key constIterator = bsl::cref(emptyMap).get().end(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); // cend(), first key constIterator = bsl::cref(emptyMap).get().cend(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // cend(), second key constIterator = bsl::cref(emptyMap).get().cend(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); } // const non-empty map { // begin(), first key constIterator = bsl::cref(nonEmptyMap).get().begin(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator == nonEmptyMap.end(), false); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(*constIterator == *element_p, true); + BMQTST_ASSERT_EQ(constIterator == nonEmptyMap.end(), false); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(*constIterator == *element_p, true); // begin(), second key constIterator = bsl::cref(nonEmptyMap).get().begin(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator == nonEmptyMap.end(), false); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(*constIterator == *element_p, true); + BMQTST_ASSERT_EQ(constIterator == nonEmptyMap.end(), false); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(*constIterator == *element_p, true); // cbegin(), first key constIterator = bsl::cref(nonEmptyMap).get().cbegin(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(*constIterator == *element_p, true); + BMQTST_ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(*constIterator == *element_p, true); // cbegin(), second key constIterator = bsl::cref(nonEmptyMap).get().cbegin(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(*constIterator == *element_p, true); + BMQTST_ASSERT_EQ(constIterator == nonEmptyMap.cend(), false); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(*constIterator == *element_p, true); // end(), first key constIterator = bsl::cref(nonEmptyMap).get().end(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // end(), second key constIterator = bsl::cref(nonEmptyMap).get().end(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); // cend(), first key constIterator = bsl::cref(nonEmptyMap).get().cend(Map::e_FIRST_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_FIRST_KEY); // cend(), second key constIterator = bsl::cref(nonEmptyMap).get().cend(Map::e_SECOND_KEY); - ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(constIterator.keyIndex(), Map::e_SECOND_KEY); } } @@ -1689,40 +1689,40 @@ static void test10_findByKey1() // insert elements map.insert(1, "first", "value1"); map.insert(2, "second", "value2"); - ASSERT_EQ(map.size(), 2u); + BMQTST_ASSERT_EQ(map.size(), 2u); // 1. non-const contained, key exists { Map::iterator it = map.findByKey1(1); - ASSERT_EQ(it == map.end(), false); - ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(it->key1(), 1); - ASSERT_EQ(it->key2(), "first"); - ASSERT_EQ(it->value(), "value1"); + BMQTST_ASSERT_EQ(it == map.end(), false); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(it->key1(), 1); + BMQTST_ASSERT_EQ(it->key2(), "first"); + BMQTST_ASSERT_EQ(it->value(), "value1"); } // 2. const contained, key exists { Map::const_iterator it = bsl::cref(map).get().findByKey1(2); - ASSERT_EQ(it == map.end(), false); - ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); - ASSERT_EQ(it->key1(), 2); - ASSERT_EQ(it->key2(), "second"); - ASSERT_EQ(it->value(), "value2"); + BMQTST_ASSERT_EQ(it == map.end(), false); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(it->key1(), 2); + BMQTST_ASSERT_EQ(it->key2(), "second"); + BMQTST_ASSERT_EQ(it->value(), "value2"); } // 3. non-const contained, key doesn't exist { Map::iterator it = map.findByKey1(3); - ASSERT_EQ(it == map.end(), true); - ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(it == map.end(), true); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); } // 4. const contained, key doesn't exist { Map::const_iterator it = bsl::cref(map).get().findByKey1(3); - ASSERT_EQ(it == map.end(), true); - ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); + BMQTST_ASSERT_EQ(it == map.end(), true); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_FIRST_KEY); } } @@ -1768,40 +1768,40 @@ static void test11_findByKey2() // insert elements map.insert(1, "first", "value1"); map.insert(2, "second", "value2"); - ASSERT_EQ(map.size(), 2u); + BMQTST_ASSERT_EQ(map.size(), 2u); // 1. non-const contained, key exists { Map::iterator it = map.findByKey2("first"); - ASSERT_EQ(it == map.end(), false); - ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(it->key1(), 1); - ASSERT_EQ(it->key2(), "first"); - ASSERT_EQ(it->value(), "value1"); + BMQTST_ASSERT_EQ(it == map.end(), false); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(it->key1(), 1); + BMQTST_ASSERT_EQ(it->key2(), "first"); + BMQTST_ASSERT_EQ(it->value(), "value1"); } // 2. const contained, key exists { Map::const_iterator it = bsl::cref(map).get().findByKey2("second"); - ASSERT_EQ(it == map.end(), false); - ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); - ASSERT_EQ(it->key1(), 2); - ASSERT_EQ(it->key2(), "second"); - ASSERT_EQ(it->value(), "value2"); + BMQTST_ASSERT_EQ(it == map.end(), false); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(it->key1(), 2); + BMQTST_ASSERT_EQ(it->key2(), "second"); + BMQTST_ASSERT_EQ(it->value(), "value2"); } // 3. non-const contained, key doesn't exist { Map::iterator it = map.findByKey2("third"); - ASSERT_EQ(it == map.end(), true); - ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(it == map.end(), true); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); } // 4. const contained, key doesn't exist { Map::const_iterator it = bsl::cref(map).get().findByKey2("third"); - ASSERT_EQ(it == map.end(), true); - ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); + BMQTST_ASSERT_EQ(it == map.end(), true); + BMQTST_ASSERT_EQ(it.keyIndex(), Map::e_SECOND_KEY); } } @@ -1826,38 +1826,38 @@ static void test12_sizeObservers() bslma::TestAllocator alloc; Map map(&alloc); - ASSERT_EQ(map.empty(), true); - ASSERT_EQ(map.size(), 0u); + BMQTST_ASSERT_EQ(map.empty(), true); + BMQTST_ASSERT_EQ(map.size(), 0u); map.insert(1, "first", "value1"); - ASSERT_EQ(map.empty(), false); - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.empty(), false); + BMQTST_ASSERT_EQ(map.size(), 1u); map.insert(2, "second", "value2"); - ASSERT_EQ(map.empty(), false); - ASSERT_EQ(map.size(), 2u); + BMQTST_ASSERT_EQ(map.empty(), false); + BMQTST_ASSERT_EQ(map.size(), 2u); map.insert(3, "third", "value2"); - ASSERT_EQ(map.empty(), false); - ASSERT_EQ(map.size(), 3u); + BMQTST_ASSERT_EQ(map.empty(), false); + BMQTST_ASSERT_EQ(map.size(), 3u); map.erase(map.begin()); - ASSERT_EQ(map.empty(), false); - ASSERT_EQ(map.size(), 2u); + BMQTST_ASSERT_EQ(map.empty(), false); + BMQTST_ASSERT_EQ(map.size(), 2u); map.erase(map.begin()); - ASSERT_EQ(map.empty(), false); - ASSERT_EQ(map.size(), 1u); + BMQTST_ASSERT_EQ(map.empty(), false); + BMQTST_ASSERT_EQ(map.size(), 1u); map.erase(map.begin()); - ASSERT_EQ(map.empty(), true); - ASSERT_EQ(map.size(), 0u); + BMQTST_ASSERT_EQ(map.empty(), true); + BMQTST_ASSERT_EQ(map.size(), 0u); } static void test13_equality() diff --git a/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp b/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp index a2f97a630b..3c94d02ae7 100644 --- a/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp +++ b/src/groups/bmq/bmqeval/bmqeval_simpleevaluator.t.cpp @@ -91,7 +91,7 @@ static void testN1_SimpleEvaluator_GoogleBenchmark(benchmark::State& state) ASSERT(evaluator.compile("false || (i64_42==42 && s_foo==\"foo\")", compilationContext) == 0); - ASSERT_EQ(evaluator.evaluate(evaluationContext), true); + BMQTST_ASSERT_EQ(evaluator.evaluate(evaluationContext), true); //