1 /* Test program, used by the format-c-4 test.
2 Copyright (C) 2002 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 #ifdef HAVE_INTTYPES_H
27 # include <inttypes.h>
31 /* Make sure we use the included libintl, not the system's one. */
33 #include "libgnuintl.h"
35 #define _(string) gettext (string)
37 /* Fallback definition. */
38 #if !defined PRId8 || PRI_MACROS_BROKEN
44 main (int argc
, char *argv
[])
52 xsetenv ("LC_ALL", argv
[1], 1);
53 if (setlocale (LC_ALL
, "") == NULL
)
55 fprintf (stderr
, "Couldn't set locale.\n");
60 bindtextdomain ("fc4", ".");
62 s
= ngettext ("father of %"PRId8
" child", "father of %"PRId8
" children", n
);
63 c1
= "Vater von %"; c2
= " Kindern";
65 if (!(strlen (s
) > strlen (c1
) + strlen (c2
)
66 && memcmp (s
, c1
, strlen (c1
)) == 0
67 && memcmp (s
+ strlen (s
) - strlen (c2
), c2
, strlen (c2
)) == 0))
69 fprintf (stderr
, "String not translated.\n");
72 if (strchr (s
, '<') != NULL
|| strchr (s
, '>') != NULL
)
74 fprintf (stderr
, "Translation contains <...> markers.\n");
78 if (strcmp (buf
, "Vater von 5 Kindern") != 0)
80 fprintf (stderr
, "printf of translation wrong.\n");