Fix CircleCI build, more coverity fixes.

This commit is contained in:
2023-10-19 22:57:55 -07:00
parent a5bb31943c
commit 2a23d2e204
9 changed files with 42 additions and 24 deletions

View File

@@ -80,6 +80,17 @@ TestSplit(std::string line, std::string delim, size_t maxCount, std::vector<std:
}
bool
TestSplitChar()
{
auto expected = std::vector<std::string>{"hello", "world"};
const auto *inputLine = "hello=world\n";
auto actual = U::S::SplitKeyValuePair(inputLine, '=');
return actual == expected;
}
bool
TestWrapping()
{
@@ -115,7 +126,7 @@ TestWrapping()
return false;
}
U::S::WriteTabIndented(std::cout, wrapped, 4, true);
// U::S::WriteTabIndented(std::cout, wrapped, 4, true);
return true;
}
@@ -142,6 +153,7 @@ main()
suite.AddTest("SplitN(0) with empty element",
TestSplit("abc::def:ghi", ":", 0,
std::vector<std::string>{"abc", "", "def", "ghi"}));
suite.AddTest("TestSplitKV(char)", TestSplitChar);
suite.AddTest("TextWrapping", TestWrapping);
auto result = suite.Run();
std::cout << suite.GetReport() << "\n";