Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126132

tst_QLocale is locale-dependent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.6, 6.8.0 FF
    • Core: Locales (i18n)
    • None
    • Linux/X11

    Description

      I get tst_QLocale failures on Ubuntu 20.04 in a locale which is mixing LANG=en with certain de LC_ subtypes:

      $ locale 
      LANG=en_US.UTF-8
      LANGUAGE=en_US:
      LC_CTYPE="en_US.UTF-8"
      LC_NUMERIC=de_DE.UTF-8
      LC_TIME=de_DE.UTF-8
      LC_COLLATE="en_US.UTF-8"
      LC_MONETARY=de_DE.UTF-8
      LC_MESSAGES="en_US.UTF-8"
      LC_PAPER=de_DE.UTF-8
      LC_NAME=de_DE.UTF-8
      LC_ADDRESS=de_DE.UTF-8
      LC_TELEPHONE=de_DE.UTF-8
      LC_MEASUREMENT=de_DE.UTF-8
      LC_IDENTIFICATION=de_DE.UTF-8
      LC_ALL=
      

      Which leads to this failure:

      1: FAIL!  : tst_QLocale::numberGrouping(en:1,234) Compared values are not the same
      1:    Actual   (sys.toString(number)): "1.234"
      1:    Expected (string)              : "1,234"
      1:    Loc: [/home/marc/Qt/qtbase-submit/tests/auto/corelib/text/qlocale/tst_qlocale.cpp(4411)]
      1: FAIL!  : tst_QLocale::numberGrouping(en:12,345) Compared values are not the same
      1:    Actual   (sys.toString(number)): "12.345"
      1:    Expected (string)              : "12,345"
      1:    Loc: [/home/marc/Qt/qtbase-submit/tests/auto/corelib/text/qlocale/tst_qlocale.cpp(4411)]
      1: FAIL!  : tst_QLocale::numberGrouping(en:123,456) Compared values are not the same
      1:    Actual   (sys.toString(number)): "123.456"
      1:    Expected (string)              : "123,456"
      1:    Loc: [/home/marc/Qt/qtbase-submit/tests/auto/corelib/text/qlocale/tst_qlocale.cpp(4411)]
      1: FAIL!  : tst_QLocale::numberGrouping(en:1,234,567) Compared values are not the same
      1:    Actual   (sys.toString(number)): "1.234.567"
      1:    Expected (string)              : "1,234,567"
      1:    Loc: [/home/marc/Qt/qtbase-submit/tests/auto/corelib/text/qlocale/tst_qlocale.cpp(4411)]
      1: FAIL!  : tst_QLocale::numberGrouping(en:12,345,678) Compared values are not the same
      1:    Actual   (sys.toString(number)): "12.345.678"
      1:    Expected (string)              : "12,345,678"
      1:    Loc: [/home/marc/Qt/qtbase-submit/tests/auto/corelib/text/qlocale/tst_qlocale.cpp(4411)]
      1: FAIL!  : tst_QLocale::numberGrouping(en:123,456,789) Compared values are not the same
      1:    Actual   (sys.toString(number)): "123.456.789"
      1:    Expected (string)              : "123,456,789"
      1:    Loc: [/home/marc/Qt/qtbase-submit/tests/auto/corelib/text/qlocale/tst_qlocale.cpp(4411)]
      1: FAIL!  : tst_QLocale::numberGrouping(en:1,234,567,890) Compared values are not the same
      1:    Actual   (sys.toString(number)): "1.234.567.890"
      1:    Expected (string)              : "1,234,567,890"
      1:    Loc: [/home/marc/Qt/qtbase-submit/tests/auto/corelib/text/qlocale/tst_qlocale.cpp(4411)]
      

      tst_QLocale should either be more careful with its assumptions or else sanitize the environment before running tests that assume certain properties of certain locales.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Eddy Edward Welbourne
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes