QML compare() does not reliably compare colours
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qtdeclarative-opensource-src (Ubuntu) |
Fix Released
|
Undecided
|
Timo Jyrinki |
Bug Description
See upstream bug https:/
There is already a fix upstream which has been merged to Qt5.8 ( see https:/
Without that fix, all the unit tests relying on compare() to compare colours must be considered unreliable and potentially misleading, as they could be producing PASSes instead of FAILs.
Bug description copied from that link:
"QtTest's compare() function considers two colors (the QML basic type) as equal when they aren't.
I am aware that Qt.colorEqual exists (and it works correctly), but I think that this makes it far too easy to write tests that don't catch an error.
Consider the following test case:
import QtQuick 2.2
import QtTest 1.0
Item {
Rectangle {
id: black
color: "#000000"
}
Rectangle {
id: white
color: "#ffffff"
}
TestCase {
name: "ColorComparison"
function test_this_
}
function test_this_is_ok() {
}
}
}"
Changed in qtdeclarative-opensource-src (Ubuntu): | |
assignee: | nobody → Timo Jyrinki (timo-jyrinki) |
Changed in qtdeclarative-opensource-src (Ubuntu): | |
status: | Confirmed → In Progress |
Status changed to 'Confirmed' because the bug affects multiple users.