(root)/
gettext-0.22.4/
gettext-tools/
tests/
intl-version-prg.c
       1  /* Test of public API of <libintl.h>.
       2     Copyright (C) 2019 Free Software Foundation, Inc.
       3     Written by Bruno Haible <bruno@clisp.org>, 2019.
       4  
       5     This program is free software: you can redistribute it and/or modify
       6     it under the terms of the GNU General Public License as published by
       7     the Free Software Foundation; either version 3 of the License, or
       8     (at your option) any later version.
       9  
      10     This program is distributed in the hope that it will be useful,
      11     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13     GNU General Public License for more details.
      14  
      15     You should have received a copy of the GNU General Public License
      16     along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
      17  
      18  #ifdef HAVE_CONFIG_H
      19  # include <config.h>
      20  #endif
      21  
      22  /* Make sure we use the included libintl, not the system's one. */
      23  #undef _LIBINTL_H
      24  #include "libgnuintl.h"
      25  
      26  #include <stdio.h>
      27  #include <stdlib.h>
      28  #include <string.h>
      29  
      30  /* Use the system functions, not the gnulib overrides in this file.  */
      31  #undef fflush
      32  #undef fprintf
      33  
      34  #define ASSERT(expr) \
      35    do                                                                         \
      36      {                                                                        \
      37        if (!(expr))                                                           \
      38          {                                                                    \
      39            fprintf (stderr, "%s:%d: assertion failed\n",                      \
      40                     __FILE__, __LINE__);                                      \
      41            fflush (stderr);                                                   \
      42            abort ();                                                          \
      43          }                                                                    \
      44      }                                                                        \
      45    while (0)
      46  
      47  int
      48  main (int argc, char *argv[])
      49  {
      50    /* Test LIBINTL_VERSION.  */
      51    {
      52      enum { version = LIBINTL_VERSION };
      53    }
      54  
      55    /* Test libintl_version.  */
      56    ASSERT (libintl_version == LIBINTL_VERSION);
      57  
      58    return 0;
      59  }