Move gtest's printer for CString to a place visible to all tests

This commit is contained in:
Alexey Sokolov
2018-04-02 12:16:36 +01:00
parent 10c98e01a8
commit 1e08e5c702
2 changed files with 7 additions and 5 deletions
+7
View File
@@ -697,4 +697,11 @@ class CInlineFormatMessage {
CString m_sFormat;
};
// For gtest
#ifdef GTEST_FAIL
inline void PrintTo(const CString& s, std::ostream* os) {
*os << '"' << s.Escape_n(CString::EDEBUG) << '"';
}
#endif
#endif // !ZNCSTRING_H
-5
View File
@@ -17,11 +17,6 @@
#include <gtest/gtest.h>
#include <znc/ZNCString.h>
// GTest uses this function to output objects
static void PrintTo(const CString& s, std::ostream* o) {
*o << '"' << s.Escape_n(CString::EASCII, CString::EDEBUG) << '"';
}
class EscapeTest : public ::testing::Test {
protected:
void testEncode(const CString& in, const CString& expectedOut,