summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-11 17:48:56 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-11 17:48:56 +0200
commitabd7d1ffc94abda0259d8e4764a0a7813253d0f9 (patch)
tree0a737aa0021e4624ce438688a3fed8626bcf27e3 /tests
parent88ceb607ce4b59ba4bb8b66cce78bb25e0dee3d2 (diff)
Convert ClockTime to a class.
* Move the related QTime conversion methods from Clock to ClockTime. * Make those quint64 constants portable with Q_UINT64_C(). * Add ClockTime::None and ClockTime.isValid().
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/clocktest.cpp20
-rw-r--r--tests/auto/eventtest.cpp6
-rw-r--r--tests/auto/querytest.cpp4
3 files changed, 15 insertions, 15 deletions
diff --git a/tests/auto/clocktest.cpp b/tests/auto/clocktest.cpp
index 3cabc47..fac49d2 100644
--- a/tests/auto/clocktest.cpp
+++ b/tests/auto/clocktest.cpp
@@ -42,26 +42,26 @@ void ClockTest::systemTest()
void ClockTest::timeFromClockTimeTest()
{
- QCOMPARE(QGst::Clock::timeFromClockTime(3600 * 1000 * 1000000LL).toString(),
+ QCOMPARE(QGst::ClockTime(3600 * 1000 * Q_UINT64_C(1000000)).toTime().toString(),
QString("01:00:00")); // 1 hour
- QCOMPARE(QGst::Clock::timeFromClockTime(4000 * 1000 * 1000000LL).toString(),
+ QCOMPARE(QGst::ClockTime(4000 * 1000 * Q_UINT64_C(1000000)).toTime().toString(),
QString("01:06:40"));
- QCOMPARE(QGst::Clock::timeFromClockTime(50001 * 1000 * 1000000LL).toString(),
+ QCOMPARE(QGst::ClockTime(50001 * 1000 * Q_UINT64_C(1000000)).toTime().toString(),
QString("13:53:21"));
- QCOMPARE(QGst::Clock::timeFromClockTime(120000 * 1000 * 1000000LL).toString(),
+ QCOMPARE(QGst::ClockTime(120000 * 1000 * Q_UINT64_C(1000000)).toTime().toString(),
QString("09:20:00")); // wraps
}
void ClockTest::clockTimeFromTimeTest()
{
- QCOMPARE(static_cast<quint64>(QGst::Clock::clockTimeFromTime(QTime(1, 0))),
- static_cast<quint64>(3600 * 1000 * 1000000LL)); // 1 hour
+ QCOMPARE(static_cast<quint64>(QGst::ClockTime::fromTime(QTime(1, 0))),
+ static_cast<quint64>(3600 * 1000 * Q_UINT64_C(1000000))); // 1 hour
- QCOMPARE(static_cast<quint64>(QGst::Clock::clockTimeFromTime(QTime(1, 6, 40))),
- static_cast<quint64>(4000 * 1000 * 1000000LL));
+ QCOMPARE(static_cast<quint64>(QGst::ClockTime::fromTime(QTime(1, 6, 40))),
+ static_cast<quint64>(4000 * 1000 * Q_UINT64_C(1000000)));
- QCOMPARE(static_cast<quint64>(QGst::Clock::clockTimeFromTime(QTime(13, 53, 21, 15))),
- static_cast<quint64>((50001 * 1000 +15) * 1000000LL));
+ QCOMPARE(static_cast<quint64>(QGst::ClockTime::fromTime(QTime(13, 53, 21, 15))),
+ static_cast<quint64>((50001 * 1000 +15) * Q_UINT64_C(1000000)));
}
diff --git a/tests/auto/eventtest.cpp b/tests/auto/eventtest.cpp
index 5509eee..d36e3c0 100644
--- a/tests/auto/eventtest.cpp
+++ b/tests/auto/eventtest.cpp
@@ -134,8 +134,8 @@ void EventTest::qosTest()
QCOMPARE(evt->typeName(), QString("qos"));
QCOMPARE(evt->proportion(), 123.4);
- QCOMPARE(evt->diff(), static_cast<qint64>(23455));
- QCOMPARE(evt->timestamp(), static_cast<quint64>(98765432));
+ QCOMPARE(evt->diff(), QGst::ClockTimeDiff(23455));
+ QCOMPARE(evt->timestamp(), QGst::ClockTime(98765432));
};
void EventTest::seekTest()
@@ -174,7 +174,7 @@ void EventTest::latencyTest()
QVERIFY(evt->type()==QGst::EventLatency);
QCOMPARE(evt->typeName(), QString("latency"));
- QCOMPARE(evt->latency(), static_cast<quint64>(43210));
+ QCOMPARE(evt->latency(), QGst::ClockTime(43210));
};
void EventTest::stepTest()
diff --git a/tests/auto/querytest.cpp b/tests/auto/querytest.cpp
index 3fec8d0..d9edb89 100644
--- a/tests/auto/querytest.cpp
+++ b/tests/auto/querytest.cpp
@@ -79,8 +79,8 @@ void QueryTest::latencyTest()
query->setValues(true, 10000, 100000);
QVERIFY(query->hasLive());
- QCOMPARE(query->minimumLatency(), static_cast<quint64>(10000));
- QCOMPARE(query->maximumLatency(), static_cast<quint64>(100000));
+ QCOMPARE(query->minimumLatency(), QGst::ClockTime(10000));
+ QCOMPARE(query->maximumLatency(), QGst::ClockTime(100000));
}
void QueryTest::seekingTest()