From 36ee00c9f519b942066dc364e0bf101a9d4f805c Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 21 Nov 2011 17:49:07 +1000 Subject: 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 --- tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests/auto/corelib') 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() { -- cgit v1.2.3