2024-06-30 Bruno Haible <bruno@clisp.org>
+ fzprintf-gnu: Add tests.
+ * tests/test-fzprintf-gnu.c: New file, based on
+ tests/test-fprintf-gnu.c.
+ * tests/test-fzprintf-gnu.sh: New file, based on
+ tests/test-fprintf-gnu.sh.
+ * modules/fzprintf-gnu-tests: New file.
+
fzprintf-gnu: New module.
* modules/fzprintf-gnu: New file.
--- /dev/null
+Files:
+tests/test-fzprintf-gnu.sh
+tests/test-fzprintf-gnu.c
+tests/test-fprintf-gnu.h
+tests/test-printf-gnu.output
+tests/macros.h
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-fzprintf-gnu.sh
+check_PROGRAMS += test-fzprintf-gnu
--- /dev/null
+/* Test of POSIX and GNU compatible fzprintf() function.
+ Copyright (C) 2007-2024 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#define RETTYPE off64_t
+#include "test-fprintf-gnu.h"
+
+int
+main (int argc, char *argv[])
+{
+ test_function (fzprintf);
+ return test_exit_status;
+}
--- /dev/null
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' HUP INT QUIT TERM
+
+tmpfiles="$tmpfiles t-fzprintf-gnu.tmp t-fzprintf-gnu.out"
+${CHECKER} ./test-fzprintf-gnu${EXEEXT} > t-fzprintf-gnu.tmp || exit 1
+LC_ALL=C tr -d '\r' < t-fzprintf-gnu.tmp > t-fzprintf-gnu.out || exit 1
+
+: "${DIFF=diff}"
+${DIFF} "${srcdir}/test-printf-gnu.output" t-fzprintf-gnu.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result