Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
c988a8a28214914d20f4b8858e7f314a51b27507
Description
#include <QString> #include <QtTest> #include <QColor> class Test : public QObject { Q_OBJECT public: Test(); private Q_SLOTS: void hsl(); void alpha(); void invalid(); }; Test::Test() { } void Test::hsl() { QColor black(Qt::black); QColor blackHsl = black.toHsl(); QCOMPARE(black, blackHsl); } void Test::alpha() { QColor black(Qt::black); QColor transparentBlack = black; transparentBlack.setAlpha(0); QCOMPARE(black, transparentBlack); } void Test::invalid() { QColor black(Qt::black); QColor invalid; QVERIFY(!invalid.isValid()); QCOMPARE(black, invalid); } QTEST_APPLESS_MAIN(Test) #include "tst_test.moc"
Starting C:\Users\Mitch\AppData\Local\Temp\untitled3-qt5_7_debug-Debug\debug\tst_test.exe... ********* Start testing of Test ********* Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-llp64 shared (dynamic) debug build; by MSVC 2015) PASS : Test::initTestCase() FAIL! : Test::hsl() Compared values are not the same Actual (black) : #000000 Expected (blackHsl): #000000 ..\untitled3\tst_test.cpp(26) : failure location FAIL! : Test::alpha() Compared values are not the same Actual (black) : #000000 Expected (transparentBlack): #000000 ..\untitled3\tst_test.cpp(34) : failure location FAIL! : Test::invalid() Compared values are not the same Actual (black) : #000000 Expected (invalid): #000000 ..\untitled3\tst_test.cpp(42) : failure location PASS : Test::cleanupTestCase() Totals: 2 passed, 3 failed, 0 skipped, 0 blacklisted, 4ms ********* Finished testing of Test ********* C:\Users\Mitch\AppData\Local\Temp\untitled3-qt5_7_debug-Debug\debug\tst_test.exe exited with code 3