From 92702c13a3edc23820a893417f1a58db87d22568 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Wed, 23 Oct 2013 22:36:59 +0300 Subject: [PATCH] tests: Add a test for media/videobash.lua Signed-off-by: Toni Gundogdu --- tests/media/media_videobash.c | 74 +++++++++++++++++++++++++++++++++++++++++++ tests/media/tests.mk | 1 + tests/media/videobash.mk | 6 ++++ 3 files changed, 81 insertions(+) create mode 100644 tests/media/media_videobash.c create mode 100644 tests/media/videobash.mk diff --git a/tests/media/media_videobash.c b/tests/media/media_videobash.c new file mode 100644 index 0000000..fdb839f --- /dev/null +++ b/tests/media/media_videobash.c @@ -0,0 +1,74 @@ +/* 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.videobash.com/video_show/spider-cats-28253", + NULL +}; + +static const gchar *TITLEs[] = +{ + "spider cats", + NULL +}; + +static const gchar *IDs[] = +{ + "28253", + NULL +}; + +static void test_media_videobash() +{ + 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.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/videobash", test_media_videobash); + 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 829835b..ef0c7aa 100644 --- a/tests/media/tests.mk +++ b/tests/media/tests.mk @@ -33,6 +33,7 @@ include $(top_srcdir)/tests/media/ted.mk include $(top_srcdir)/tests/media/theonion.mk include $(top_srcdir)/tests/media/tvlux.mk include $(top_srcdir)/tests/media/videa.mk +include $(top_srcdir)/tests/media/videobash.mk include $(top_srcdir)/tests/media/vimeo.mk include $(top_srcdir)/tests/media/vzaar.mk include $(top_srcdir)/tests/media/youtube.mk diff --git a/tests/media/videobash.mk b/tests/media/videobash.mk new file mode 100644 index 0000000..2ebe9b0 --- /dev/null +++ b/tests/media/videobash.mk @@ -0,0 +1,6 @@ +TEST_PROGS+=media_videobash +media_videobash_SOURCES=media/media_videobash.c +media_videobash_CPPFLAGS=$(testsuite_cppflags) +media_videobash_LDFLAGS=$(testsuite_ldflags) +media_videobash_LDADD=$(testsuite_ldadd) +media_videobash_CFLAGS=$(AM_CFLAGS) -- 2.11.4.GIT