filemetadatawidgettest: Enforce en_US locale
ClosedPublic

Authored by michaelh on Mar 11 2018, 5:23 PM.

Details

Test Plan

$ make test
$ LC_ALL=C make test
$ LC_ALL=de_DE.UTF-8 make test

Diff Detail

Repository
R824 Baloo Widgets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
michaelh created this revision.Mar 11 2018, 5:23 PM
Restricted Application added a project: Baloo. · View Herald TranscriptMar 11 2018, 5:23 PM
michaelh requested review of this revision.Mar 11 2018, 5:23 PM

Do you know why qputenv() doesn't work?

autotests/filemetadatawidgettest.cpp
41–44

Why both? QLocale::setDefault() seems to be enough here.

199–203

This looks unrelated from the locale stuff? If yes please do it in another commit.

michaelh updated this revision to Diff 29274.Mar 11 2018, 8:14 PM
  • Remove unrelated stuff

Do you know why qputenv() doesn't work?

Not at all. I'm totally confused by this. qputenv() does work in other repos but not in this one. (????)

michaelh updated this revision to Diff 29276.Mar 11 2018, 8:18 PM
  • Remove blank line
michaelh edited the summary of this revision. (Show Details)Mar 11 2018, 10:10 PM

Do you know why qputenv() doesn't work?

Not at all. I'm totally confused by this. qputenv() does work in other repos but not in this one. (????)

Ok, I tried to move qputenv() in initLocale() and that worked (indeed, qputenv() internally calls setenv()).
So it seems that we just need to call it before main().

What are these other repositories you are talking about? I did a quick check in kdirmodeltest.cpp from kio and that looks equally broken.

What are these other repositories you are talking about? I did a quick check in kdirmodeltest.cpp from kio and that looks equally broken.

kio/autotests/favicontest.cpp

$ ctest -V -R icon
$ LC_ALL=C ctest -V -R icon
$ LC_ALL=de_DE.UTF-8 ctest -V -R icon

all pass

Many KIO tests also fail for me unless I explicitly set a locale. Can we have a more generic solution for that in e.g. ecm or so?

michaelh updated this revision to Diff 29833.Mar 18 2018, 12:45 PM
  • Clean up whitespace

I still don't understand what's the difference between this test and the kio ones, but this fixes the problem so I'd say let's go with it for now.

This revision is now accepted and ready to land.Mar 18 2018, 7:04 PM
This revision was automatically updated to reflect the committed changes.