Update Copyright headers
[apps/home/video-player.git] / test / hb-test.h
1 /*
2  * Copyright © 2011  Google, Inc.
3  *
4  *  This is part of HarfBuzz, a text shaping library.
5  *
6  * Permission is hereby granted, without written agreement and without
7  * license or royalty fees, to use, copy, modify, and distribute this
8  * software and its documentation for any purpose, provided that the
9  * above copyright notice and the following two paragraphs appear in
10  * all copies of this software.
11  *
12  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16  * DAMAGE.
17  *
18  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
21  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23  *
24  * Google Author(s): Behdad Esfahbod
25  */
26
27 #ifndef HB_TEST_H
28 #define HB_TEST_H
29
30 #include <hb.h>
31 #include <hb-glib.h>
32
33 #include <glib.h>
34
35 #include <stdlib.h>
36
37 HB_BEGIN_DECLS
38
39 /* Just in case */
40 #undef G_DISABLE_ASSERT
41
42
43 /* Bugzilla helpers */
44
45 static inline void
46 hb_test_bug (const char *uri_base, unsigned int number)
47 {
48   char *s = g_strdup_printf ("%u", number);
49
50   g_test_bug_base (uri_base);
51   g_test_bug (s);
52
53   g_free (s);
54 }
55
56 static inline void
57 hb_test_bug_freedesktop (unsigned int number)
58 {
59   hb_test_bug ("http://bugs.freedesktop.org/", number);
60 }
61
62 static inline void
63 hb_test_bug_gnome (unsigned int number)
64 {
65   hb_test_bug ("http://bugzilla.gnome.org/", number);
66 }
67
68 static inline void
69 hb_test_bug_mozilla (unsigned int number)
70 {
71   hb_test_bug ("http://bugzilla.mozilla.org/", number);
72 }
73
74 static inline void
75 hb_test_bug_redhat (unsigned int number)
76 {
77   hb_test_bug ("http://bugzilla.redhat.com/", number);
78 }
79
80
81 /* Misc */
82
83 /* This is too ugly to be public API, but quite handy. */
84 #define HB_TAG_CHAR4(s)   (HB_TAG(((const char *) s)[0], \
85                                   ((const char *) s)[1], \
86                                   ((const char *) s)[2], \
87                                   ((const char *) s)[3]))
88 HB_END_DECLS
89
90 #endif /* HB_TEST_H */