From 028d424c73bbe129128b5314a83698bb076b70d7 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 8 Aug 2020 23:40:13 +1000 Subject: [PATCH] [libcalamares] Expand testing of TZ location lookup - Cape Town is in South Africa, so one might expect it to get South Africa's timezone -- which is Africa/Johannesburg -- but Windhoek is closer, so it gets that. - Port Elisabeth is similar: Maseru lies between it an Johannesburg, so it gets the wrong timezone, too. These both illustrate how the limited resolution of the map, together with the "closest location" lookup, can give poor results. For most of South Africa, the "wrong" timezone is closer than the right one. --- src/libcalamares/locale/Tests.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcalamares/locale/Tests.cpp b/src/libcalamares/locale/Tests.cpp index d73331d44..d9bfb9133 100644 --- a/src/libcalamares/locale/Tests.cpp +++ b/src/libcalamares/locale/Tests.cpp @@ -402,6 +402,11 @@ LocaleTests::testLocationLookup_data() QTest::newRow( "Tarawa E" ) << 0.0 << 179.0 << QString( "Tarawa" ); QTest::newRow( "Tarawa W" ) << 0.0 << -179.0 << QString( "Tarawa" ); + QTest::newRow( "Johannesburg" ) << -26.0 << 28.0 << QString( "Johannesburg" ); // South Africa + QTest::newRow( "Maseru" ) << -29.0 << 27.0 << QString( "Maseru" ); // Lesotho + QTest::newRow( "Windhoek" ) << -22.0 << 17.0 << QString( "Windhoek" ); // Namibia + QTest::newRow( "Port Elisabeth" ) << -33.0 << 25.0 << QString( "Johannesburg" ); // South Africa + QTest::newRow( "Cape Town" ) << -33.0 << 18.0 << QString( "Johannesburg" ); // South Africa } void