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
29 gboolean
chk_env(const gchar
*, const gchar
*);
30 gboolean
chk_skip(const gchar
*);
31 void chk_verbose(quvi_t
);
32 gboolean
chk_geoblocked();
33 gboolean
chk_complete();
39 struct qm_test_exact_s
44 typedef struct qm_test_exact_s
*qm_test_exact_t
;
48 struct /* String value length >0 */
63 struct /* >0 (numeric) */
69 gboolean bitrate_kbit_s
;
75 gboolean bitrate_kbit_s
;
78 gboolean start_time_ms
;
82 typedef struct qm_test_opts_s
*qm_test_opts_t
;
84 /* Compare media property string values. */
85 #define qm_cmp_s(qmp, e)\
88 quvi_media_get(qm, qmp, &s);\
89 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
91 g_test_message("%s=%s", #qmp, s);\
92 g_assert_cmpstr(s, ==, e);\
95 /* Media property string value length >0 */
96 #define qm_chk_l(qmp)\
99 quvi_media_get(qm, qmp, &s);\
100 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
101 g_assert(s != NULL);\
102 g_test_message("%s=%s", #qmp, s);\
103 g_assert_cmpint(strlen(s), >, 0);\
106 /* Media property value (double) >0 */
107 #define qm_chk_gt0(qmp)\
110 quvi_media_get(qm, qmp, &v);\
111 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
112 g_test_message("%s=%g", #qmp, v);\
113 g_assert_cmpfloat(v, >, 0);\
116 void qm_test(const gchar
*, const gchar
*,
117 const qm_test_exact_t
, const qm_test_opts_t
);
121 struct qp_test_exact_s
125 typedef struct qp_test_exact_s
*qp_test_exact_t
;
127 struct qp_test_opts_s
135 gboolean thumbnail_url
;
142 gboolean duration_ms
;
146 typedef struct qp_test_opts_s
*qp_test_opts_t
;
148 /* Compare playlist property string values. */
149 #define qp_cmp_s(qpp, e)\
152 quvi_playlist_get(qp, qpp, &s);\
153 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
154 g_assert(s != NULL);\
155 g_test_message("%s=%s", #qpp, s);\
156 g_assert_cmpstr(s, ==, e);\
159 /* Playist property string value length >0 */
160 #define qp_chk_l(qpp)\
163 quvi_playlist_get(qp, qpp, &s);\
164 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
165 g_assert(s != NULL);\
166 g_test_message("%s=%s", #qpp, s);\
167 g_assert_cmpint(strlen(s), >, 0);\
170 /* Media property value (double) >0 */
171 #define qp_chk_gt0(qpp)\
174 quvi_playlist_get(qp, qpp, &v);\
175 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
176 g_test_message("%s=%g", #qpp, v);\
177 g_assert_cmpfloat(v, >, 0);\
180 void qp_test(const gchar
*, const gchar
*,
181 const qp_test_exact_t
, const qp_test_opts_t
);
185 struct qs_test_exact_s
188 const gint n
; /* Expected no. of returned media URLs. */
190 typedef struct qs_test_exact_s
*qs_test_exact_t
;
192 void qs_test(const gchar
*, qs_test_exact_t
);
196 gboolean
match(const gchar
*, const gchar
*);
197 gchar
*capture(const gchar
*, const gchar
*);
198 gchar
*fetch(const gchar
*);
202 /* vim: set ts=2 sw=2 tw=72 expandtab: */