m_match_media_script: Remove unused parameter
[libquvi.git] / tests / goto.c
blobb497548c84f07ca24be2fd8459acd8836486dad8
1 /* libquvi
2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA
20 #include "config.h"
22 #include <string.h>
23 #include <glib.h>
24 #include <quvi.h>
26 #include "tests.h"
28 /* academicearth.lua uses the "goto_url" instruction. */
30 static const gchar URL[] =
31 "http://www.academicearth.org/lectures/intro-roman-architecture";
33 static const gchar TITLE[] = "1. Introduction to Roman Architecture";
35 static void test_goto_url()
37 quvi_media_t qm;
38 quvi_t q;
39 gchar *s;
41 if (chk_internet() == FALSE)
42 return;
44 if (chk_skip(__func__) == TRUE)
45 return;
47 q = quvi_new();
48 g_assert(q != NULL);
49 g_assert_cmpint(qerr(q), ==, QUVI_OK);
51 chk_verbose(q);
53 qm = quvi_media_new(q, URL);
54 g_assert_cmpint(qerr_m(q, URL), ==, QUVI_OK);
55 g_assert(qm != NULL);
57 quvi_media_get(qm, QUVI_MEDIA_PROPERTY_TITLE, &s);
58 g_assert_cmpint(qerr(q), ==, QUVI_OK);
59 g_assert_cmpstr(s, ==, TITLE);
61 quvi_media_free(qm);
62 quvi_free(q);
65 gint main(gint argc, gchar **argv)
67 g_test_init(&argc, &argv, NULL);
68 g_test_add_func("/quvi/goto URL", test_goto_url);
69 return (g_test_run());
72 /* vim: set ts=2 sw=2 tw=72 expandtab: */