From b5f92db67345013023d858b960aabfe2f71650c8 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Mon, 14 Oct 2013 06:40:23 +0300 Subject: [PATCH] tests: Add a test for media/majestyc.lua Signed-off-by: Toni Gundogdu --- tests/media/majestyc.mk | 6 ++++ tests/media/media_majestyc.c | 72 ++++++++++++++++++++++++++++++++++++++++++++ tests/media/tests.mk | 1 + 3 files changed, 79 insertions(+) create mode 100644 tests/media/majestyc.mk create mode 100644 tests/media/media_majestyc.c diff --git a/tests/media/majestyc.mk b/tests/media/majestyc.mk new file mode 100644 index 0000000..5a02160 --- /dev/null +++ b/tests/media/majestyc.mk @@ -0,0 +1,6 @@ +TEST_PROGS+=media_majestyc +media_majestyc_SOURCES=media/media_majestyc.c +media_majestyc_CPPFLAGS=$(testsuite_cppflags) +media_majestyc_LDFLAGS=$(testsuite_ldflags) +media_majestyc_LDADD=$(testsuite_ldadd) +media_majestyc_CFLAGS=$(AM_CFLAGS) diff --git a/tests/media/media_majestyc.c b/tests/media/media_majestyc.c new file mode 100644 index 0000000..fa0e11f --- /dev/null +++ b/tests/media/media_majestyc.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://tube.majestyc.net/?v=Kdgt1ZHkvnM", + NULL +}; + +static const gchar *TITLEs[] = +{ + "Epic Funny Cats 20 Minutes", + NULL +}; + +static const gchar *IDs[] = +{ + "Kdgt1ZHkvnM", + NULL +}; + +static void test_media_majestyc() +{ + 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/majestyc", test_media_majestyc); + 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 9c2acde..5989309 100644 --- a/tests/media/tests.mk +++ b/tests/media/tests.mk @@ -19,6 +19,7 @@ include $(top_srcdir)/tests/media/guardian.mk include $(top_srcdir)/tests/media/ina.mk include $(top_srcdir)/tests/media/lego.mk include $(top_srcdir)/tests/media/liveleak.mk +include $(top_srcdir)/tests/media/majestyc.mk include $(top_srcdir)/tests/media/myspass.mk include $(top_srcdir)/tests/media/publicsenat.mk include $(top_srcdir)/tests/media/sapo.mk -- 2.11.4.GIT