Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21782

Test results pane does not support UTF-8

    XMLWordPrintable

    Details

    • Commits:
      5ed848fd8f56e714d4c318dcb3f50ffd664dee15 (qt-creator/qt-creator/4.8)

      Description

      Here's the test with some cyrillic symbols

      TEST(SomeTestCase, testUtf8) {
          EXPECT_EQ(QString("Привет"), QString("Приве"));
      }
      

      And on test fail in the results pane I'm getting this

      [==========] Running 1 test from 1 test case.
      [----------] Global test environment set-up.
      [----------] 1 test from SomeTestCase
      [ RUN      ] SomeTestCase.testUtf8
      ../src/dialog/tests/tst_plugin.cpp:55: Failure
      Expected equality of these values:
        QString("Привет")
          Which is: "Привет"
        QString("Приве")
          Which is: "Приве"
      [  FAILED  ] SomeTestCase.testUtf8 (0 ms)
      [----------] 1 test from SomeTestCase (0 ms total)
      
      
      [----------] Global test environment tear-down
      [==========] 1 test from 1 test case ran. (0 ms total)
      [  PASSED  ] 0 tests.
      [  FAILED  ] 1 test, listed below:
      [  FAILED  ] SomeTestCase.testUtf8
      

      I think the reason for that is this code

      void TestResultsPane::addOutput(const QByteArray &output) { 
          m_textOutput->appendPlainText(QString::fromLatin1(TestOutputReader::chopLineBreak(output)));
      }
      

      Is this just a bug or it's intentional?

        Attachments

        For Gerrit Dashboard: QTCREATORBUG-21782
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            aha_1980 André Hartmann
            Reporter:
            ivan_safonov Ivan Safonov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes