quvi_supports: Handle QUVI_SUPPORTS_TYPE_SUBTITLE
[libquvi.git] / tests / goto.c
blob0f6d1d8a875bb3a9686f40ae67f45ba3f22cf690
1 /* libquvi
2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This file is part of libquvi <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 /* academicearth.lua uses the "goto_url" instruction. */
31 static const gchar URL[] =
32 "http://www.academicearth.org/lectures/intro-roman-architecture";
34 static const gchar TITLE[] = "1. Introduction to Roman Architecture";
36 static void test_goto_url()
38 quvi_media_t qm;
39 quvi_t q;
40 gchar *s;
42 if (chk_internet() == FALSE || chk_skip(__func__) == TRUE)
43 return;
45 q = quvi_new();
46 g_assert(q != NULL);
47 g_assert_cmpint(qerr(q), ==, QUVI_OK);
49 chk_verbose(q);
51 qm = quvi_media_new(q, URL);
52 g_assert_cmpint(qerr_m(q, URL), ==, QUVI_OK);
53 g_assert(qm != NULL);
55 quvi_media_get(qm, QUVI_MEDIA_PROPERTY_TITLE, &s);
56 g_assert_cmpint(qerr(q), ==, QUVI_OK);
57 g_assert_cmpstr(s, ==, TITLE);
59 quvi_media_free(qm);
60 quvi_free(q);
63 gint main(gint argc, gchar **argv)
65 g_test_init(&argc, &argv, NULL);
66 g_test_add_func("/quvi/goto URL", test_goto_url);
67 return (g_test_run());
70 /* vim: set ts=2 sw=2 tw=72 expandtab: */