2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program 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
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; 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_complete();
38 struct qm_test_exact_s
43 typedef struct qm_test_exact_s
*qm_test_exact_t
;
47 struct /* String value length >0 */
62 struct /* >0 (numeric) */
68 gboolean bitrate_kbit_s
;
74 gboolean bitrate_kbit_s
;
77 gboolean start_time_ms
;
81 typedef struct qm_test_opts_s
*qm_test_opts_t
;
83 /* Compare media property string values. */
84 #define qm_cmp_s(qmp, e)\
87 quvi_media_get(qm, qmp, &s);\
88 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
90 g_test_message("%s=%s", #qmp, s);\
91 g_assert_cmpstr(s, ==, e);\
94 /* Media property string value length >0 */
95 #define qm_chk_l(qmp)\
98 quvi_media_get(qm, qmp, &s);\
99 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
100 g_assert(s != NULL);\
101 g_test_message("%s=%s", #qmp, s);\
102 g_assert_cmpint(strlen(s), >, 0);\
105 /* Media property value (double) >0 */
106 #define qm_chk_gt0(qmp)\
109 quvi_media_get(qm, qmp, &v);\
110 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
111 g_test_message("%s=%g", #qmp, v);\
112 g_assert_cmpfloat(v, >, 0);\
115 void qm_test(const gchar
*, const gchar
*,
116 const qm_test_exact_t
, const qm_test_opts_t
);
120 struct qp_test_exact_s
124 typedef struct qp_test_exact_s
*qp_test_exact_t
;
126 struct qp_test_opts_s
134 gboolean thumbnail_url
;
141 gboolean duration_ms
;
145 typedef struct qp_test_opts_s
*qp_test_opts_t
;
147 /* Compare playlist property string values. */
148 #define qp_cmp_s(qpp, e)\
151 quvi_playlist_get(qp, qpp, &s);\
152 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
153 g_assert(s != NULL);\
154 g_test_message("%s=%s", #qpp, s);\
155 g_assert_cmpstr(s, ==, e);\
158 /* Playist property string value length >0 */
159 #define qp_chk_l(qpp)\
162 quvi_playlist_get(qp, qpp, &s);\
163 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
164 g_assert(s != NULL);\
165 g_test_message("%s=%s", #qpp, s);\
166 g_assert_cmpint(strlen(s), >, 0);\
169 /* Media property value (double) >0 */
170 #define qp_chk_gt0(qpp)\
173 quvi_playlist_get(qp, qpp, &v);\
174 g_assert_cmpint(qerr(q), ==, QUVI_OK);\
175 g_test_message("%s=%g", #qpp, v);\
176 g_assert_cmpfloat(v, >, 0);\
179 void qp_test(const gchar
*, const gchar
*,
180 const qp_test_exact_t
, const qp_test_opts_t
);
184 struct qs_test_exact_s
187 const gint n
; /* Expected no. of returned media URLs. */
189 typedef struct qs_test_exact_s
*qs_test_exact_t
;
191 void qs_test(const gchar
*, qs_test_exact_t
);
195 gboolean
match(const gchar
*, const gchar
*);
196 gchar
*capture(const gchar
*, const gchar
*);
197 gchar
*fetch(const gchar
*);
201 /* vim: set ts=2 sw=2 tw=72 expandtab: */