[PATCH 02/23] kcalendartest: Clean up configuration before running a configuration-dependent test.

David Faure faure at kde.org
Fri Oct 12 15:59:17 UTC 2012


On Friday 12 October 2012 17:13:37 Jon Severinsson wrote:
> These tests will otherwise fail if testEra() failed last time it ran...
> ---
>  kdecore/tests/kcalendartest.cpp |    8 ++++++++
>  1 fil ändrad, 8 tillägg(+)
> 
> diff --git a/kdecore/tests/kcalendartest.cpp
> b/kdecore/tests/kcalendartest.cpp index 9ca5ed4..397166a 100644
> --- a/kdecore/tests/kcalendartest.cpp
> +++ b/kdecore/tests/kcalendartest.cpp
> @@ -202,6 +202,10 @@ void KCalendarTest::testTypes()
> 
>  void KCalendarTest::testFormatDate()
>  {
> +    KConfigGroup lcg(KSharedConfig::openConfig(), QString("Locale"));
> +    KConfigGroup cg = lcg.group(QString("KCalendarSystem
> %1").arg("gregorian")); +    cg.deleteGroup();

This could also be done in a cleanup() method (which gets automatically called 
by qtestlib after every test method). Your choice (it means running this code 
a lot more often, on the downside).

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list