From ff58b2b10e80c5ad1a0d51df516b56f2b5ddc11e Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Tue, 16 Apr 2013 19:00:13 +0300 Subject: [PATCH] tests: Add media_audioboo Add a test for the media/audioboo.lua script. Signed-off-by: Toni Gundogdu --- tests/media/audioboo.mk | 6 ++++ tests/media/media_audioboo.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ tests/media/tests.mk | 1 + 3 files changed, 82 insertions(+) create mode 100644 tests/media/audioboo.mk create mode 100644 tests/media/media_audioboo.c diff --git a/tests/media/audioboo.mk b/tests/media/audioboo.mk new file mode 100644 index 0000000..48f23bd --- /dev/null +++ b/tests/media/audioboo.mk @@ -0,0 +1,6 @@ +TEST_PROGS+=media_audioboo +media_audioboo_SOURCES=media/media_audioboo.c +media_audioboo_CPPFLAGS=$(testsuite_cppflags) +media_audioboo_LDFLAGS=$(testsuite_ldflags) +media_audioboo_LDADD=$(testsuite_ldadd) +media_audioboo_CFLAGS=$(AM_CFLAGS) diff --git a/tests/media/media_audioboo.c b/tests/media/media_audioboo.c new file mode 100644 index 0000000..a00cd9d --- /dev/null +++ b/tests/media/media_audioboo.c @@ -0,0 +1,75 @@ +/* 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://audioboo.fm/boos/1310364-trystan-davies-talks-to-deadinburgh-director-barra-collins", + "http://audioboo.fm/boos/1331424-team-podcast-chinese-grand-prix", + NULL +}; + +static const gchar *TITLEs[] = +{ + "Trystan Davies talks to Deadinburgh director Barra Collins", + "Team Podcast: Chinese Grand Prix", + NULL +}; + +static const gchar *IDs[] = +{ + "1310364", + "1331424", + NULL +}; + +static void test_media_audioboo() +{ + 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/audioboo", test_media_audioboo); + 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 14b88cc..5d80ee0 100644 --- a/tests/media/tests.mk +++ b/tests/media/tests.mk @@ -1,5 +1,6 @@ include $(top_srcdir)/tests/media/academicearth.mk include $(top_srcdir)/tests/media/arte.mk +include $(top_srcdir)/tests/media/audioboo.mk include $(top_srcdir)/tests/media/break.mk include $(top_srcdir)/tests/media/dailymotion.mk include $(top_srcdir)/tests/media/gaskrank.mk -- 2.11.4.GIT