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

tst_QQuick3DNode::testProperties - comparing floats using the operator== fails on VxWorks on 32bit arm

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7
    • 6.7
    • Quick: 3D
    • None
    • VxWorks 7 23.09 on the BD-SL-i.MX6 board (32bit arm)
    • VxWorks
    • 030e9c966 (dev), a9baabc6f (6.7)

    Description

      When testing tst_QQuick3DNode::testProperties on VxWorks 7 23.09 on the BD-SL-i.MX6 board (32bit arm), the test fails with the following error:

      FAIL! : tst_QQuick3DNode::testProperties() Compared values are not the same
      Actual (rot) : QQuaternion(scalar:0.473868, vector:(0.431712, -0.481702, 0.597526))
      Expected (nodeItem.rotation()): QQuaternion(scalar:0.473868, vector:(0.431712, -0.481702, 0.597526))

       

      Even though the numbers appear to be the same, after analyzing the state, it turned out that there has been a loss of precission.
      The binary representations of the numbers differed:
      rot:
      x: 00111110110111010000100101010100
      y: 10111110111101101010000110101011
      z: 00111111000110001111011101110011
      nodeItem.rotation:
      x: 00111110110111010000100101010010
      y: 10111110111101101010000110101001
      z: 00111111000110001111011101110010

      Since floating point numbers should almost never be compared using the operator==
      the problem can be fixed by using qFuzzyCompare in the test.

      Attachments

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

        Activity

          People

            lukasz.matysiak Łukasz Matysiak
            lukasz.matysiak Łukasz Matysiak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes