Mercurial > gnulib
annotate tests/unicase/test-ulc-casecoll.c @ 40057:b06060465f09
maint: Run 'make update-copyright'
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 01 Jan 2019 00:25:11 +0100 |
parents | 10eb9086bea0 |
children |
rev | line source |
---|---|
11389
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* Test of locale dependent, case and normalization insensitive comparison of |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 strings. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
3 Copyright (C) 2009-2019 Free Software Foundation, Inc. |
11389
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 it under the terms of the GNU General Public License as published by |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 the Free Software Foundation; either version 3 of the License, or |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 (at your option) any later version. |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 GNU General Public License for more details. |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU General Public License |
19190 | 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
11389
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 /* Written by Bruno Haible <bruno@clisp.org>, 2009. */ |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 #include <config.h> |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 #include "unicase.h" |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 #include <locale.h> |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 #include "uninorm.h" |
12496
a48d3d749ca5
Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
27 #include "macros.h" |
11389
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 #define UNIT char |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 #include "test-casecmp.h" |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 #undef UNIT |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 int |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 main () |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 { |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 /* configure should already have checked that the locale is supported. */ |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 if (setlocale (LC_ALL, "") == NULL) |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 return 1; |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 /* In the "C" locale, strcoll is equivalent to strcmp, therefore u8_casecoll |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 on ASCII strings should behave like strcasecmp. */ |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
42 test_ascii (ulc_casecoll, UNINORM_NFC); |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
43 |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
44 return 0; |
7e97400ba811
Tests for module 'unicase/ulc-casecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 } |