fixed bug in SPDLOG_TRACE_IF macro and added some related tests

This commit is contained in:
gabime
2017-10-13 02:04:31 +03:00
parent 4a159ad66d
commit 21ed31844c
7 changed files with 61 additions and 2 deletions

View File

@@ -46,3 +46,11 @@ std::size_t get_filesize(const std::string& filename)
return static_cast<std::size_t>(ifs.tellg());
}
// source: https://stackoverflow.com/a/2072890/192001
bool ends_with(std::string const & value, std::string const & ending)
{
if (ending.size() > value.size()) return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}