build: bug fixes for release version

* fixed search activating 2 nodes, because of NodeType in query
* fixed search results didn't contain results with same name
* added protected contents to sample and tictactoe code
* fixed CxxParserTests not logging errors, disabled logging for tests with errors
* fixed CxxParserTests not finding system headers, added TestSettings.xml and pass headers to Parser::parseFile()
This commit is contained in:
Eberhard Graether
2015-03-11 13:14:22 +01:00
parent 5a259ed7c7
commit ca85d5a5d3
14 changed files with 121 additions and 67 deletions
+2 -5
View File
@@ -61,7 +61,6 @@ std::string SearchMatch::encodeForQuery() const
{
std::stringstream ss;
ss << QueryToken::BOUNDARY << fullName;
ss << QueryToken::DELIMITER << nodeType;
for (Id tokenId : tokenIds)
{
ss << QueryToken::DELIMITER << tokenId;
@@ -103,17 +102,15 @@ void SearchMatch::decodeFromQuery(std::string query)
fullName = queryParts[0];
if(queryParts.size() > 1)
if (queryParts.size() > 1)
{
for(int i = 2; i < queryParts.size(); ++i)
for (size_t i = 2; i < queryParts.size(); ++i)
{
tokenIds.insert(std::strtoul(queryParts[i].c_str(),nullptr,0));
}
}
}
std::deque<SearchMatch> SearchMatch::stringDequeToSearchMatchDeque(const std::deque<std::string>& stringDeque)
{
std::deque<SearchMatch> matchDeque;
+8 -1
View File
@@ -23,5 +23,12 @@ bool SearchResult::operator()(const SearchResult& lhs, const SearchResult& rhs)
return lhs.weight > rhs.weight;
}
return utility::toLowerCase(lhs.node->getFullName()) < utility::toLowerCase(rhs.node->getFullName());
std::string lhsLow = utility::toLowerCase(lhs.node->getFullName());
std::string rhsLow = utility::toLowerCase(rhs.node->getFullName());
if (lhsLow != rhsLow)
{
return lhsLow < rhsLow;
}
return lhs.node->getFirstTokenId() < rhs.node->getFirstTokenId();
}