[locale] Fix tests with spaces in zone names

- "North Dakota" -> "North_Dakota" following the change that fixes up
   dodgy names automatically.
main
Adriaan de Groot 7 years ago
parent b4e4b691fd
commit 5acf67a057

@ -127,14 +127,14 @@ void
GeoIPTests::testXML2() GeoIPTests::testXML2()
{ {
static const char data[] = static const char data[] =
"<Response><TimeZone>America/North Dakota/Beulah</TimeZone></Response>"; "<Response><TimeZone>America/North Dakota/Beulah</TimeZone></Response>"; // With a space!
#ifdef HAVE_XML #ifdef HAVE_XML
GeoIPXML handler; GeoIPXML handler;
auto tz = handler.processReply( data ); auto tz = handler.processReply( data );
QCOMPARE( tz.first, QLatin1String( "America" ) ); QCOMPARE( tz.first, QLatin1String( "America" ) );
QCOMPARE( tz.second, QLatin1String( "North Dakota/Beulah" ) ); QCOMPARE( tz.second, QLatin1String( "North_Dakota/Beulah" ) ); // Without space
#endif #endif
} }
@ -184,10 +184,10 @@ void GeoIPTests::testSplitTZ()
tz = GeoIP::splitTZString( QLatin1String("America.NewYork") ); tz = GeoIP::splitTZString( QLatin1String("America.NewYork") );
QCOMPARE( tz.first, QString() ); QCOMPARE( tz.first, QString() );
// Check that three-level is split properly // Check that three-level is split properly and space is replaced
tz = GeoIP::splitTZString( QLatin1String("America/North Dakota/Beulah") ); tz = GeoIP::splitTZString( QLatin1String("America/North Dakota/Beulah") );
QCOMPARE( tz.first, QLatin1String("America") ); QCOMPARE( tz.first, QLatin1String("America") );
QCOMPARE( tz.second, QLatin1String("North Dakota/Beulah") ); QCOMPARE( tz.second, QLatin1String("North_Dakota/Beulah") );
} }

Loading…
Cancel
Save