Suppress some harmless clang warnings in the test suite
Use wxCLANG_WARNING_SUPPRESS() to avoid multiple warnings in CATCH headers as well as in some of our own tests.
This commit is contained in:
@@ -364,12 +364,18 @@ void ArraysTestCase::wxStringArrayTest()
|
|||||||
a6.Add("Foo");
|
a6.Add("Foo");
|
||||||
a6.Insert(a6[0], 1, 100);
|
a6.Insert(a6[0], 1, 100);
|
||||||
|
|
||||||
|
// The whole point of this code is to test self-assignment, so suppress
|
||||||
|
// clang warning about it.
|
||||||
|
wxCLANG_WARNING_SUPPRESS(self-assign-overloaded)
|
||||||
|
|
||||||
wxArrayString a7;
|
wxArrayString a7;
|
||||||
a7 = a7;
|
a7 = a7;
|
||||||
CPPUNIT_ASSERT_EQUAL( 0, a7.size() );
|
CPPUNIT_ASSERT_EQUAL( 0, a7.size() );
|
||||||
a7.Add("Bar");
|
a7.Add("Bar");
|
||||||
a7 = a7;
|
a7 = a7;
|
||||||
CPPUNIT_ASSERT_EQUAL( 1, a7.size() );
|
CPPUNIT_ASSERT_EQUAL( 1, a7.size() );
|
||||||
|
|
||||||
|
wxCLANG_WARNING_RESTORE(self-assign-overloaded)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArraysTestCase::SortedArray()
|
void ArraysTestCase::SortedArray()
|
||||||
|
@@ -135,7 +135,9 @@ void VarArgTestCase::CharPrintf()
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable:4309) // truncation of constant value
|
#pragma warning(disable:4309) // truncation of constant value
|
||||||
#endif
|
#endif
|
||||||
|
wxCLANG_WARNING_SUPPRESS(constant-conversion)
|
||||||
c = 240;
|
c = 240;
|
||||||
|
wxCLANG_WARNING_RESTORE(constant-conversion)
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(default:4309)
|
#pragma warning(default:4309)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
// Suppress some warnings in catch_impl.hpp.
|
// Suppress some warnings in catch_impl.hpp.
|
||||||
wxCLANG_WARNING_SUPPRESS(missing-braces)
|
wxCLANG_WARNING_SUPPRESS(missing-braces)
|
||||||
wxCLANG_WARNING_SUPPRESS(logical-op-parentheses)
|
wxCLANG_WARNING_SUPPRESS(logical-op-parentheses)
|
||||||
|
wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override)
|
||||||
|
|
||||||
// This file needs to get the CATCH definitions in addition to the usual
|
// This file needs to get the CATCH definitions in addition to the usual
|
||||||
// assertion macros declarations from catch.hpp included by testprec.h.
|
// assertion macros declarations from catch.hpp included by testprec.h.
|
||||||
@@ -30,6 +31,7 @@ wxCLANG_WARNING_SUPPRESS(logical-op-parentheses)
|
|||||||
|
|
||||||
wxCLANG_WARNING_RESTORE(missing-braces)
|
wxCLANG_WARNING_RESTORE(missing-braces)
|
||||||
wxCLANG_WARNING_RESTORE(logical-op-parentheses)
|
wxCLANG_WARNING_RESTORE(logical-op-parentheses)
|
||||||
|
wxCLANG_WARNING_RESTORE(inconsistent-missing-override)
|
||||||
|
|
||||||
// This probably could be done by predefining CLARA_CONFIG_MAIN, but at the
|
// This probably could be done by predefining CLARA_CONFIG_MAIN, but at the
|
||||||
// point where we are, just define this global variable manually.
|
// point where we are, just define this global variable manually.
|
||||||
|
@@ -123,7 +123,9 @@ void URLTestCase::CopyAndAssignment()
|
|||||||
CPPUNIT_ASSERT(url1 == url2);
|
CPPUNIT_ASSERT(url1 == url2);
|
||||||
|
|
||||||
// assignment to self
|
// assignment to self
|
||||||
|
wxCLANG_WARNING_SUPPRESS(self-assign-overloaded)
|
||||||
url2 = url2;
|
url2 = url2;
|
||||||
|
wxCLANG_WARNING_RESTORE(self-assign-overloaded)
|
||||||
|
|
||||||
// check for destructor (with base pointer!)
|
// check for destructor (with base pointer!)
|
||||||
puri = new wxURL();
|
puri = new wxURL();
|
||||||
|
@@ -133,7 +133,9 @@ void WeakRefTestCase::DeclareTest()
|
|||||||
wxWeakRef<IncompleteClass> p;
|
wxWeakRef<IncompleteClass> p;
|
||||||
|
|
||||||
// Copying should be also OK
|
// Copying should be also OK
|
||||||
|
wxCLANG_WARNING_SUPPRESS(self-assign-overloaded)
|
||||||
p = p;
|
p = p;
|
||||||
|
wxCLANG_WARNING_RESTORE(self-assign-overloaded)
|
||||||
|
|
||||||
// Assigning a raw pointer should cause compile error
|
// Assigning a raw pointer should cause compile error
|
||||||
#ifdef TEST_INVALID_INCOMPLETE_WEAKREF
|
#ifdef TEST_INVALID_INCOMPLETE_WEAKREF
|
||||||
|
Reference in New Issue
Block a user