diff options
author | Jens Georg <jensg@openismus.org> | 2012-09-11 14:55:50 +0200 |
---|---|---|
committer | Jens Georg <jensg@openismus.com> | 2012-10-05 17:33:28 +0200 |
commit | 3c11305e5bed40b3e6edff7229bec471fe22a3ae (patch) | |
tree | bf37dfcaae0e3a073c95fa723619f8c3bfac6dd2 /tests | |
parent | 14a032587741b7c9766df78110b84cc5c2aee9c3 (diff) | |
download | rygel-3c11305e5bed40b3e6edff7229bec471fe22a3ae.tar.gz |
server: Remove GStreamer from TimeSeek
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 8 | ||||
-rw-r--r-- | tests/rygel-environment-test.vala | 31 | ||||
-rw-r--r-- | tests/rygel-http-time-seek-test.vala | 18 |
3 files changed, 47 insertions, 10 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 6c7086ac..65486dec 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -44,7 +44,8 @@ check_PROGRAMS = rygel-http-item-uri-test \ rygel-item-creator-test \ rygel-playbin-renderer-test \ rygel-user-config-test \ - rygel-regression + rygel-regression \ + rygel-environment-test TESTS = $(check_PROGRAMS) @@ -156,6 +157,11 @@ rygel_regression_LDADD = \ $(top_builddir)/src/librygel-server/librygel-server-1.0.la \ $(top_builddir)/src/librygel-core/librygel-core-1.0.la +rygel_environment_test_SOURCES = rygel-environment-test.vala +rygel_environment_test_CFLAGS = $(AM_CFLAGS) +rygel_environment_test_LDADD = $(LDADD) +rygel_environment_test_VALAFLAGS = $(AM_VALAFLAGS) --pkg gstreamer-0.10 + if ALWAYS_TEST all-local: check endif diff --git a/tests/rygel-environment-test.vala b/tests/rygel-environment-test.vala new file mode 100644 index 00000000..41a67e16 --- /dev/null +++ b/tests/rygel-environment-test.vala @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 Intel Corporation. + * + * Author: Jens Georg <jensg@openismus.com> + * + * This file is part of Rygel. + * + * Rygel is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Rygel is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +public class EnvironmentTest { + public static int main (string[] args) { + // Check that the base of TimeSpan is a micro-second + // Otherwise rygel-gst-data-source.vala needs adaption + assert (TimeSpan.SECOND * Gst.USECOND == Gst.SECOND); + + return 0; + } +} diff --git a/tests/rygel-http-time-seek-test.vala b/tests/rygel-http-time-seek-test.vala index b1843649..3e7283b3 100644 --- a/tests/rygel-http-time-seek-test.vala +++ b/tests/rygel-http-time-seek-test.vala @@ -21,8 +21,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -using Gst; - private errordomain Rygel.TestError { SKIP } @@ -167,7 +165,9 @@ private class Rygel.HTTPTimeSeekTest : GLib.Object { Subtitle? subtitle) throws HTTPSeekError { var request = new HTTPGet (thumbnail, subtitle); var audio_item = request.item as AudioItem; - this.test_seek (request, 0, audio_item.duration * SECOND - MSECOND); + this.test_seek (request, + 0, + audio_item.duration * TimeSpan.SECOND - TimeSpan.MILLISECOND); } private void test_start_only_seek (Thumbnail? thumbnail, @@ -189,8 +189,8 @@ private class Rygel.HTTPTimeSeekTest : GLib.Object { var audio_item = request.item as AudioItem; this.test_seek (request, - 128 * SECOND, - audio_item.duration * SECOND - MSECOND); + 128 * TimeSpan.SECOND, + audio_item.duration * TimeSpan.SECOND - TimeSpan.MILLISECOND); } private void test_stop_only_seek (Thumbnail? thumbnail, @@ -213,7 +213,7 @@ private class Rygel.HTTPTimeSeekTest : GLib.Object { break; } - this.test_seek (request, 0, 128 * SECOND); + this.test_seek (request, 0, 128 * TimeSpan.SECOND); } private void test_start_stop_seek (Thumbnail? thumbnail, @@ -248,7 +248,7 @@ private class Rygel.HTTPTimeSeekTest : GLib.Object { } - this.test_seek (request, 128 * SECOND, 256 * SECOND); + this.test_seek (request, 128 * TimeSpan.SECOND, 256 * TimeSpan.SECOND); } private void test_seek (HTTPGet request, @@ -262,10 +262,10 @@ private class Rygel.HTTPTimeSeekTest : GLib.Object { assert (seek != null); assert (seek.start == start); assert (seek.stop == stop); - assert (seek.length == seek.stop + MSECOND - seek.start); + assert (seek.length == seek.stop + TimeSpan.MILLISECOND - seek.start); var audio_item = request.item as AudioItem; - assert (seek.total_length == audio_item.duration * SECOND); + assert (seek.total_length == audio_item.duration * TimeSpan.SECOND); var header = request.msg.response_headers.get_one ("TimeSeekRange.dlna.org"); |