lib/utils: Update

This commit is contained in:
Dirk-Jan C. Binnema
2020-01-05 01:15:07 +02:00
parent 5a56a2930c
commit f4874cd7e1
7 changed files with 187 additions and 80 deletions

View File

@ -443,3 +443,30 @@ Mu::size_to_string (const std::string& val, bool is_first)
return str;
}
void
Mu::assert_equal(const std::string& s1, const std::string& s2)
{
g_assert_cmpstr (s1.c_str(), ==, s2.c_str());
}
void
Mu::assert_equal (const Mu::StringVec& v1, const Mu::StringVec& v2)
{
g_assert_cmpuint(v1.size(), ==, v2.size());
for (auto i = 0U; i != v1.size(); ++i)
assert_equal(v1[i], v2[i]);
}
void
Mu::allow_warnings()
{
g_test_log_set_fatal_handler(
[](const char*, GLogLevelFlags, const char*, gpointer) {
return FALSE;
},{});
}