test: add test cases

This commit is contained in:
Nick Peng
2023-03-26 00:27:40 +08:00
parent 56d711a796
commit c90a85dfc7
25 changed files with 1177 additions and 39 deletions

View File

@@ -173,6 +173,11 @@ int Client::GetAnswerNum()
return answer_num_;
}
int Client::GetAuthorityNum()
{
return authority_num_;
}
std::string Client::GetStatus()
{
return status_;
@@ -257,7 +262,7 @@ bool Client::ParserResult()
std::regex reg_authority_num(", AUTHORITY: ([0-9]+),");
if (std::regex_search(result_, match, reg_authority_num)) {
records_authority_num_ = std::stoi(match[1]);
authority_num_ = std::stoi(match[1]);
}
std::regex reg_status(", status: ([A-Z]+),");
@@ -313,7 +318,7 @@ bool Client::ParserResult()
return false;
}
if (records_authority_num_ != records_authority_.size()) {
if (authority_num_ != records_authority_.size()) {
std::cout << "DIG FAILED: Num Not Match\n" << result_ << std::endl;
return false;
}