From 5c49829fef59b9a318d76c2b0542ad298e62f792 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Sun, 28 Apr 2013 14:17:29 +0300 Subject: [PATCH] tests: Add a test for media/sapo.lua Signed-off-by: Toni Gundogdu --- tests/media/media_sapo.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/media/sapo.mk | 6 ++++ tests/media/tests.mk | 1 + 3 files changed, 86 insertions(+) create mode 100644 tests/media/media_sapo.c create mode 100644 tests/media/sapo.mk diff --git a/tests/media/media_sapo.c b/tests/media/media_sapo.c new file mode 100644 index 0000000..a20b07a --- /dev/null +++ b/tests/media/media_sapo.c @@ -0,0 +1,79 @@ +/* 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://videos.sapo.pt/27yytM7VRS2TflzN6WUh", + "http://videos.sapo.pt/p8QgB9BgnvbYYmiZzpau", + NULL +}; + +static const gchar *TITLEs[] = +{ + "Dois irmãos sobrevivem depois de nadar 14 horas", + "Economia Verde - episódio 53", + NULL +}; + +static const gchar *IDs[] = +{ + "27yytM7VRS2TflzN6WUh", + "p8QgB9BgnvbYYmiZzpau", + NULL +}; + +static void test_media_sapo() +{ + 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; + o.gt0.duration_ms = 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/sapo", test_media_sapo); + return (g_test_run()); +} + +/* vim: set ts=2 sw=2 tw=72 expandtab: */ diff --git a/tests/media/sapo.mk b/tests/media/sapo.mk new file mode 100644 index 0000000..9730113 --- /dev/null +++ b/tests/media/sapo.mk @@ -0,0 +1,6 @@ +TEST_PROGS+=media_sapo +media_sapo_SOURCES=media/media_sapo.c +media_sapo_CPPFLAGS=$(testsuite_cppflags) +media_sapo_LDFLAGS=$(testsuite_ldflags) +media_sapo_LDADD=$(testsuite_ldadd) +media_sapo_CFLAGS=$(AM_CFLAGS) diff --git a/tests/media/tests.mk b/tests/media/tests.mk index 5559a05..44f5525 100644 --- a/tests/media/tests.mk +++ b/tests/media/tests.mk @@ -8,6 +8,7 @@ include $(top_srcdir)/tests/media/dailymotion.mk include $(top_srcdir)/tests/media/funnyordie.mk include $(top_srcdir)/tests/media/gaskrank.mk include $(top_srcdir)/tests/media/publicsenat.mk +include $(top_srcdir)/tests/media/sapo.mk include $(top_srcdir)/tests/media/senat.mk include $(top_srcdir)/tests/media/sevenload.mk include $(top_srcdir)/tests/media/soundcloud.mk -- 2.11.4.GIT