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
31 quvi_verify_get(qv, p, &s);\
33 g_test_message("%s=%s", #p, s);\
34 g_assert_cmpint(strlen(s), >, 1);\
40 quvi_verify_get(qv, p, &n);\
41 g_test_message("%s=%f", #p, n);\
42 g_assert_cmpfloat(n, >, -1);\
45 static void test_verify()
47 static const gchar URL
[] = "http://is.gd/SKyg8m";
53 if (chk_internet() == FALSE
)
56 if (chk_skip(__func__
) == TRUE
)
61 g_assert_cmpint(qerr(q
), ==, QUVI_OK
);
65 qv
= quvi_verify_new(q
, URL
);
66 g_assert_cmpint(qerr_m(q
, URL
), ==, QUVI_OK
);
69 quvi_verify_get(qv
, QUVI_VERIFY_PROPERTY_FILE_EXTENSION
-1, &v
);
70 g_assert_cmpint(qerr(q
), ==, QUVI_ERROR_INVALID_ARG
);
72 quvi_verify_get(qv
, QUVI_VERIFY_PROPERTY_LENGTH_BYTES
+1, &v
);
73 g_assert_cmpint(qerr(q
), ==, QUVI_ERROR_INVALID_ARG
);
75 chk_len(QUVI_VERIFY_PROPERTY_FILE_EXTENSION
);
76 chk_len(QUVI_VERIFY_PROPERTY_CONTENT_TYPE
);
78 chk_val(QUVI_VERIFY_PROPERTY_LENGTH_BYTES
);
84 gint
main(gint argc
, gchar
**argv
)
86 g_test_init(&argc
, &argv
, NULL
);
87 g_test_add_func("/quvi/verify", test_verify
);
88 return (g_test_run());
91 /* vim: set ts=2 sw=2 tw=72 expandtab: */