From 0969987c91e6343ae16f4f2307f196e75d54b4a9 Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Tue, 12 Mar 2024 13:08:08 +0400 Subject: [PATCH] [bookmarks] [tests] replace 'GetUnsortedBmGroupsIdList.count' with 'GetBmGroupsCount' Signed-off-by: Kiryl Kaveryn --- map/map_tests/bookmarks_test.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/map/map_tests/bookmarks_test.cpp b/map/map_tests/bookmarks_test.cpp index 300e7c5293..747e66d858 100644 --- a/map/map_tests/bookmarks_test.cpp +++ b/map/map_tests/bookmarks_test.cpp @@ -202,7 +202,7 @@ UNIT_CLASS_TEST(Runner, Bookmarks_ImportKML) LoadKmlData(MemReader(kmlString, strlen(kmlString)), KmlFileType::Text)); TEST(kmlDataCollection.back().second, ()); bmManager.CreateCategories(std::move(kmlDataCollection)); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 1, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 1, ()); auto const groupId = bmManager.GetUnsortedBmGroupsIdList().front(); CheckBookmarks(bmManager, groupId); @@ -228,7 +228,7 @@ UNIT_CLASS_TEST(Runner, Bookmarks_ExportKML) kmlDataCollection1.emplace_back("", LoadKmlData(MemReader(kmlString, strlen(kmlString)), KmlFileType::Text)); bmManager.CreateCategories(std::move(kmlDataCollection1)); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 1, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 1, ()); auto const groupId1 = bmManager.GetUnsortedBmGroupsIdList().front(); CheckBookmarks(bmManager, groupId1); @@ -249,14 +249,14 @@ UNIT_CLASS_TEST(Runner, Bookmarks_ExportKML) bmManager.GetEditSession().DeleteBmCategory(groupId1); TEST_EQUAL(bmManager.HasBmCategory(groupId1), false, ()); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 0, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 0, ()); BookmarkManager::KMLDataCollection kmlDataCollection2; kmlDataCollection2.emplace_back("", LoadKmlData(FileReader(fileName), GetActiveKmlFileType())); TEST(kmlDataCollection2.back().second, ()); bmManager.CreateCategories(std::move(kmlDataCollection2)); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 1, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 1, ()); auto const groupId2 = bmManager.GetUnsortedBmGroupsIdList().front(); CheckBookmarks(bmManager, groupId2); @@ -270,7 +270,7 @@ UNIT_CLASS_TEST(Runner, Bookmarks_ExportKML) TEST(kmlDataCollection3.back().second, ()); bmManager.CreateCategories(std::move(kmlDataCollection3), true /* autoSave */); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 1, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 1, ()); auto const groupId3 = bmManager.GetUnsortedBmGroupsIdList().front(); CheckBookmarks(bmManager, groupId3); @@ -407,7 +407,7 @@ UNIT_TEST(Bookmarks_Getting) TEST_NOT_EQUAL(pBm1->GetGroupId(), pBm3->GetGroupId(), ()); TEST_NOT_EQUAL(pBm1->GetGroupId(), pBm3->GetGroupId(), ()); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 3, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 3, ()); TEST(IsValidBookmark(fm, m2::PointD(40, 20)), ()); Bookmark const * mark = GetBookmark(fm, m2::PointD(40, 20)); @@ -564,7 +564,7 @@ UNIT_TEST(Bookmarks_AddingMoving) bm3.m_color.m_predefinedColor = kml::PredefinedColor::Green; auto const * pBm2 = bmManager.GetEditSession().CreateBookmark(std::move(bm3), cat2); TEST_NOT_EQUAL(pBm1->GetGroupId(), pBm2->GetGroupId(), ()); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 2, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 2, ()); mark = GetBookmarkPxPoint(fm, pixelPoint); TEST_EQUAL(bmManager.GetCategoryName(mark->GetGroupId()), "cat1", ()); TEST_EQUAL(bmManager.GetUserMarkIds(cat1).size(), 2, @@ -1066,7 +1066,7 @@ UNIT_CLASS_TEST(Runner, Bookmarks_SpecialXMLNames) bmManager.UpdateLastModifiedTime(kmlDataCollection3); bmManager.CreateCategories(std::move(kmlDataCollection3)); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 2, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 2, ()); auto const catId2 = bmManager.GetUnsortedBmGroupsIdList().back(); auto const catId3 = bmManager.GetUnsortedBmGroupsIdList().front(); @@ -1095,7 +1095,7 @@ UNIT_CLASS_TEST(Runner, TrackParsingTest_1) TEST(kmlDataCollection.back().second, ("KML can't be loaded")); bmManager.CreateCategories(std::move(kmlDataCollection)); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 1, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 1, ()); auto catId = bmManager.GetUnsortedBmGroupsIdList().front(); TEST_EQUAL(bmManager.GetTrackIds(catId).size(), 4, ()); @@ -1150,7 +1150,7 @@ UNIT_CLASS_TEST(Runner, TrackParsingTest_2) TEST(kmlDataCollection.back().second, ("KML can't be loaded")); bmManager.CreateCategories(std::move(kmlDataCollection)); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 1, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 1, ()); auto catId = bmManager.GetUnsortedBmGroupsIdList().front(); TEST_EQUAL(bmManager.GetTrackIds(catId).size(), 1, ()); @@ -1403,7 +1403,7 @@ UNIT_CLASS_TEST(Runner, ExportAll) kmlDataCollection.emplace_back(file, LoadKmlFile(file, KmlFileType::Gpx)); bmManager.CreateCategories(std::move(kmlDataCollection)); - TEST_EQUAL(bmManager.GetUnsortedBmGroupsIdList().size(), 4, ()); + TEST_EQUAL(bmManager.GetBmGroupsCount(), 4, ()); auto categories = bmManager.GetUnsortedBmGroupsIdList(); auto checker = [](BookmarkManager::SharingResult const & result)