Suppress harmless warnings about string literals in test code
We rely on string literals being of non-const char or wchar_t pointer type for this code to compile, even if this results in warnings, so we're not interested in these warnings in the test code itself.
This commit is contained in:
@@ -101,9 +101,16 @@ void VarArgTestCase::StringPrintf()
|
||||
CPPUNIT_ASSERT( s2 == "value=FooBar;" );
|
||||
|
||||
// this tests correct passing of wxCStrData constructed from string
|
||||
// literal:
|
||||
// literal (and we disable the warnings related to the use of a literal
|
||||
// here because we want to test that this compiles, even with warnings):
|
||||
wxGCC_WARNING_SUPPRESS(write-strings)
|
||||
wxCLANG_WARNING_SUPPRESS(c++11-compat-deprecated-writable-strings)
|
||||
|
||||
bool cond = true;
|
||||
s2.Printf(wxT("foo %s"), !cond ? s.c_str() : wxT("bar"));
|
||||
|
||||
wxGCC_WARNING_RESTORE(write-strings)
|
||||
wxCLANG_WARNING_RESTORE(c++11-compat-deprecated-writable-strings)
|
||||
}
|
||||
|
||||
void VarArgTestCase::CharPrintf()
|
||||
|
Reference in New Issue
Block a user