2024-06-30 Bruno Haible <bruno@clisp.org>
+ zprintf-posix: Add tests.
+ * tests/test-zprintf-posix.c: New file, based on
+ tests/test-printf-posix.c.
+ * tests/test-zprintf-posix.sh: New file, based on
+ tests/test-printf-posix.sh.
+ * modules/zprintf-posix-tests: New file.
+
zprintf-posix: New module.
* modules/zprintf-posix: New file.
--- /dev/null
+Files:
+tests/test-zprintf-posix.sh
+tests/test-zprintf-posix.c
+tests/test-printf-posix.h
+tests/test-printf-posix.output
+tests/infinity.h
+tests/macros.h
+
+Depends-on:
+stdint
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-zprintf-posix.sh
+check_PROGRAMS += test-zprintf-posix
-/* Test of POSIX compatible v[z]printf() and printf() functions.
+/* Test of POSIX compatible v[z]printf() and [z]printf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
--- /dev/null
+/* Test of POSIX compatible zprintf() 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 <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "macros.h"
+
+#define RETTYPE off64_t
+#include "test-printf-posix.h"
+
+int
+main (int argc, char *argv[])
+{
+ test_function (zprintf);
+ return test_exit_status;
+}
--- /dev/null
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' HUP INT QUIT TERM
+
+tmpfiles="$tmpfiles t-zprintf-posix.tmp t-zprintf-posix.out"
+${CHECKER} ./test-zprintf-posix${EXEEXT} > t-zprintf-posix.tmp || exit 1
+LC_ALL=C tr -d '\r' < t-zprintf-posix.tmp > t-zprintf-posix.out || exit 1
+
+: "${DIFF=diff}"
+${DIFF} "${srcdir}/test-printf-posix.output" t-zprintf-posix.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result