X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flibpspp%2Fi18n-test.c;h=b0d027090e967a51977e6fe98c8669fe1a621e8b;hb=refs%2Fheads%2Fpivot-table2;hp=b433756b0d21b2a1d9e455f1833de3b43eba006b;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/tests/libpspp/i18n-test.c b/tests/libpspp/i18n-test.c index b433756b0d..b0d027090e 100644 --- a/tests/libpspp/i18n-test.c +++ b/tests/libpspp/i18n-test.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,20 @@ main (int argc, char *argv[]) { i18n_init (); + if (argc > 1 && !strcmp (argv[1], "supports_encodings")) + { + int status = 0; + int i; + + for (i = 2; i < argc; i++) + if (!is_encoding_supported (argv[i])) + { + printf ("encoding \"%s\" is NOT supported\n", argv[i]); + status = 77; + } + i18n_done (); + exit (status); + } if (argc == 5 && !strcmp (argv[1], "recode")) { const char *from = argv[2]; @@ -68,6 +82,10 @@ main (int argc, char *argv[]) else { fprintf (stderr, "\ +usage: %s supports_encodings ENCODING...\n\ +where ENCODING is the name of an encoding.\n\ +Exits with status 0 if all the encodings are supported, 77 otherwise.\n\ +\n\ usage: %s recode FROM TO STRING\n\ where FROM is the source encoding,\n\ TO is the target encoding,\n\ @@ -78,7 +96,7 @@ where HEAD is the first string to concatenate\n\ TAIL is the second string to concatenate\n\ ENCODING is the encoding in which to measure the result's length\n\ MAX_LEN is the maximum length of the result in ENCODING.\n", - argv[0], argv[0]); + argv[0], argv[0], argv[0]); return EXIT_FAILURE; }