Blame gettext-tools/gnulib-tests/test-wctype-h.c

Packit Bot 06c835
/* Test of <wctype.h> substitute.
Packit Bot 06c835
   Copyright (C) 2007-2015 Free Software Foundation, Inc.
Packit Bot 06c835
Packit Bot 06c835
   This program is free software: you can redistribute it and/or modify
Packit Bot 06c835
   it under the terms of the GNU General Public License as published by
Packit Bot 06c835
   the Free Software Foundation; either version 3 of the License, or
Packit Bot 06c835
   (at your option) any later version.
Packit Bot 06c835
Packit Bot 06c835
   This program is distributed in the hope that it will be useful,
Packit Bot 06c835
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 06c835
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Bot 06c835
   GNU General Public License for more details.
Packit Bot 06c835
Packit Bot 06c835
   You should have received a copy of the GNU General Public License
Packit Bot 06c835
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Bot 06c835
Packit Bot 06c835
/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
Packit Bot 06c835
Packit Bot 06c835
#include <config.h>
Packit Bot 06c835
Packit Bot 06c835
#include <wctype.h>
Packit Bot 06c835
Packit Bot 06c835
#include "macros.h"
Packit Bot 06c835
Packit Bot 06c835
/* Check that the type wint_t is defined.  */
Packit Bot 06c835
wint_t a = 'x';
Packit Bot 06c835
/* Check that WEOF is defined.  */
Packit Bot 06c835
wint_t e = WEOF;
Packit Bot 06c835
Packit Bot 06c835
/* Check that the type wctype_t is defined.  */
Packit Bot 06c835
wctype_t p;
Packit Bot 06c835
Packit Bot 06c835
/* Check that the type wctrans_t is defined.  */
Packit Bot 06c835
wctrans_t q;
Packit Bot 06c835
Packit Bot 06c835
int
Packit Bot 06c835
main (void)
Packit Bot 06c835
{
Packit Bot 06c835
  /* Check that the isw* functions exist as functions or as macros.  */
Packit Bot 06c835
  (void) iswalnum (0);
Packit Bot 06c835
  (void) iswalpha (0);
Packit Bot 06c835
  (void) iswcntrl (0);
Packit Bot 06c835
  (void) iswdigit (0);
Packit Bot 06c835
  (void) iswgraph (0);
Packit Bot 06c835
  (void) iswlower (0);
Packit Bot 06c835
  (void) iswprint (0);
Packit Bot 06c835
  (void) iswpunct (0);
Packit Bot 06c835
  (void) iswspace (0);
Packit Bot 06c835
  (void) iswupper (0);
Packit Bot 06c835
  (void) iswxdigit (0);
Packit Bot 06c835
Packit Bot 06c835
  /* Check that the isw* functions map WEOF to 0.  */
Packit Bot 06c835
  ASSERT (!iswalnum (e));
Packit Bot 06c835
  ASSERT (!iswalpha (e));
Packit Bot 06c835
  ASSERT (!iswcntrl (e));
Packit Bot 06c835
  ASSERT (!iswdigit (e));
Packit Bot 06c835
  ASSERT (!iswgraph (e));
Packit Bot 06c835
  ASSERT (!iswlower (e));
Packit Bot 06c835
  ASSERT (!iswprint (e));
Packit Bot 06c835
  ASSERT (!iswpunct (e));
Packit Bot 06c835
  ASSERT (!iswspace (e));
Packit Bot 06c835
  ASSERT (!iswupper (e));
Packit Bot 06c835
  ASSERT (!iswxdigit (e));
Packit Bot 06c835
Packit Bot 06c835
  /* Check that the tow* functions exist as functions or as macros.  */
Packit Bot 06c835
  (void) towlower (0);
Packit Bot 06c835
  (void) towupper (0);
Packit Bot 06c835
Packit Bot 06c835
  /* Check that the tow* functions map WEOF to WEOF.  */
Packit Bot 06c835
  ASSERT (towlower (e) == e);
Packit Bot 06c835
  ASSERT (towupper (e) == e);
Packit Bot 06c835
Packit Bot 06c835
  return 0;
Packit Bot 06c835
}