From b248da9104c237e3cc3920fad4ae232cd501a88e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 30 Nov 2016 18:25:32 +0000 Subject: [PATCH] regress: fuzzraw: Move up Tensurerecordfile Pure code motion Signed-off-by: Ian Jackson --- regress/hfuzzraw.c.m4 | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/regress/hfuzzraw.c.m4 b/regress/hfuzzraw.c.m4 index 7d52d32..034922a 100644 --- a/regress/hfuzzraw.c.m4 +++ b/regress/hfuzzraw.c.m4 @@ -53,28 +53,6 @@ static void Tflushstdout( void) { if (fflush(stdout)) Toutputerr(); } -void Q_vb(void) { - if (!adns__vbuf_append(&vb,"",1)) Tnomem(); - if (fprintf(stdout," %s\n",vb.buf) == EOF) Toutputerr(); - Tflushstdout(); -} - -static void Pformat(const char *what) { - fprintf(stderr,"adns test harness: format error in raw log input file: %s\n",what); - exit(-1); -} - -extern void Tshutdown(void) { - int c= fgetc(Tinputfile); - if (c!=EOF) Pformat("unwanted additional syscall reply data"); - if (ferror(Tinputfile)) Tfailed("read test log input (at end)"); -} - -static void Pcheckinput(void) { - if (ferror(Tinputfile)) Tfailed("read test log input file"); - if (feof(Tinputfile)) Pformat("eof at syscall reply"); -} - void Tensurerecordfile(void) { static int done; @@ -97,6 +75,27 @@ void Tensurerecordfile(void) { if (proutstr) stdout_enable= atoi(proutstr); } +void Q_vb(void) { + if (!adns__vbuf_append(&vb,"",1)) Tnomem(); + if (fprintf(stdout," %s\n",vb.buf) == EOF) Toutputerr(); + Tflushstdout(); +} + +static void Pformat(const char *what) { + fprintf(stderr,"adns test harness: format error in raw log input file: %s\n",what); + exit(-1); +} + +extern void Tshutdown(void) { + int c= fgetc(Tinputfile); + if (c!=EOF) Pformat("unwanted additional syscall reply data"); + if (ferror(Tinputfile)) Tfailed("read test log input (at end)"); +} + +static void Pcheckinput(void) { + if (ferror(Tinputfile)) Tfailed("read test log input file"); + if (feof(Tinputfile)) Pformat("eof at syscall reply"); +} static void P_read_dump(const unsigned char *p0, size_t count, ssize_t d) { fputs(" | ",stdout); -- 2.30.2