Suppress all -Wmissing-field-initializers in the test suite
There were many dozens of such warnings given for the various arrays used in the tests and it just doesn't seem feasible nor desirable to fix them all, so just suppress the warnings for all these arrays to get rid of them with recent (7+?) versions of gcc.
This commit is contained in:
@@ -699,6 +699,8 @@ void DateTimeTestCase::TestTimeFormat()
|
||||
3*3600 + 30*60
|
||||
};
|
||||
|
||||
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
|
||||
|
||||
static const Date formatTestDates[] =
|
||||
{
|
||||
{ 29, wxDateTime::May, 1976, 18, 30, 00, 0.0, wxDateTime::Inv_WeekDay },
|
||||
@@ -717,6 +719,8 @@ void DateTimeTestCase::TestTimeFormat()
|
||||
#endif
|
||||
};
|
||||
|
||||
wxGCC_WARNING_RESTORE(missing-field-initializers)
|
||||
|
||||
for ( unsigned idxtz = 0; idxtz < WXSIZEOF(timeZonesOffsets); ++idxtz )
|
||||
{
|
||||
wxDateTime::TimeZone tz(timeZonesOffsets[idxtz]);
|
||||
@@ -917,6 +921,8 @@ void DateTimeTestCase::TestTimeParse()
|
||||
|
||||
void DateTimeTestCase::TestTimeZoneParse()
|
||||
{
|
||||
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
|
||||
|
||||
static const struct
|
||||
{
|
||||
const char *str;
|
||||
@@ -964,6 +970,8 @@ void DateTimeTestCase::TestTimeZoneParse()
|
||||
{ "17:37+04:0" },
|
||||
};
|
||||
|
||||
wxGCC_WARNING_RESTORE(missing-field-initializers)
|
||||
|
||||
for ( size_t n = 0; n < WXSIZEOF(parseTestTimeZones); ++n )
|
||||
{
|
||||
wxDateTime dt;
|
||||
@@ -986,6 +994,8 @@ void DateTimeTestCase::TestTimeZoneParse()
|
||||
|
||||
void DateTimeTestCase::TestTimeSpanFormat()
|
||||
{
|
||||
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
|
||||
|
||||
static const struct TimeSpanFormatTestData
|
||||
{
|
||||
long h, min, sec, msec;
|
||||
@@ -1009,6 +1019,8 @@ void DateTimeTestCase::TestTimeSpanFormat()
|
||||
{ 0, 0, -1, 0, "%H:%M:%S", "-00:00:01" },
|
||||
};
|
||||
|
||||
wxGCC_WARNING_RESTORE(missing-field-initializers)
|
||||
|
||||
for ( size_t n = 0; n < WXSIZEOF(testSpans); n++ )
|
||||
{
|
||||
const TimeSpanFormatTestData& td = testSpans[n];
|
||||
@@ -1037,6 +1049,8 @@ void DateTimeTestCase::TestTimeTicks()
|
||||
// test parsing dates in RFC822 format
|
||||
void DateTimeTestCase::TestParseRFC822()
|
||||
{
|
||||
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
|
||||
|
||||
static const struct ParseTestData
|
||||
{
|
||||
const char *rfc822;
|
||||
@@ -1081,6 +1095,8 @@ void DateTimeTestCase::TestParseRFC822()
|
||||
},
|
||||
};
|
||||
|
||||
wxGCC_WARNING_RESTORE(missing-field-initializers)
|
||||
|
||||
for ( unsigned n = 0; n < WXSIZEOF(parseTestDates); n++ )
|
||||
{
|
||||
const char * const datestr = parseTestDates[n].rfc822;
|
||||
@@ -1109,6 +1125,8 @@ void DateTimeTestCase::TestParseRFC822()
|
||||
// test parsing dates in free format
|
||||
void DateTimeTestCase::TestDateParse()
|
||||
{
|
||||
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
|
||||
|
||||
static const struct ParseTestData
|
||||
{
|
||||
const char *str;
|
||||
@@ -1129,6 +1147,8 @@ void DateTimeTestCase::TestDateParse()
|
||||
{ "2 . . " },
|
||||
};
|
||||
|
||||
wxGCC_WARNING_RESTORE(missing-field-initializers)
|
||||
|
||||
// special cases
|
||||
wxDateTime dt;
|
||||
CPPUNIT_ASSERT( dt.ParseDate(wxT("today")) );
|
||||
@@ -1164,6 +1184,8 @@ void DateTimeTestCase::TestDateParse()
|
||||
|
||||
void DateTimeTestCase::TestDateParseISO()
|
||||
{
|
||||
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
|
||||
|
||||
static const struct
|
||||
{
|
||||
const char *str;
|
||||
@@ -1199,6 +1221,8 @@ void DateTimeTestCase::TestDateParseISO()
|
||||
{ "" },
|
||||
};
|
||||
|
||||
wxGCC_WARNING_RESTORE(missing-field-initializers)
|
||||
|
||||
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
|
||||
{
|
||||
wxDateTime dt;
|
||||
@@ -1238,6 +1262,8 @@ void DateTimeTestCase::TestDateParseISO()
|
||||
|
||||
void DateTimeTestCase::TestDateTimeParse()
|
||||
{
|
||||
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
|
||||
|
||||
static const struct ParseTestData
|
||||
{
|
||||
const char *str;
|
||||
@@ -1270,6 +1296,8 @@ void DateTimeTestCase::TestDateTimeParse()
|
||||
},
|
||||
};
|
||||
|
||||
wxGCC_WARNING_RESTORE(missing-field-initializers)
|
||||
|
||||
// the test strings here use "PM" which is not available in all locales so
|
||||
// we need to use "C" locale for them
|
||||
CLocaleSetter cloc;
|
||||
|
Reference in New Issue
Block a user