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

TestCase::compare doesn't print out dates' milliseconds

    XMLWordPrintable

Details

    • b66bc399aed8b307a27781c97585a09888d8692f

    Description

      which makes it difficult to see why a comparison of two dates fails when only their milliseconds differ:

      import QtQuick 2.0
      import QtTest 1.0
      
      TestCase {
          id: testcase
          name: "Test"
      
          function test_defaultConstructed() {
              var d1 = new Date(2000, 0, 1);
              var d2 = new Date(2000, 0, 1);
              d2.setHours(0, 0, 0, 1);
      
              print(d1, d2)
              compare(d1, d2)
          }
      }
      

      FAIL! : qtquickcontrols::Test::test_defaultConstructed() Compared values are not the same
      Actual (): Sat Jan 01 2000 00:00:00 GMT+0100 (CET)
      Expected (): Sat Jan 01 2000 00:00:00 GMT+0100 (CET)

      Attachments

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

        Activity

          People

            liaqi Liang Qi
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes