test: add some test and fix some bugs

This commit is contained in:
Nick Peng
2023-03-15 23:57:25 +08:00
parent a14d4a0451
commit 2e3e03bfda
9 changed files with 272 additions and 89 deletions

View File

@@ -110,6 +110,8 @@ Client::Client() {}
bool Client::Query(const std::string &dig_cmds, int port, const std::string &ip)
{
Clear();
std::string cmd = "dig ";
if (port > 0) {
cmd += "-p " + std::to_string(port);
@@ -140,6 +142,7 @@ bool Client::Query(const std::string &dig_cmds, int port, const std::string &ip)
if (ParserResult() == false) {
Clear();
return false;
}
return true;