Skip to content

Commit

Permalink
[search_tests] Fix bad m_resultType.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana-yan authored and mpimenov committed Mar 11, 2021
1 parent 9ab88d2 commit c284e16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions search/ranking_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ double RankingInfo::GetLinearModelRank() const
result += m_falseCats * kFalseCats;
result += kType[m_type];
if (Model::IsPoi(m_type))
{
CHECK_NOT_EQUAL(m_resultType, ResultType::Count, ());
result += kResultType[base::Underlying(m_resultType)];
}
result += (m_allTokensUsed ? 1 : 0) * kAllTokensUsed;
result += (m_exactCountryOrCapital ? 1 : 0) * kExactCountryOrCapital;
auto const nameRank = kNameScore[nameScore] + kErrorsMade * GetErrorsMadePerToken() +
Expand Down
1 change: 1 addition & 0 deletions search/search_tests/ranking_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ UNIT_TEST(PreferCountry)
cafe.m_tokenRanges[Model::TYPE_SUBPOI] = TokenRange(0, 1);
cafe.m_exactCountryOrCapital = false;
cafe.m_type = Model::TYPE_SUBPOI;
cafe.m_resultType = ResultType::Eat;

auto country = info;
country.m_distanceToPivot = 1e6;
Expand Down

0 comments on commit c284e16

Please sign in to comment.