8 #include <gtest/gtest.h>
12 using namespace HCE::sphinx;
13 using namespace HCE::sphinx::reduce_task;
26 AttrInfo pAttrInfo(
"first",
"value");
27 matchInfo1.addAttrInfo(pAttrInfo);
28 matchInfo2.addAttrInfo(pAttrInfo);
29 matchInfo3.addAttrInfo(pAttrInfo);
30 matchInfo4.addAttrInfo(pAttrInfo);
31 matchInfo5.addAttrInfo(pAttrInfo);
33 sphinxRequestInfo.setMaxResultsNumber(3);
37 sphinxResultData->addMatchInfo(matchInfo1);
38 sphinxResultData->addMatchInfo(matchInfo2);
39 sphinxResultData->addMatchInfo(matchInfo5);
40 sphinxResultData->addMatchInfo(matchInfo3);
41 sphinxResultData->addMatchInfo(matchInfo4);
43 expectSphinxResultData.addMatchInfo(matchInfo5);
44 expectSphinxResultData.addMatchInfo(matchInfo2);
45 expectSphinxResultData.addMatchInfo(matchInfo3);
63 sphinxResultData->addRequestInfo(sphinxRequestInfo);
64 expectSphinxResultData.addRequestInfo(sphinxRequestInfo);
66 SharedPtr<SphinxResultData> trancatedResult = sphinxResultTrancater.
trancate(sphinxResultData);
76 sphinxRequestInfo.setMaxResultsNumber(10);
77 sphinxResultData->addRequestInfo(sphinxRequestInfo);
79 SharedPtr<SphinxResultData> trancatedResult = sphinxResultTrancater.
trancate(sphinxResultData);
82 *sphinxResultData.get()));
90 sphinxRequestInfo.setMaxResultsNumber(5);
91 sphinxResultData->addRequestInfo(sphinxRequestInfo);
93 SharedPtr<SphinxResultData> trancatedResult = sphinxResultTrancater.
trancate(sphinxResultData);
96 *sphinxResultData.get()));