>From 20ba9bfff2e3970493ef0f2ad04d7635c3f44adf Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 24 Mar 2023 11:23:51 +0100 Subject: [PATCH 11/31] sprintf-gnu: Add tests. * tests/test-sprintf-gnu.c: New file, based on tests/test-sprintf-posix.c. * modules/sprintf-gnu-tests: New file, based on modules/sprintf-posix-tests. --- ChangeLog | 6 ++++++ modules/sprintf-gnu-tests | 13 +++++++++++++ tests/test-sprintf-gnu.c | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 modules/sprintf-gnu-tests create mode 100644 tests/test-sprintf-gnu.c diff --git a/ChangeLog b/ChangeLog index 4656a575ea..d9421f29bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2023-03-24 Bruno Haible + sprintf-gnu: Add tests. + * tests/test-sprintf-gnu.c: New file, based on + tests/test-sprintf-posix.c. + * modules/sprintf-gnu-tests: New file, based on + modules/sprintf-posix-tests. + sprintf-gnu: New module. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_SPRINTF_POSIX. diff --git a/modules/sprintf-gnu-tests b/modules/sprintf-gnu-tests new file mode 100644 index 0000000000..90b9636fc5 --- /dev/null +++ b/modules/sprintf-gnu-tests @@ -0,0 +1,13 @@ +Files: +tests/test-sprintf-gnu.c +tests/test-sprintf-gnu.h +tests/macros.h + +Depends-on: +sprintf-posix-tests + +configure.ac: + +Makefile.am: +TESTS += test-sprintf-gnu +check_PROGRAMS += test-sprintf-gnu diff --git a/tests/test-sprintf-gnu.c b/tests/test-sprintf-gnu.c new file mode 100644 index 0000000000..cb22fb4fb4 --- /dev/null +++ b/tests/test-sprintf-gnu.c @@ -0,0 +1,35 @@ +/* Test of POSIX and GNU compatible sprintf() function. + Copyright (C) 2007-2023 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 . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +#include + +#include +#include + +#include "macros.h" + +#include "test-sprintf-gnu.h" + +int +main (int argc, char *argv[]) +{ + test_function (sprintf); + return 0; +} -- 2.34.1