From 32a5bb9066d8a891f583e48e32f8fda51f3e14a9 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Mon, 14 Oct 2013 23:21:45 +0300 Subject: [PATCH] tests: Add a test for media/tapuz.lua Signed-off-by: Toni Gundogdu --- tests/media/media_tapuz.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++ tests/media/tapuz.mk | 6 ++++ tests/media/tests.mk | 1 + 3 files changed, 79 insertions(+) create mode 100644 tests/media/media_tapuz.c create mode 100644 tests/media/tapuz.mk diff --git a/tests/media/media_tapuz.c b/tests/media/media_tapuz.c new file mode 100644 index 0000000..8e8294e --- /dev/null +++ b/tests/media/media_tapuz.c @@ -0,0 +1,72 @@ +/* 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://flix.tapuz.co.il/v/watch-4323227-%D7%9C%D7%A2%D7%A7%D7%95%D7%A8%20%D7%A9%D7%9F%20%D7%9C%D7%98%D7%99%D7%92%D7%A8%D7%99%D7%A1.html", + NULL +}; + +static const gchar *TITLEs[] = +{ + "לעקור שן לטיגריס", + NULL +}; + +static const gchar *IDs[] = +{ + "4323227", + NULL +}; + +static void test_media_tapuz() +{ + 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]; + + qm_test(__func__, URLs[i], &e, &o); + } +} + +gint main(gint argc, gchar **argv) +{ + g_test_init(&argc, &argv, NULL); + g_test_add_func("/media/tapuz", test_media_tapuz); + return (g_test_run()); +} + +/* vim: set ts=2 sw=2 tw=72 expandtab: */ diff --git a/tests/media/tapuz.mk b/tests/media/tapuz.mk new file mode 100644 index 0000000..12abc82 --- /dev/null +++ b/tests/media/tapuz.mk @@ -0,0 +1,6 @@ +TEST_PROGS+=media_tapuz +media_tapuz_SOURCES=media/media_tapuz.c +media_tapuz_CPPFLAGS=$(testsuite_cppflags) +media_tapuz_LDFLAGS=$(testsuite_ldflags) +media_tapuz_LDADD=$(testsuite_ldadd) +media_tapuz_CFLAGS=$(AM_CFLAGS) diff --git a/tests/media/tests.mk b/tests/media/tests.mk index 9c2acde..109c526 100644 --- a/tests/media/tests.mk +++ b/tests/media/tests.mk @@ -26,6 +26,7 @@ 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/spiegel.mk +include $(top_srcdir)/tests/media/tapuz.mk include $(top_srcdir)/tests/media/ted.mk include $(top_srcdir)/tests/media/theonion.mk include $(top_srcdir)/tests/media/tvlux.mk -- 2.11.4.GIT