summaryrefslogtreecommitdiff
path: root/catgets
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
commit4dd9e35bfd35d3138bc44169baba098005bad51e (patch)
treea4939c43a9c3fe00eb27f023e14acc5e1fe8808c /catgets
parentbd42a4599d1b6f77bcfe1e4f67b7cbd9e1cb2dfd (diff)
parentf76453c31593957fec1a99b986bfa5506618b79c (diff)
Merge commit 'refs/top-bases/t/bigmem' into t/bigmem
Diffstat (limited to 'catgets')
-rw-r--r--catgets/Makefile48
-rw-r--r--catgets/catgets.c2
-rw-r--r--catgets/catgetsinfo.h2
-rw-r--r--catgets/gencat.c4
-rw-r--r--catgets/nl_types.h2
-rw-r--r--catgets/open_catalog.c6
-rw-r--r--catgets/test-gencat.c7
-rwxr-xr-xcatgets/test-gencat.sh13
-rw-r--r--catgets/tst-catgets.c7
-rw-r--r--catgets/xopen-msg.awk2
10 files changed, 54 insertions, 39 deletions
diff --git a/catgets/Makefile b/catgets/Makefile
index c95442d369..4624a88bd5 100644
--- a/catgets/Makefile
+++ b/catgets/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,8 @@
#
subdir := catgets
+include ../Makeconfig
+
headers = nl_types.h
routines = catgets open_catalog
others = gencat
@@ -29,6 +31,11 @@ extra-objs = $(gencat-modules:=.o)
tests = tst-catgets
test-srcs = test-gencat
+ifeq ($(run-built-tests),yes)
+tests-special += $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
+ $(objpfx)sample.SJIS.cat $(objpfx)test-gencat.out
+endif
+
gencat-modules = xmalloc
# To find xmalloc.c
@@ -39,34 +46,31 @@ include ../Rules
$(objpfx)gencat: $(gencat-modules:%=$(objpfx)%.o)
-catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"' \
- -DHAVE_CONFIG_H
-
-CPPFLAGS-gencat = -DNOT_IN_libc
+catgets-CPPFLAGS := -DNLSPATH='"$(msgcatdir)/%L/%N:$(msgcatdir)/%L/LC_MESSAGES/%N:$(msgcatdir)/%l/%N:$(msgcatdir)/%l/LC_MESSAGES/%N:"'
-generated = de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \
- test-gencat.h
-generated-dirs = de
+generated += de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \
+ test-gencat.h
+generated-dirs += de
tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de
ifeq ($(run-built-tests),yes)
-tests: $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
- $(objpfx)test-gencat.out
# This test just checks whether the program produces any error or not.
# The result is not tested.
$(objpfx)test1.cat: test1.msg $(objpfx)gencat
- LC_ALL=hr_HR.ISO-8859-2 LOCPATH=$(common-objpfx)localedata \
- GCONV_PATH=$(common-objpfx)iconvdata \
- $(built-program-cmd) -H $(objpfx)test1.h $@ $<
+ $(built-program-cmd-before-env) \
+ $(run-program-env) LC_ALL=hr_HR.ISO-8859-2 \
+ $(built-program-cmd-after-env) -H $(objpfx)test1.h $@ $<; \
+ $(evaluate-test)
$(objpfx)test2.cat: test2.msg $(objpfx)gencat
- LOCPATH=$(common-objpfx)localedata \
- GCONV_PATH=$(common-objpfx)iconvdata \
- $(built-program-cmd) -H $(objpfx)test2.h $@ $<
+ $(built-program-cmd) -H $(objpfx)test2.h $@ $<; \
+ $(evaluate-test)
$(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat
$(make-target-directory)
- LC_ALL=de_DE.ISO-8859-1 LOCPATH=$(common-objpfx)localedata \
- GCONV_PATH=$(common-objpfx)iconvdata $(built-program-cmd) $@ $<
+ $(built-program-cmd-before-env) \
+ $(run-program-env) LC_ALL=de_DE.ISO-8859-1 \
+ $(built-program-cmd-after-env) $@ $<; \
+ $(evaluate-test)
$(objpfx)tst-catgets.out: $(objpfx)de/libc.cat
# Generate a non-simple input file.
@@ -75,9 +79,11 @@ $(objpfx)de.msg: xopen-msg.awk $(..)po/de.po
$(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \
$(objpfx)sample.SJIS.cat
- $(SHELL) $< $(common-objpfx) '$(test-program-cmd)'
+ $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
+ '$(run-program-env)' '$(test-program-cmd-after-env)'; \
+ $(evaluate-test)
$(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat
- GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
- $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@
+ $(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@; \
+ $(evaluate-test)
endif
diff --git a/catgets/catgets.c b/catgets/catgets.c
index eac2827214..cf93d56c54 100644
--- a/catgets/catgets.c
+++ b/catgets/catgets.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.org>.
diff --git a/catgets/catgetsinfo.h b/catgets/catgetsinfo.h
index a4ecd93e0d..4b953edb60 100644
--- a/catgets/catgetsinfo.h
+++ b/catgets/catgetsinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
diff --git a/catgets/gencat.c b/catgets/gencat.c
index 57b405f862..d8a2c48406 100644
--- a/catgets/gencat.c
+++ b/catgets/gencat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1996.
@@ -246,7 +246,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2014");
+"), "2015");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}
diff --git a/catgets/nl_types.h b/catgets/nl_types.h
index e86bd899c1..073353fcbe 100644
--- a/catgets/nl_types.h
+++ b/catgets/nl_types.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/catgets/open_catalog.c b/catgets/open_catalog.c
index bc44f98247..e0694160e6 100644
--- a/catgets/open_catalog.c
+++ b/catgets/open_catalog.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.org>.
@@ -54,7 +54,7 @@ __open_catalog (const char *cat_name, const char *nlspath, const char *env_var,
{
const char *run_nlspath = nlspath;
#define ENOUGH(n) \
- if (__builtin_expect (bufact + (n) >= bufmax, 0)) \
+ if (__glibc_unlikely (bufact + (n) >= bufmax)) \
{ \
char *old_buf = buf; \
bufmax += 256 + (n); \
@@ -253,7 +253,7 @@ __open_catalog (const char *cat_name, const char *nlspath, const char *env_var,
/* Determine whether the file is a catalog file and if yes whether
it is written using the correct byte order. Else we have to swap
the values. */
- if (__builtin_expect (catalog->file_ptr->magic == CATGETS_MAGIC, 1))
+ if (__glibc_likely (catalog->file_ptr->magic == CATGETS_MAGIC))
swapping = 0;
else if (catalog->file_ptr->magic == SWAPU32 (CATGETS_MAGIC))
swapping = 1;
diff --git a/catgets/test-gencat.c b/catgets/test-gencat.c
index eaa9b895f6..282974ca2f 100644
--- a/catgets/test-gencat.c
+++ b/catgets/test-gencat.c
@@ -3,8 +3,8 @@
#include <stdio.h>
#include <stdlib.h>
-int
-main (void)
+static int
+do_test (void)
{
nl_catd catalog;
setlocale (LC_ALL, "");
@@ -29,3 +29,6 @@ main (void)
return 0;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/catgets/test-gencat.sh b/catgets/test-gencat.sh
index 08e47af24a..97beca8e78 100755
--- a/catgets/test-gencat.sh
+++ b/catgets/test-gencat.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# Test escape character handling in gencat.
-# Copyright (C) 2000-2014 Free Software Foundation, Inc.
+# Copyright (C) 2000-2015 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -20,12 +20,15 @@
set -e
common_objpfx=$1
-test_program_cmd=$2
+test_program_cmd_before_env=$2
+run_program_env=$3
+test_program_cmd_after_env=$4
# Run the test program.
-LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-NLSPATH=${common_objpfx}catgets/%N.%c.cat LC_ALL=ja_JP.SJIS \
- ${test_program_cmd} \
+${test_program_cmd_before_env} \
+ ${run_program_env} \
+ NLSPATH=${common_objpfx}catgets/%N.%c.cat LC_ALL=ja_JP.SJIS \
+ ${test_program_cmd_after_env} \
> ${common_objpfx}catgets/test-gencat.out
# Compare with the expected result.
diff --git a/catgets/tst-catgets.c b/catgets/tst-catgets.c
index fdaa834949..a0a408936b 100644
--- a/catgets/tst-catgets.c
+++ b/catgets/tst-catgets.c
@@ -14,8 +14,8 @@ static const char *msgs[] =
#define ROUNDS 5
-int
-main (void)
+static int
+do_test (void)
{
int rnd;
int result = 0;
@@ -64,3 +64,6 @@ main (void)
return result;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/catgets/xopen-msg.awk b/catgets/xopen-msg.awk
index 61920fcdb9..216c5f5a77 100644
--- a/catgets/xopen-msg.awk
+++ b/catgets/xopen-msg.awk
@@ -1,5 +1,5 @@
# xopen-msg.awk - Convert Uniforum style .po file to X/Open style .msg file
-# Copyright (C) 2012-2014 Free Software Foundation, Inc.
+# Copyright (C) 2012-2015 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