~ubuntu-branches/ubuntu/vivid/diffutils/vivid

« back to all changes in this revision

Viewing changes to gnulib-tests/test-nl_langinfo.c

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2010-02-13 11:49:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100213114900-09lz8jx6wct52qp8
Tags: 1:2.9-1
* New upstream release, now under GPL version 3 or later.
* There is now a --tab-size option. Closes: #82923.
* Manpage for cmp describes exit status. Closes: #200614.
* Manpage for diff describes exit status. Closes: #228441, #473233.
* The file de.po is now more recent. Closes: #313686.
* Fixed bad sdiff behaviour. Closes: #320222.
* Added wdiff to Suggests. Closes: #324627.
* Fixed cmp behaviour regarding stdout and stderr. Closes: #356083.
* The file ru.po is now more recent. Closes: #409274.
* The file es.po is now more recent. Closes: #418005, #481708.
* The file nl.po is now more recent. Closes: #427370.
* Modified watch file to use http instead of ftp.
* Removed .comment section from executables.
* Added Homepage field to control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- buffer-read-only: t -*- vi: set ro: */
 
2
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 
3
#line 1
 
4
/* Test of nl_langinfo replacement.
 
5
   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
6
 
 
7
   This program is free software: you can redistribute it and/or modify
 
8
   it under the terms of the GNU General Public License as published by
 
9
   the Free Software Foundation; either version 3 of the License, or
 
10
   (at your option) any later version.
 
11
 
 
12
   This program is distributed in the hope that it will be useful,
 
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
   GNU General Public License for more details.
 
16
 
 
17
   You should have received a copy of the GNU General Public License
 
18
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
19
 
 
20
/* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
21
 
 
22
#include <config.h>
 
23
 
 
24
#include <langinfo.h>
 
25
 
 
26
#include "signature.h"
 
27
SIGNATURE_CHECK (nl_langinfo, char *, (nl_item));
 
28
 
 
29
#include <locale.h>
 
30
#include <stdlib.h>
 
31
#include <string.h>
 
32
 
 
33
#include "c-strcase.h"
 
34
#include "macros.h"
 
35
 
 
36
int
 
37
main (int argc, char *argv[])
 
38
{
 
39
  int pass = atoi (argv[1]);
 
40
  /* pass    locale
 
41
      0        C
 
42
      1        traditional French locale
 
43
      2        French UTF-8 locale
 
44
   */
 
45
 
 
46
  setlocale (LC_ALL, "");
 
47
 
 
48
  /* nl_langinfo items of the LC_CTYPE category */
 
49
  ASSERT (strlen (nl_langinfo (CODESET)) > 0);
 
50
  if (pass == 2)
 
51
    {
 
52
      const char *codeset = nl_langinfo (CODESET);
 
53
      ASSERT (c_strcasecmp (codeset, "UTF-8") == 0 || c_strcasecmp (codeset, "UTF8") == 0);
 
54
    }
 
55
  /* nl_langinfo items of the LC_NUMERIC category */
 
56
  ASSERT (strlen (nl_langinfo (RADIXCHAR)) > 0);
 
57
  ASSERT (strlen (nl_langinfo (THOUSEP)) >= 0);
 
58
  /* nl_langinfo items of the LC_TIME category */
 
59
  ASSERT (strlen (nl_langinfo (D_T_FMT)) > 0);
 
60
  ASSERT (strlen (nl_langinfo (D_FMT)) > 0);
 
61
  ASSERT (strlen (nl_langinfo (T_FMT)) > 0);
 
62
  ASSERT (strlen (nl_langinfo (T_FMT_AMPM)) >= (pass == 0 ? 1 : 0));
 
63
  ASSERT (strlen (nl_langinfo (AM_STR)) >= (pass == 0 ? 1 : 0));
 
64
  ASSERT (strlen (nl_langinfo (PM_STR)) >= (pass == 0 ? 1 : 0));
 
65
  ASSERT (strlen (nl_langinfo (DAY_1)) > 0);
 
66
  ASSERT (strlen (nl_langinfo (DAY_2)) > 0);
 
67
  ASSERT (strlen (nl_langinfo (DAY_3)) > 0);
 
