1/*
2 * fontconfig/test/test-bz89617.c
3 *
4 * Copyright © 2000 Keith Packard
5 * Copyright © 2015 Akira TAGOH
6 *
7 * Permission to use, copy, modify, distribute, and sell this software and its
8 * documentation for any purpose is hereby granted without fee, provided that
9 * the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of the author(s) not be used in
12 * advertising or publicity pertaining to distribution of the software without
13 * specific, written prior permission.  The authors make no
14 * representations about the suitability of this software for any purpose.  It
15 * is provided "as is" without express or implied warranty.
16 *
17 * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19 * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23 * PERFORMANCE OF THIS SOFTWARE.
24 */
25#include <stdio.h>
26#include <fontconfig/fontconfig.h>
27
28FcLangResult
29comp(const FcChar8 *l1, const FcChar8 *l2)
30{
31    FcLangSet *ls1, *ls2;
32    FcLangResult result;
33
34    ls1 = FcLangSetCreate();
35    ls2 = FcLangSetCreate();
36    FcLangSetAdd(ls1, l1);
37    FcLangSetAdd(ls2, l2);
38
39    result = FcLangSetCompare(ls1, ls2);
40    FcLangSetDestroy(ls1);
41    FcLangSetDestroy(ls2);
42
43    return result;
44}
45
46int
47main(void)
48{
49    int i = 1;
50
51    /* 1 */
52    if (comp((const FcChar8 *)"ku-am", (const FcChar8 *)"ku-iq") != FcLangDifferentTerritory)
53	return i;
54    i++;
55    /* 2 */
56    if (comp((const FcChar8 *)"ku-am", (const FcChar8 *)"ku-ir") != FcLangDifferentTerritory)
57	return i;
58    i++;
59    /* 3 */
60    if (comp((const FcChar8 *)"ku-am", (const FcChar8 *)"ku-tr") != FcLangDifferentTerritory)
61	return i;
62    i++;
63    /* 4 */
64    if (comp((const FcChar8 *)"ku-iq", (const FcChar8 *)"ku-ir") != FcLangDifferentTerritory)
65	return i;
66    i++;
67    /* 5 */
68    if (comp((const FcChar8 *)"ku-iq", (const FcChar8 *)"ku-tr") != FcLangDifferentTerritory)
69	return i;
70    i++;
71    /* 6 */
72    if (comp((const FcChar8 *)"ku-ir", (const FcChar8 *)"ku-tr") != FcLangDifferentTerritory)
73	return i;
74    i++;
75    /* 7 */
76    if (comp((const FcChar8 *)"ps-af", (const FcChar8 *)"ps-pk") != FcLangDifferentTerritory)
77	return i;
78    i++;
79    /* 8 */
80    if (comp((const FcChar8 *)"ti-er", (const FcChar8 *)"ti-et") != FcLangDifferentTerritory)
81	return i;
82    i++;
83    /* 9 */
84    if (comp((const FcChar8 *)"zh-cn", (const FcChar8 *)"zh-hk") != FcLangDifferentTerritory)
85	return i;
86    i++;
87    /* 10 */
88    if (comp((const FcChar8 *)"zh-cn", (const FcChar8 *)"zh-mo") != FcLangDifferentTerritory)
89	return i;
90    i++;
91    /* 11 */
92    if (comp((const FcChar8 *)"zh-cn", (const FcChar8 *)"zh-sg") != FcLangDifferentTerritory)
93	return i;
94    i++;
95    /* 12 */
96    if (comp((const FcChar8 *)"zh-cn", (const FcChar8 *)"zh-tw") != FcLangDifferentTerritory)
97	return i;
98    i++;
99    /* 13 */
100    if (comp((const FcChar8 *)"zh-hk", (const FcChar8 *)"zh-mo") != FcLangDifferentTerritory)
101	return i;
102    i++;
103    /* 14 */
104    if (comp((const FcChar8 *)"zh-hk", (const FcChar8 *)"zh-sg") != FcLangDifferentTerritory)
105	return i;
106    i++;
107    /* 15 */
108    if (comp((const FcChar8 *)"zh-hk", (const FcChar8 *)"zh-tw") != FcLangDifferentTerritory)
109	return i;
110    i++;
111    /* 16 */
112    if (comp((const FcChar8 *)"zh-mo", (const FcChar8 *)"zh-sg") != FcLangDifferentTerritory)
113	return i;
114    i++;
115    /* 17 */
116    if (comp((const FcChar8 *)"zh-mo", (const FcChar8 *)"zh-tw") != FcLangDifferentTerritory)
117	return i;
118    i++;
119    /* 18 */
120    if (comp((const FcChar8 *)"zh-sg", (const FcChar8 *)"zh-tw") != FcLangDifferentTerritory)
121	return i;
122    i++;
123    /* 19 */
124    if (comp((const FcChar8 *)"mn-mn", (const FcChar8 *)"mn-cn") != FcLangDifferentTerritory)
125	return i;
126    i++;
127    /* 20 */
128    if (comp((const FcChar8 *)"pap-an", (const FcChar8 *)"pap-aw") != FcLangDifferentTerritory)
129	return i;
130    i++;
131
132    return 0;
133}
134
135
136