[libcalamares] Apply coding style to remainder of geoip/

This commit is contained in:
Adriaan de Groot 2019-08-08 12:41:41 +02:00
parent 839e496fcb
commit 115f5bfd82

View File

@ -34,21 +34,16 @@ QTEST_GUILESS_MAIN( GeoIPTests )
using namespace CalamaresUtils::GeoIP; using namespace CalamaresUtils::GeoIP;
GeoIPTests::GeoIPTests() GeoIPTests::GeoIPTests() {}
{
}
GeoIPTests::~GeoIPTests() GeoIPTests::~GeoIPTests() {}
{
}
void void
GeoIPTests::initTestCase() GeoIPTests::initTestCase()
{ {
} }
static const char json_data_attribute[] = static const char json_data_attribute[] = "{\"time_zone\":\"Europe/Amsterdam\"}";
"{\"time_zone\":\"Europe/Amsterdam\"}";
void void
GeoIPTests::testJSON() GeoIPTests::testJSON()
@ -67,7 +62,8 @@ GeoIPTests::testJSON()
QCOMPARE( tz.first, QStringLiteral( "America" ) ); QCOMPARE( tz.first, QStringLiteral( "America" ) );
} }
void GeoIPTests::testJSONalt() void
GeoIPTests::testJSONalt()
{ {
GeoIPJSON handler( "zona_de_hora" ); GeoIPJSON handler( "zona_de_hora" );
@ -133,8 +129,8 @@ GeoIPTests::testXML()
void void
GeoIPTests::testXML2() GeoIPTests::testXML2()
{ {
static const char data[] = static const char data[]
"<Response><TimeZone>America/North Dakota/Beulah</TimeZone></Response>"; // With a space! = "<Response><TimeZone>America/North Dakota/Beulah</TimeZone></Response>"; // With a space!
#ifdef QT_XML_LIB #ifdef QT_XML_LIB
GeoIPXML handler; GeoIPXML handler;
@ -146,7 +142,8 @@ GeoIPTests::testXML2()
} }
void GeoIPTests::testXMLalt() void
GeoIPTests::testXMLalt()
{ {
#ifdef QT_XML_LIB #ifdef QT_XML_LIB
GeoIPXML handler( "ZT" ); GeoIPXML handler( "ZT" );
@ -173,7 +170,8 @@ GeoIPTests::testXMLbad()
#endif #endif
} }
void GeoIPTests::testSplitTZ() void
GeoIPTests::testSplitTZ()
{ {
using namespace CalamaresUtils::GeoIP; using namespace CalamaresUtils::GeoIP;
auto tz = splitTZString( QStringLiteral( "Moon/Dark_side" ) ); auto tz = splitTZString( QStringLiteral( "Moon/Dark_side" ) );
@ -227,7 +225,8 @@ synchronous_get( const char* urlstring )
QCOMPARE( default_tz, tz2 ); \ QCOMPARE( default_tz, tz2 ); \
} }
void GeoIPTests::testGet() void
GeoIPTests::testGet()
{ {
if ( !QProcessEnvironment::systemEnvironment().contains( QStringLiteral( "TEST_HTTP_GET" ) ) ) if ( !QProcessEnvironment::systemEnvironment().contains( QStringLiteral( "TEST_HTTP_GET" ) ) )
{ {