68
  ASSERT (strlen (nl_langinfo (DAY_4)) > 0);
 
69
  ASSERT (strlen (nl_langinfo (DAY_5)) > 0);
 
70
  ASSERT (strlen (nl_langinfo (DAY_6)) > 0);
 
71
  ASSERT (strlen (nl_langinfo (DAY_7)) > 0);
 
72
  ASSERT (strlen (nl_langinfo (ABDAY_1)) > 0);
 
73
  ASSERT (strlen (nl_langinfo (ABDAY_2)) > 0);
 
74
  ASSERT (strlen (nl_langinfo (ABDAY_3)) > 0);
 
75
  ASSERT (strlen (nl_langinfo (ABDAY_4)) > 0);
 
76
  ASSERT (strlen (nl_langinfo (ABDAY_5)) > 0);
 
77
  ASSERT (strlen (nl_langinfo (ABDAY_6)) > 0);
 
78
  ASSERT (strlen (nl_langinfo (ABDAY_7)) > 0);
 
79
  ASSERT (strlen (nl_langinfo (MON_1)) > 0);
 
80
  ASSERT (strlen (nl_langinfo (MON_2)) > 0);
 
81
  ASSERT (strlen (nl_langinfo (MON_3)) > 0);
 
82
  ASSERT (strlen (nl_langinfo (MON_4)) > 0);
 
83
  ASSERT (strlen (nl_langinfo (MON_5)) > 0);
 
84
  ASSERT (strlen (nl_langinfo (MON_6)) > 0);
 
85
  ASSERT (strlen (nl_langinfo (MON_7)) > 0);
 
86
  ASSERT (strlen (nl_langinfo (MON_8)) > 0);
 
87
  ASSERT (strlen (nl_langinfo (MON_9)) > 0);
 
88
  ASSERT (strlen (nl_langinfo (MON_10)) > 0);
 
89
  ASSERT (strlen (nl_langinfo (MON_11)) > 0);
 
90
  ASSERT (strlen (nl_langinfo (MON_12)) > 0);
 
91
  ASSERT (strlen (nl_langinfo (ABMON_1)) > 0);
 
92
  ASSERT (strlen (nl_langinfo (ABMON_2)) > 0);
 
93
  ASSERT (strlen (nl_langinfo (ABMON_3)) > 0);
 
94
  ASSERT (strlen (nl_langinfo (ABMON_4)) > 0);
 
95
  ASSERT (strlen (nl_langinfo (ABMON_5)) > 0);
 
96
  ASSERT (strlen (nl_langinfo (ABMON_6)) > 0);
 
97
  ASSERT (strlen (nl_langinfo (ABMON_7)) > 0);
 
98
  ASSERT (strlen (nl_langinfo (ABMON_8)) > 0);
 
99
  ASSERT (strlen (nl_langinfo (ABMON_9)) > 0);
 
100
  ASSERT (strlen (nl_langinfo (ABMON_10)) > 0);
 
101
  ASSERT (strlen (nl_langinfo (ABMON_11)) > 0);
 
102
  ASSERT (strlen (nl_langinfo (ABMON_12)) > 0);
 
103
  ASSERT (strlen (nl_langinfo (ERA)) >= 0);
 
104
  ASSERT (strlen (nl_langinfo (ERA_D_FMT)) >= 0);
 
105
  ASSERT (strlen (nl_langinfo (ERA_D_T_FMT)) >= 0);
 
106
  ASSERT (strlen (nl_langinfo (ERA_T_FMT)) >= 0);
 
107
  ASSERT (nl_langinfo (ALT_DIGITS) != NULL);
 
108
  /* nl_langinfo items of the LC_MONETARY category */
 
109
  {
 
110
    const char *currency = nl_langinfo (CRNCYSTR);
 
111
    ASSERT (strlen (currency) >= (pass > 0 ? 1 : 0));
 
112
  }
 
113
  /* nl_langinfo items of the LC_MESSAGES category */
 
114
  ASSERT (strlen (nl_langinfo (YESEXPR)) > 0);
 
115
  ASSERT (strlen (nl_langinfo (NOEXPR)) > 0);
 
116
 
 
117
  return 0;
 
118
}