diff options
author | John Layt <jlayt@kde.org> | 2014-02-14 15:23:47 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-21 20:33:10 +0100 |
commit | 9c6447e0815a18102e5ebe236c52ba4343dbb8fa (patch) | |
tree | 2e27887362be73a6b252ebb93bf7e333eaa5d823 /tests/auto/corelib/tools/qmargins/tst_qmargins.cpp | |
parent | db352e1e97a0eb38cb5756f264b3162efeb86c02 (diff) |
QMargins - Add missing operators
Add missing standard operators.
[ChangeLog][QtCore][QMargins] Added missing addition and subtraction
operators.
Change-Id: I6aeed39531a736c12d378a817a9431279da79bc4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/corelib/tools/qmargins/tst_qmargins.cpp')
-rw-r--r-- | tests/auto/corelib/tools/qmargins/tst_qmargins.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp index ec83740196..d49e0efe43 100644 --- a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp +++ b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp @@ -123,6 +123,13 @@ void tst_QMargins::operators() QCOMPARE(a, halved); QCOMPARE(m1 + (-m1), QMargins()); + + QMargins m3 = QMargins(10, 11, 12, 13); + QCOMPARE(m3 + 1, QMargins(11, 12, 13, 14)); + QCOMPARE(1 + m3, QMargins(11, 12, 13, 14)); + QCOMPARE(m3 - 1, QMargins(9, 10, 11, 12)); + QCOMPARE(+m3, QMargins(10, 11, 12, 13)); + QCOMPARE(-m3, QMargins(-10, -11, -12, -13)); } // Testing QDataStream operators |