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