Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.4.0, 5.5.0
-
None
-
Linux, g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2
-
57ae1b15b61ac6e45ae6a37d943e600fcd47c388 (qtbase/dev, 20.7.2015, 5.6)
Description
void EnumcompareTest::testCase1() { enum { expectedValue = 3 }; int i = 3; QCOMPARE(i , expectedValue); }
produces
******** Start testing of EnumcompareTest ********* Config: Using QtTest library 5.5.1, Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 4.8.2) PASS : EnumcompareTest::initTestCase() FAIL! : EnumcompareTest::testCase1() Compared values are not the same Actual (i) : 1 Expected (expectedValue): 3 Loc: [../enumcompare/tst_enumcomparetest.cpp(21)] PASS : EnumcompareTest::cleanupTestCase() Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted ********* Finished testing of EnumcompareTest *********
Debugging shows that the code ends up in qtbase/src/testlib/qtestcase.h:397
// NokiaX86 and RVCT do not like implicitly comparing bool with int inline bool qCompare(bool const &t1, int const &t2, const char *actual, const char *expected, const char *file, int line) { return qCompare(int(t1), t2, actual, expected, file, line); }
Attachments
For Gerrit Dashboard: QTBUG-47260 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
121695,3 | tst_qquickmultipointtoucharea: Do not rely on qCompare(bool, int,...). | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
121697,2 | Unit test qaudiodecoder: Do not rely on qCompare(bool, int,...). | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
121699,2 | Tests: Do not rely on qCompare(bool, int,...). | dev | qt/qtbase | Status: MERGED | +2 | 0 |
121700,2 | Testlib: Remove overload qCompare(bool, int, ...). | dev | qt/qtbase | Status: MERGED | +2 | 0 |