~vcs-imports/eglibc/trunk

« back to all changes in this revision

Viewing changes to libc/string/test-strncasecmp.c

  • Committer: joseph
  • Date: 2013-09-05 22:41:05 UTC
  • Revision ID: svn-v4:7b3dc134-2b1b-0410-93df-9e9f96275f8d:trunk:23928
Merge changes between r23795 and r23927 from /fsf/trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
   License along with the GNU C Library; if not, see
18
18
   <http://www.gnu.org/licenses/>.  */
19
19
 
 
20
#include <locale.h>
20
21
#include <ctype.h>
21
22
#define TEST_MAIN
22
23
#define TEST_NAME "strncasecmp"
256
257
    check_result (impl, empty_string, "", 5, 0);
257
258
}
258
259
 
259
 
int
260
 
test_main (void)
 
260
static void
 
261
test_locale (const char *locale)
261
262
{
262
263
  size_t i;
263
264
 
264
 
  test_init ();
 
265
  if (setlocale (LC_CTYPE, locale) == NULL)
 
266
    {
 
267
      error (0, 0, "cannot set locale \"%s\"", locale);
 
268
      ret = 1;
 
269
    }
265
270
 
266
271
  bz12205 ();
267
272
  bz14195 ();
268
273
 
269
 
  printf ("%23s", "");
 
274
  printf ("%23s", locale);
270
275
  FOR_EACH_IMPL (impl, 0)
271
276
    printf ("\t%s", impl->name);
272
277
  putchar ('\n');
329
334
    }
330
335
 
331
336
  do_random_tests ();
 
337
}
 
338
 
 
339
int
 
340
test_main (void)
 
341
{
 
342
  test_init ();
 
343
 
 
344
  test_locale ("C");
 
345
  test_locale ("en_US.ISO-8859-1");
 
346
  test_locale ("en_US.UTF-8");
 
347
  test_locale ("tr_TR.ISO-8859-9");
 
348
  test_locale ("tr_TR.UTF-8");
 
349
 
332
350
  return ret;
333
351
}
334
352