Module Name: src Committed By: rillig Date: Sat Sep 11 18:18:29 UTC 2021
Modified Files: src/tests/lib/libc/stdio: h_intr.c t_fmemopen.c t_open_memstream.c t_scanf.c Log Message: tests/stdio: normalize whitespace To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/stdio/h_intr.c cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/stdio/t_fmemopen.c cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/stdio/t_open_memstream.c cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdio/t_scanf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/stdio/h_intr.c diff -u src/tests/lib/libc/stdio/h_intr.c:1.5 src/tests/lib/libc/stdio/h_intr.c:1.6 --- src/tests/lib/libc/stdio/h_intr.c:1.5 Sat Jul 10 07:50:20 2021 +++ src/tests/lib/libc/stdio/h_intr.c Sat Sep 11 18:18:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: h_intr.c,v 1.5 2021/07/10 07:50:20 christos Exp $ */ +/* $NetBSD: h_intr.c,v 1.6 2021/09/11 18:18:28 rillig Exp $ */ /** * Test of interrupted I/O to popen()ed commands. @@ -15,7 +15,7 @@ * * Check program: * find /mnt -type f -exec ./h_intr -b 512 -c run.sh {} + - * + * * ./run.sh: #!/bin/sh set -eu @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: h_intr.c,v 1.5 2021/07/10 07:50:20 christos Exp $"); +__RCSID("$NetBSD: h_intr.c,v 1.6 2021/09/11 18:18:28 rillig Exp $"); #include <time.h> #include <err.h> @@ -355,13 +355,13 @@ xsignal(int signo, sig_t handler) static void alarmtimer(int wait) -{ +{ struct itimerval itv; itv.it_value.tv_sec = wait / MS; itv.it_value.tv_usec = (wait - itv.it_value.tv_sec * MS) * MS; itv.it_interval = itv.it_value; - setitimer(ITIMER_REAL, &itv, NULL); + setitimer(ITIMER_REAL, &itv, NULL); } static void Index: src/tests/lib/libc/stdio/t_fmemopen.c diff -u src/tests/lib/libc/stdio/t_fmemopen.c:1.6 src/tests/lib/libc/stdio/t_fmemopen.c:1.7 --- src/tests/lib/libc/stdio/t_fmemopen.c:1.6 Sat Jul 10 13:22:01 2021 +++ src/tests/lib/libc/stdio/t_fmemopen.c Sat Sep 11 18:18:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: t_fmemopen.c,v 1.6 2021/07/10 13:22:01 martin Exp $ */ +/* $NetBSD: t_fmemopen.c,v 1.7 2021/09/11 18:18:28 rillig Exp $ */ /*- * Copyright (c)2010 Takehiko NOZAKI, @@ -65,7 +65,7 @@ const char *mode_rwa[] = { const char *mode_r[] = { "r", "rb", "r+", "rb+", "r+b", NULL }; const char *mode_w[] = { "w", "wb", "w+", "wb+", "w+b", NULL }; -const char *mode_a[] = { "a", "ab", "a+", "ab+", "a+b", NULL }; +const char *mode_a[] = { "a", "ab", "a+", "ab+", "a+b", NULL }; struct testcase { const char *s; @@ -179,7 +179,7 @@ ATF_TC_BODY(test01, tc) ATF_TC(test02); ATF_TC_HEAD(test02, tc) { - atf_tc_set_md_var(tc, "descr", "test02"); + atf_tc_set_md_var(tc, "descr", "test02"); } ATF_TC_BODY(test02, tc) { @@ -215,14 +215,14 @@ ATF_TC_BODY(test02, tc) ATF_TC(test03); ATF_TC_HEAD(test03, tc) { - atf_tc_set_md_var(tc, "descr", "test03"); + atf_tc_set_md_var(tc, "descr", "test03"); } ATF_TC_BODY(test03, tc) { const char **p; char buf[BUFSIZ]; FILE *fp; - + for (p = &mode_w[0]; *p != NULL; ++p) { memset(&buf[0], 0x1, sizeof(buf)); @@ -359,7 +359,7 @@ ATF_TC_BODY(test07, tc) /* * Because this feature is only useful when the stream is opened for updating * (because there is no way to get a pointer to the buffer) the fmemopen() - * call may fail if the mode argument does not include a '+' . + * call may fail if the mode argument does not include a '+'. */ errno = 0; fp = fmemopen(NULL, 1, *p); Index: src/tests/lib/libc/stdio/t_open_memstream.c diff -u src/tests/lib/libc/stdio/t_open_memstream.c:1.2 src/tests/lib/libc/stdio/t_open_memstream.c:1.3 --- src/tests/lib/libc/stdio/t_open_memstream.c:1.2 Sun Oct 19 11:17:43 2014 +++ src/tests/lib/libc/stdio/t_open_memstream.c Sat Sep 11 18:18:28 2021 @@ -16,7 +16,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_open_memstream.c,v 1.2 2014/10/19 11:17:43 justin Exp $"); +__RCSID("$NetBSD: t_open_memstream.c,v 1.3 2021/09/11 18:18:28 rillig Exp $"); #include <atf-c.h> #include <err.h> @@ -90,7 +90,7 @@ ATF_TC_BODY(test_open_memstream, tc) ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, test_open_memstream); + ATF_TP_ADD_TC(tp, test_open_memstream); - return atf_no_error(); + return atf_no_error(); } Index: src/tests/lib/libc/stdio/t_scanf.c diff -u src/tests/lib/libc/stdio/t_scanf.c:1.3 src/tests/lib/libc/stdio/t_scanf.c:1.4 --- src/tests/lib/libc/stdio/t_scanf.c:1.3 Sun Mar 18 07:00:51 2012 +++ src/tests/lib/libc/stdio/t_scanf.c Sat Sep 11 18:18:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: t_scanf.c,v 1.3 2012/03/18 07:00:51 jruoho Exp $ */ +/* $NetBSD: t_scanf.c,v 1.4 2021/09/11 18:18:28 rillig Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -43,12 +43,12 @@ ATF_TC_HEAD(sscanf_neghex, tc) ATF_TC_BODY(sscanf_neghex, tc) { - int i; + int i; - sscanf(STRNUM, "%i", &i); + sscanf(STRNUM, "%i", &i); ATF_REQUIRE(i == NUM); - sscanf(STRNUM, "%x", &i); + sscanf(STRNUM, "%x", &i); ATF_REQUIRE(i == NUM); } @@ -64,9 +64,9 @@ ATF_TC_BODY(sscanf_whitespace, tc) const char str[] = "\f\n\r\t\v%z"; char c; - /* set of "white space" symbols from isspace(3) */ - c = 0; - (void)sscanf(str, "%%%c", &c); + /* set of "white space" symbols from isspace(3) */ + c = 0; + (void)sscanf(str, "%%%c", &c); ATF_REQUIRE(c == 'z'); }