[libcalamares] Add TimeZone support to build
- Add to CMakeLists.txt - Test basic scenarios
This commit is contained in:
parent
3af2754022
commit
71f3614eb7
@ -34,6 +34,7 @@ set( libSources
|
||||
locale/Label.cpp
|
||||
locale/LabelModel.cpp
|
||||
locale/Lookup.cpp
|
||||
locale/TimeZone.cpp
|
||||
locale/TranslatableConfiguration.cpp
|
||||
|
||||
# Network service
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "Tests.h"
|
||||
|
||||
#include "locale/LabelModel.h"
|
||||
#include "locale/TimeZone.h"
|
||||
#include "locale/TranslatableConfiguration.h"
|
||||
|
||||
#include "CalamaresVersion.h"
|
||||
@ -199,3 +200,34 @@ LocaleTests::testTranslatableConfig2()
|
||||
QVERIFY( ts3.isEmpty() );
|
||||
QCOMPARE( ts3.count(), 1 ); // The empty string
|
||||
}
|
||||
|
||||
void
|
||||
LocaleTests::testSimpleZones()
|
||||
{
|
||||
using namespace CalamaresUtils::Locale;
|
||||
|
||||
{
|
||||
TZRegion r;
|
||||
QVERIFY( r.tr().isEmpty() );
|
||||
}
|
||||
{
|
||||
TZZone n;
|
||||
QVERIFY( n.tr().isEmpty() );
|
||||
}
|
||||
{
|
||||
TZRegion r0( "xAmsterdam" );
|
||||
QCOMPARE( r0.tr(), QStringLiteral( "xAmsterdam" ) );
|
||||
TZRegion r1( r0 );
|
||||
QCOMPARE( r0.tr(), QStringLiteral( "xAmsterdam" ) );
|
||||
QCOMPARE( r1.tr(), QStringLiteral( "xAmsterdam" ) );
|
||||
TZRegion r2( std::move( r0 ) );
|
||||
QCOMPARE( r2.tr(), QStringLiteral( "xAmsterdam" ) );
|
||||
QCOMPARE( r0.tr(), QString() );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LocaleTests::testComplexZones()
|
||||
{
|
||||
// Stub for now
|
||||
}
|
||||
|
@ -36,6 +36,10 @@ private Q_SLOTS:
|
||||
void testTranslatableLanguages();
|
||||
void testTranslatableConfig1();
|
||||
void testTranslatableConfig2();
|
||||
|
||||
// TimeZone testing
|
||||
void testSimpleZones();
|
||||
void testComplexZones();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user