diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-11-21 17:49:07 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-22 00:33:44 +0100 |
commit | 36ee00c9f519b942066dc364e0bf101a9d4f805c (patch) | |
tree | 7723517521b696566b638ee841cd3abef01349c4 /tests | |
parent | cf1de2f07256e50b311eb28ebbcfbc0f9d984285 (diff) |
Add test for QTimeLine::toggleDirection()
Before QTimeLine made it into the public API, the toggle() function
became toggleDirection() and isReversed() became the more generic
direction(). This commit uncomments the old toggle() test and uses the
final function names.
Change-Id: Ie3379f32ff0c78436f33c2733232d795ca88152b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp index 7c353867f8..9d5e65573b 100644 --- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp +++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp @@ -60,7 +60,7 @@ private slots: void interpolation(); void reverse_data(); void reverse(); - //void toggle(); + void toggleDirection(); //void reset(); ### todo void frameChanged(); void stopped(); @@ -437,17 +437,18 @@ void tst_QTimeLine::reverse() } -/* -void tst_QTimeLine::toggle() +void tst_QTimeLine::toggleDirection() { + // Note: enum values are cast to int so that QCOMPARE will show + // the values if they don't match. QTimeLine timeLine; - QCOMPARE(timeLine.isReverse(), false); - timeLine.toggle(); - QCOMPARE(timeLine.isReverse(), true); - timeLine.toggle(); - QCOMPARE(timeLine.isReverse(), false); + QCOMPARE(int(timeLine.direction()), int(QTimeLine::Forward)); + timeLine.toggleDirection(); + QCOMPARE(int(timeLine.direction()), int(QTimeLine::Backward)); + timeLine.toggleDirection(); + QCOMPARE(int(timeLine.direction()), int(QTimeLine::Forward)); } -*/ + /* void tst_QTimeLine::reset() { |