示例#1
0
void xlocale2_check_functions(nl_item ni, locale_t l)
{
    /* ctype.h */
    (void)isalnum_l(0, l);
    (void)isdigit_l(0, l);
    (void)isxdigit_l(0, l);
    /* inttypes.h */
    (void)strtoimax_l("", (char**)1234, 10, l);
    /* langinfo.h */
    (void)nl_langinfo_l(ni, l);
    /* monetary.h */
    (void)strfmon_l((char*)1234, (size_t)0, l, "%n", 0.0);
    /* stdio.h */
    (void)printf_l(l, "%d", 0);
    /* stdlib.h */
    (void)strtol_l("", (char**)1234, 10, l);
    /* string.h */
    (void)strcoll_l("", "", l);
    /* time.h */
    (void)strftime_l((char*)1234, (size_t)0, "%s", (const struct tm *)1234, l);
    /* wchar.h */
    (void)wcstol_l(L"", (wchar_t**)1234, 10, l);
    /* wctype.h */
    (void)iswalnum_l((wint_t)0, l);
    (void)iswdigit_l((wint_t)0, l);
    (void)iswxdigit_l((wint_t)0, l);
}
示例#2
0
/* Test one value using the locale loc.  */
static void
test_one (const char *format, double value, const char *expected)
{
  static char actual[64];
  int result = strfmon_l (actual, sizeof (actual), loc, format, value);
  if (result < 0)
    {
      printf ("error: locale %s, format \"%s\", value %g: strfmon_l: %m\n",
              loc_name, format, value);
      errors = true;
    }
  else if (strcmp (actual, expected) != 0)
    {
      printf ("error: locale %s, format \"%s\", value %g: mismatch\n",
              loc_name, format, value);
      printf ("error:   expected: \"%s\"\n", expected);
      printf ("error:   actual:   \"%s\"\n", actual);
      errors = true;
    }
}