Merge branch 'tg/next__media_port_ted.lua' into next
[libquvi-scripts.git] / tests / media / media_ted.c
blob076d479e7aedc818ae4f10765f86ecb7cbc516c9
1 /* libquvi-scripts
2 * Copyright (C) 2013 Toni Gundogdu <legatvs@gmail.com>
4 * This file is part of libquvi-scripts <http://quvi.sourceforge.net>.
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public
8 * License as published by the Free Software Foundation, either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General
17 * Public License along with this program. If not, see
18 * <http://www.gnu.org/licenses/>.
21 #include "config.h"
23 #include <string.h>
24 #include <glib.h>
25 #include <quvi.h>
27 #include "tests.h"
29 static const gchar *URLs[] =
31 /* media self-hosted. */
32 "http://www.ted.com/talks/jonathan_eisen_meet_your_microbes.html",
33 /* media hosted by youtube (sets the `goto_url'). */
34 "http://www.ted.com/talks/paul_lewis_crowdsourcing_the_news.html",
35 NULL
38 static const gchar *TITLEs[] =
40 "Jonathan Eisen: Meet your microbes",
41 "TEDxThessaloniki - Paul Lewis - Citizen Journalism",
42 NULL
45 static const gchar *IDs[] =
47 "1503",
48 "9APO9_yNbcg",
49 NULL
52 static void test_media_ted()
54 struct qm_test_exact_s e;
55 struct qm_test_opts_s o;
56 gint i;
58 for (i=0; URLs[i] != NULL; ++i)
60 memset(&e, 0, sizeof(e));
61 memset(&o, 0, sizeof(o));
63 e.title = TITLEs[i];
64 e.id = IDs[i];
66 #ifdef _1 /* Only some of the (self-hosted) videos have these. */
67 o.gt0.stream.video.height = TRUE;
68 o.gt0.stream.video.width = TRUE;
69 #endif
70 o.gt0.duration_ms = TRUE;
72 qm_test(__func__, URLs[i], &e, &o);
76 gint main(gint argc, gchar **argv)
78 g_test_init(&argc, &argv, NULL);
79 g_test_add_func("/media/ted", test_media_ted);
80 return (g_test_run());
83 /* vim: set ts=2 sw=2 tw=72 expandtab: */