2 * Copyright (C) 2012 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/>.
30 gboolean
chk_env(const gchar
*, const gchar
*);
31 gboolean
chk_skip(const gchar
*);
32 void chk_verbose(quvi_t
);
33 gboolean
chk_geoblocked();
34 gboolean
chk_complete();
40 struct qm_test_exact_s
45 typedef struct qm_test_exact_s
*qm_test_exact_t
;
49 struct /* String value length >0 */
64 struct /* >0 (numeric) */
70 gboolean bitrate_kbit_s
;
76 gboolean bitrate_kbit_s
;
79 gboolean start_time_ms
;
83 typedef struct qm_test_opts_s
*qm_test_opts_t
;
85 /* Compare media property string values. */
86 #define qm_cmp_s(qmp, e)\
89 quvi_media_get(qm, qmp, &s);\
90 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
92 g_test_message("%s=%s", #qmp, s);\
93 g_assert_cmpstr(s, ==, e);\
96 /* Media property string value length >0 */
97 #define qm_chk_l(qmp)\
100 quvi_media_get(qm, qmp, &s);\
101 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
102 g_assert(s != NULL);\
103 g_test_message("%s=%s", #qmp, s);\
104 g_assert_cmpint(strlen(s), >, 0);\
107 /* Media property value (double) >0 */
108 #define qm_chk_gt0(qmp)\
111 quvi_media_get(qm, qmp, &v);\
112 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
113 g_test_message("%s=%g", #qmp, v);\
114 g_assert_cmpfloat(v, >, 0);\
117 void qm_test(const gchar
*, const gchar
*,
118 const qm_test_exact_t
, const qm_test_opts_t
);
122 struct qp_test_exact_s
126 typedef struct qp_test_exact_s
*qp_test_exact_t
;
128 struct qp_test_opts_s
136 gboolean thumbnail_url
;
143 gboolean duration_ms
;
147 typedef struct qp_test_opts_s
*qp_test_opts_t
;
149 /* Compare playlist property string values. */
150 #define qp_cmp_s(qpp, e)\
153 quvi_playlist_get(qp, qpp, &s);\
154 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
155 g_assert(s != NULL);\
156 g_test_message("%s=%s", #qpp, s);\
157 g_assert_cmpstr(s, ==, e);\
160 /* Playist property string value length >0 */
161 #define qp_chk_l(qpp)\
164 quvi_playlist_get(qp, qpp, &s);\
165 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
166 g_assert(s != NULL);\
167 g_test_message("%s=%s", #qpp, s);\
168 g_assert_cmpint(strlen(s), >, 0);\
171 /* Media property value (double) >0 */
172 #define qp_chk_gt0(qpp)\
175 quvi_playlist_get(qp, qpp, &v);\
176 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
177 g_test_message("%s=%g", #qpp, v);\
178 g_assert_cmpfloat(v, >, 0);\
181 void qp_test(const gchar
*, const gchar
*,
182 const qp_test_exact_t
, const qp_test_opts_t
);
186 struct qs_test_exact_s
189 const gint n
; /* Expected no. of returned media URLs. */
191 typedef struct qs_test_exact_s
*qs_test_exact_t
;
193 void qs_test(const gchar
*, qs_test_exact_t
);
197 gboolean
match(const gchar
*, const gchar
*);
198 gchar
*capture(const gchar
*, const gchar
*);
199 gchar
*fetch(const gchar
*);
203 /* vim: set ts=2 sw=2 tw=72 expandtab: */