From e965ffd76e3e77d23baa5648d6525efc4b01d884 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Sun, 28 Apr 2013 12:22:40 +0300 Subject: [PATCH] tests: Add a test for media/tvlux.lua Signed-off-by: Toni Gundogdu --- tests/media/media_tvlux.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++ tests/media/tests.mk | 1 + tests/media/tvlux.mk | 6 ++++ 3 files changed, 91 insertions(+) create mode 100644 tests/media/media_tvlux.c create mode 100644 tests/media/tvlux.mk diff --git a/tests/media/media_tvlux.c b/tests/media/media_tvlux.c new file mode 100644 index 0000000..6712d80 --- /dev/null +++ b/tests/media/media_tvlux.c @@ -0,0 +1,84 @@ +/* libquvi-scripts + * Copyright (C) 2013 Toni Gundogdu + * + * This file is part of libquvi-scripts . + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General + * Public License along with this program. If not, see + * . + */ + +#include "config.h" + +#include +#include +#include + +#include "tests.h" + +static const gchar *URLs[] = +{ + "http://www.tvlux.be/video/la-galerie-du-chatelet_13305.html", + "http://www.tvlux.be/video/wendy-nazare_12054.html", + "http://www.tvlux.be/video/colline-hill_13242.html", + "http://www.tvlux.be/video/julie-roses_13275.html", + NULL +}; + +static const gchar *TITLEs[] = +{ + "La Galerie du Chatelet (22-04-2013)", + "Wendy Nazaré (13-02-2013)", + "Colline Hill (10-04-2013)", + "Julie Roses (17-04-2013)", + NULL +}; + +static const gchar *IDs[] = +{ + "13305", + "12054", + "13242", + "13275", + NULL +}; + +static void test_media_tvlux() +{ + struct qm_test_exact_s e; + struct qm_test_opts_s o; + gint i; + + for (i=0; URLs[i] != NULL; ++i) + { + memset(&e, 0, sizeof(e)); + memset(&o, 0, sizeof(o)); + + e.title = TITLEs[i]; + e.id = IDs[i]; + + o.gt0.stream.video.height = TRUE; + o.gt0.stream.video.width = TRUE; + + qm_test(__func__, URLs[i], &e, &o); + } +} + +gint main(gint argc, gchar **argv) +{ + g_test_init(&argc, &argv, NULL); + g_test_add_func("/media/tvlux", test_media_tvlux); + return (g_test_run()); +} + +/* vim: set ts=2 sw=2 tw=72 expandtab: */ diff --git a/tests/media/tests.mk b/tests/media/tests.mk index 45302b5..5559a05 100644 --- a/tests/media/tests.mk +++ b/tests/media/tests.mk @@ -12,5 +12,6 @@ include $(top_srcdir)/tests/media/senat.mk include $(top_srcdir)/tests/media/sevenload.mk include $(top_srcdir)/tests/media/soundcloud.mk include $(top_srcdir)/tests/media/theonion.mk +include $(top_srcdir)/tests/media/tvlux.mk include $(top_srcdir)/tests/media/vimeo.mk include $(top_srcdir)/tests/media/youtube.mk diff --git a/tests/media/tvlux.mk b/tests/media/tvlux.mk new file mode 100644 index 0000000..913bedd --- /dev/null +++ b/tests/media/tvlux.mk @@ -0,0 +1,6 @@ +TEST_PROGS+=media_tvlux +media_tvlux_SOURCES=media/media_tvlux.c +media_tvlux_CPPFLAGS=$(testsuite_cppflags) +media_tvlux_LDFLAGS=$(testsuite_ldflags) +media_tvlux_LDADD=$(testsuite_ldadd) +media_tvlux_CFLAGS=$(AM_CFLAGS) -- 2.11.4.GIT