diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 11 | ||||
-rw-r--r-- | test/Makefile.am | 80 | ||||
-rw-r--r-- | test/Makefile.in | 85 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/printfbad3.awk | 22 | ||||
-rw-r--r-- | test/printfbad3.ok | 1 |
6 files changed, 132 insertions, 72 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index c16e5ecf..e993e448 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -2,6 +2,17 @@ * badargs.ok: Adjust for new and changed command line options. +2012-03-20 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (printfbad3): New test. + * printfbad3.awk, printfbad3.ok: New files. + +2012-02-22 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (beginfile2, next): Set LC_ALL=C so that error + messages will be in English for comparison with .ok files. + Thanks to Jeroen Schot <schot@a-eskwadraat.nl>. + 2011-12-26 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (rri1): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 943dbd9f..12f251f1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2011 the Free Software Foundation, Inc. +# Copyright (C) 1988-2012 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -574,6 +574,8 @@ EXTRA_DIST = \ printfbad2.awk \ printfbad2.in \ printfbad2.ok \ + printfbad3.awk \ + printfbad3.ok \ printfloat.awk \ printlang.awk \ prmarscl.awk \ @@ -783,38 +785,43 @@ TESTS_WE_ARE_NOT_DOING_YET_FIXME_ONE_DAY = longdbl # Get rid of core files when cleaning and generated .ok file CLEANFILES = core core.* fmtspcl.ok -# try to keep these sorted +# try to keep these sorted. each letter starts a new line BASIC_TESTS = \ addcomma anchgsub argarray arrayparm arrayprm2 arrayprm3 \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ - aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \ - closebad clsflnam compare compare2 concat1 concat2 concat3 \ - concat4 convfmt datanonl defref delargv delarpm2 delarprm delfunc \ - dfastress dynlj eofsplit exitval1 exitval2 fcall_exit fcall_exit2 \ - fldchg fldchgnf fnamedat fnarray fnarray2 fnaryscl fnasgnm fnmisc \ - fordel forref forsimp fsbs fsrs fsspcoln fstabplus funsemnl funsmnam \ - funstack getline getline2 getline3 getline4 \ - getlnbuf getnr2tb getnr2tm \ + aryprm8 arysubnm asgext awkpath \ + back89 backgsub \ + childin clobber closebad clsflnam compare compare2 concat1 concat2 \ + concat3 concat4 convfmt \ + datanonl defref delargv delarpm2 delarprm delfunc dfastress dynlj \ + eofsplit exitval1 exitval2 \ + fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ + fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ + fstabplus funsemnl funsmnam funstack \ + getline getline2 getline3 getline4 getlnbuf getnr2tb getnr2tm \ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ gsubtst7 gsubtst8 \ - hex hsprint inputred intest intprec iobug1 leaddig leadnl litoct \ - longsub longwrds manglprm math membug1 messages minusstr mmap8k \ - mtchi18n nasty nasty2 negexp negrange nested nfldstr nfneg \ - nfset nlfldsep nlinstr nlstrina noeffect nofile nofmtch noloop1 \ - noloop2 nonl noparms nors nulrsend numindex numsubstr octsub ofmt \ - ofmta ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup \ - paramres paramtyp parse1 parsefld parseme pcntplus posix2008sub \ - prdupval prec printf0 printf1 prmarscl prmreuse prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regrange reindops reparse resplit \ - rri1 \ - rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 rstest3 rstest4 \ - rstest5 rswhite scalar sclforin sclifin sortempty splitargv \ - splitarr splitdef splitvar splitwht strcat1 strnum1 strtod subamp \ - subi18n subsepnm subslash substr swaplns synerr1 synerr2 tradanch \ - tweakfld uninit2 uninit3 uninit4 uninit5 uninitialized unterm \ - uparrfs wideidx wideidx2 widesub widesub2 widesub3 widesub4 \ - wjposer1 zero2 zeroe0 zeroflag + hex hsprint \ + inputred intest intprec iobug1 \ + leaddig leadnl litoct longsub longwrds \ + manglprm math membug1 messages minusstr mmap8k mtchi18n \ + nasty nasty2 negexp negrange nested nfldstr nfneg nfset nlfldsep \ + nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ + noparms nors nulrsend numindex numsubstr \ + octsub ofmt ofmta ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf \ + paramdup paramres paramtyp parse1 parsefld parseme pcntplus \ + posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ + prt1eval prtoeval \ + rand range1 rebt8b1 redfilnm regeq regrange reindops reparse \ + resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ + rstest3 rstest4 rstest5 rswhite \ + scalar sclforin sclifin sortempty splitargv splitarr splitdef \ + splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ + subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ + uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ + wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ + zero2 zeroe0 zeroflag UNIX_TESTS = \ fflush getlnhd localenl pid pipeio1 pipeio2 poundbang rtlen rtlen01 \ @@ -822,15 +829,16 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ - backw badargs beginfile1 beginfile2 \ - binmode1 clos1way delsub devfd devfd1 \ - devfd2 dumpvars exit fieldwdth fpat1 fpat2 fpat3 \ - fpatnull fsfwfs funlen \ + backw badargs beginfile1 beginfile2 binmode1 \ + clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ - icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall lint \ - lintold lintwarn manyfiles match1 match2 match3 mbstr1 nastyparm \ - next nondec nondec2 patsplit posix printfbad1 printfbad2 procinfs \ + icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall \ + lint lintold lintwarn \ + manyfiles match1 match2 match3 mbstr1 \ + nastyparm next nondec nondec2 \ + patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 pty1 \ rebuf regx8bit reint reint2 rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ @@ -1396,7 +1404,7 @@ beginfile1:: beginfile2: @echo $@ - @-( cd $(srcdir) && AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1 + @-( cd $(srcdir) && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1 @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ dumpvars:: @@ -1431,7 +1439,7 @@ posix2008sub: next: @echo $@ @-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1 - @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + @-LC_ALL=C $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ exit: @echo $@ diff --git a/test/Makefile.in b/test/Makefile.in index a389929a..583634a0 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -18,7 +18,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2011 the Free Software Foundation, Inc. +# Copyright (C) 1988-2012 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -758,6 +758,8 @@ EXTRA_DIST = \ printfbad2.awk \ printfbad2.in \ printfbad2.ok \ + printfbad3.awk \ + printfbad3.ok \ printfloat.awk \ printlang.awk \ prmarscl.awk \ @@ -967,38 +969,43 @@ TESTS_WE_ARE_NOT_DOING_YET_FIXME_ONE_DAY = longdbl # Get rid of core files when cleaning and generated .ok file CLEANFILES = core core.* fmtspcl.ok -# try to keep these sorted +# try to keep these sorted. each letter starts a new line BASIC_TESTS = \ addcomma anchgsub argarray arrayparm arrayprm2 arrayprm3 \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ - aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \ - closebad clsflnam compare compare2 concat1 concat2 concat3 \ - concat4 convfmt datanonl defref delargv delarpm2 delarprm delfunc \ - dfastress dynlj eofsplit exitval1 exitval2 fcall_exit fcall_exit2 \ - fldchg fldchgnf fnamedat fnarray fnarray2 fnaryscl fnasgnm fnmisc \ - fordel forref forsimp fsbs fsrs fsspcoln fstabplus funsemnl funsmnam \ - funstack getline getline2 getline3 getline4 \ - getlnbuf getnr2tb getnr2tm \ + aryprm8 arysubnm asgext awkpath \ + back89 backgsub \ + childin clobber closebad clsflnam compare compare2 concat1 concat2 \ + concat3 concat4 convfmt \ + datanonl defref delargv delarpm2 delarprm delfunc dfastress dynlj \ + eofsplit exitval1 exitval2 \ + fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ + fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ + fstabplus funsemnl funsmnam funstack \ + getline getline2 getline3 getline4 getlnbuf getnr2tb getnr2tm \ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ gsubtst7 gsubtst8 \ - hex hsprint inputred intest intprec iobug1 leaddig leadnl litoct \ - longsub longwrds manglprm math membug1 messages minusstr mmap8k \ - mtchi18n nasty nasty2 negexp negrange nested nfldstr nfneg \ - nfset nlfldsep nlinstr nlstrina noeffect nofile nofmtch noloop1 \ - noloop2 nonl noparms nors nulrsend numindex numsubstr octsub ofmt \ - ofmta ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup \ - paramres paramtyp parse1 parsefld parseme pcntplus posix2008sub \ - prdupval prec printf0 printf1 prmarscl prmreuse prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regrange reindops reparse resplit \ - rri1 \ - rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 rstest3 rstest4 \ - rstest5 rswhite scalar sclforin sclifin sortempty splitargv \ - splitarr splitdef splitvar splitwht strcat1 strnum1 strtod subamp \ - subi18n subsepnm subslash substr swaplns synerr1 synerr2 tradanch \ - tweakfld uninit2 uninit3 uninit4 uninit5 uninitialized unterm \ - uparrfs wideidx wideidx2 widesub widesub2 widesub3 widesub4 \ - wjposer1 zero2 zeroe0 zeroflag + hex hsprint \ + inputred intest intprec iobug1 \ + leaddig leadnl litoct longsub longwrds \ + manglprm math membug1 messages minusstr mmap8k mtchi18n \ + nasty nasty2 negexp negrange nested nfldstr nfneg nfset nlfldsep \ + nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ + noparms nors nulrsend numindex numsubstr \ + octsub ofmt ofmta ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf \ + paramdup paramres paramtyp parse1 parsefld parseme pcntplus \ + posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ + prt1eval prtoeval \ + rand range1 rebt8b1 redfilnm regeq regrange reindops reparse \ + resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ + rstest3 rstest4 rstest5 rswhite \ + scalar sclforin sclifin sortempty splitargv splitarr splitdef \ + splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ + subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ + uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ + wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ + zero2 zeroe0 zeroflag UNIX_TESTS = \ fflush getlnhd localenl pid pipeio1 pipeio2 poundbang rtlen rtlen01 \ @@ -1006,15 +1013,16 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ - backw badargs beginfile1 beginfile2 \ - binmode1 clos1way delsub devfd devfd1 \ - devfd2 dumpvars exit fieldwdth fpat1 fpat2 fpat3 \ - fpatnull fsfwfs funlen \ + backw badargs beginfile1 beginfile2 binmode1 \ + clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ - icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall lint \ - lintold lintwarn manyfiles match1 match2 match3 mbstr1 nastyparm \ - next nondec nondec2 patsplit posix printfbad1 printfbad2 procinfs \ + icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall \ + lint lintold lintwarn \ + manyfiles match1 match2 match3 mbstr1 \ + nastyparm next nondec nondec2 \ + patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 pty1 \ rebuf regx8bit reint reint2 rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ @@ -1746,7 +1754,7 @@ beginfile1:: beginfile2: @echo $@ - @-( cd $(srcdir) && AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1 + @-( cd $(srcdir) && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1 @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ dumpvars:: @@ -1781,7 +1789,7 @@ posix2008sub: next: @echo $@ @-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1 - @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + @-LC_ALL=C $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ exit: @echo $@ @@ -2875,6 +2883,11 @@ printfbad1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +printfbad3: + @echo printfbad3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + procinfs: @echo procinfs @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 5c1a6b38..b6168564 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1080,6 +1080,11 @@ printfbad1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +printfbad3: + @echo printfbad3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + procinfs: @echo procinfs @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/printfbad3.awk b/test/printfbad3.awk new file mode 100644 index 00000000..1cabdd76 --- /dev/null +++ b/test/printfbad3.awk @@ -0,0 +1,22 @@ +# Date: Wed, 14 Mar 2012 08:10:48 -0500 +# From: John Haque <j.eh@mchsi.com> +# To: arnold@skeeve.com +# Subject: gawk printf format bug +# +# Hi. +# +# I think this is a bug: +# +# $ gawk 'BEGIN { printf("%.0x%#x%#x\n", 0, 167, 167)}' +# 570xa7 +# +# It should print 0xa70xa7. +# +# The solution is to initialize base to 0 in the beginning +# of the while loop along with other stuff (format_tree). +# +# Thanks. +# +# John + +BEGIN { printf(">>%.0x<< >>%#x<< >>%#x<<\n", 0, 167, 167) } diff --git a/test/printfbad3.ok b/test/printfbad3.ok new file mode 100644 index 00000000..a87b0192 --- /dev/null +++ b/test/printfbad3.ok @@ -0,0 +1 @@ +>><< >>0xa7<< >>0xa7<< |