diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-06-08 12:21:30 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-12 07:48:22 +0000 |
commit | d0f64542c8e6ec272d3fa19cf25ffe7ac33a99bc (patch) | |
tree | 934d26f4257490d01e2524b76ebf9db7a87944f5 /tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp | |
parent | ca22a022967848358e1b2f0eec9588a0cb12a5e5 (diff) |
Output registered enumeration names in QCOMPARE.
Produces output:
FAIL! : tst_qquickwindow::cursor() Compared values are not the same
Actual (clippedItem.cursor().shape()): ForbiddenCursor
Expected (Qt::ArrowCursor) : ArrowCursor
Loc: [tst_qquickwindow.cpp(1465)]
Change-Id: I8a9dfa099a6011cbe0c07da683d4be3d07e22d5d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp')
-rw-r--r-- | tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp index 6b94dfb529..1ee78960ab 100644 --- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp +++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp @@ -124,6 +124,8 @@ class tst_Cmptest: public QObject Q_OBJECT private slots: + void compare_unregistered_enums(); + void compare_registered_enums(); void compare_boolfuncs(); void compare_pointerfuncs(); void compare_tostring(); @@ -140,6 +142,20 @@ private slots: #endif }; +enum MyUnregisteredEnum { MyUnregisteredEnumValue1, MyUnregisteredEnumValue2 }; + +void tst_Cmptest::compare_unregistered_enums() +{ + QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue1); + QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue2); +} + +void tst_Cmptest::compare_registered_enums() +{ + QCOMPARE(Qt::ArrowCursor, Qt::ArrowCursor); + QCOMPARE(Qt::ArrowCursor, Qt::BusyCursor); +} + static bool boolfunc() { return true; } static bool boolfunc2() { return true; } |