summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-21 12:26:52 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-21 12:26:52 +0200
commit92493ca51dd59756aa8011c21b8f29c4cdb51211 (patch)
treea951b080f8ac3772974701a4e79cfbb05fe2bd18
parent5c4f16d335704c3084721114fc3bb9a218f43166 (diff)
Register ClockTime with the type system, to be possible to use it with QGlib::Value.
-rw-r--r--src/QGst/clocktime.h2
-rw-r--r--tests/auto/clocktest.cpp7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/QGst/clocktime.h b/src/QGst/clocktime.h
index 2858a21..ea3ced6 100644
--- a/src/QGst/clocktime.h
+++ b/src/QGst/clocktime.h
@@ -61,4 +61,6 @@ private:
} //namspace QGst
+QGST_REGISTER_TYPE(QGst::ClockTime)
+
#endif // QGST_CLOCKTIME_H
diff --git a/tests/auto/clocktest.cpp b/tests/auto/clocktest.cpp
index fac49d2..3b8f88b 100644
--- a/tests/auto/clocktest.cpp
+++ b/tests/auto/clocktest.cpp
@@ -26,6 +26,7 @@ private Q_SLOTS:
void systemTest();
void timeFromClockTimeTest();
void clockTimeFromTimeTest();
+ void valueTest();
};
void ClockTest::systemTest()
@@ -64,6 +65,12 @@ void ClockTest::clockTimeFromTimeTest()
static_cast<quint64>((50001 * 1000 +15) * Q_UINT64_C(1000000)));
}
+void ClockTest::valueTest()
+{
+ QGst::ClockTime time = QGst::ClockTime(123456789);
+ QGlib::Value v = QGlib::Value::create(time);
+ QCOMPARE(v.get<QGst::ClockTime>(), time);
+}
QTEST_MAIN(ClockTest)