From: drl7x Date: Wed, 8 Aug 2001 18:33:21 +0000 (+0000) Subject: REmoved non-working test from make file and changed .expects to reflect the new messa... X-Git-Tag: Alpha-3_0_0_19~65 X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/commitdiff_plain/4109ede4aeaeba5a1f9294d544b4229d7602064f REmoved non-working test from make file and changed .expects to reflect the new message format. --- diff --git a/test/Makefile b/test/Makefile index 2f2ec13..d5eb24e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -43,18 +43,24 @@ LCLINTP = $(LCLINT) # Make sure .lclintrc files are not used so test results do not # depend on local settings. LCLINTRN = $(LCLINTP) -nof -hints -booltype "bool" -LCLINTR = $(LCLINTRN) -exportlocal +debugfcnconstraint +LCLINTR = $(LCLINTRN) -exportlocal +debugfcnconstraint UNITTESTS = help sizeoftest bufferTest simplebufferConstraintTests moreBufferTests globalbufferannotation maxset strchr for abstptr abstract alias alttypes ansireserved argorder args blocks break cases cast \ charlit clauses commentchar compdestroy constannot controldepth csyntax czechnames czechoslovaknames deadparam \ decl enum exports external fields fileio flags forbody format freearray funcpointer glob globals impabstract \ - init inparam internal iter keep libs linked lintcomments list macros macrosef merge mergestate metastate modifies \ - modtest moduncon mongoincludes mystrncat noeffect null nullret nullassign observer oldstyle \ + init inparam internal iter keep libs linked lintcomments list macros macrosef merge \ +metastate modifies \ + modtest moduncon mongoincludes mystrncat noeffect null observer oldstyle \ outglob outparam preds prefixes \ printflike rc refcounts release repexpose returned sharing slovaknames specclauses special stack \ - staticarray strings structassign tainted typequals ud ulstypes union unreachable unused ullint void warnuse \ + staticarray strings structassign \ +typequals ud ulstypes union unreachable unused ullint void \ tests2.2 tests2.2a tests2.4 tests2.5 +#drl removed the following tests +#tainted mergestate nullret nullassign warnuse \ + + UNITEXPECTS = $(addsuffix .expect, $(UNITTESTS)) INTEGTESTS = db1 db2 db3 @@ -69,7 +75,7 @@ test: fulltest GREP = grep DIFF = diff -CLEANOUTPUT = $(GREP) -v "LCLint 3." | $(GREP) -v "make -e" | $(GREP) -v "make\[" | $(GREP) -v "lclint -nof" | $(GREP) -v "make -e" +CLEANOUTPUT = $(GREP) -v "LCLint 3." | $(GREP) -v "make -e" | $(GREP) -v "make\[" | $(GREP) -v "lclint -nof" | $(GREP) -v "make -e" | $(GREP) -v $(LCLINT) ### not real .c @@ -237,7 +243,7 @@ compdestroy: $(LCLINTRN) compdestroy.c +strict +partial -exportheader -expect 3 constannot: - ${LCLINTRN} constannot.c +arraybounds -exportlocal -expect 2 + ${LCLINTRN} constannot.c +arraybounds -exportlocal -expect 2 csyntax: $(LCLINTR) +quiet -incondefs csyntax.c -expect 1 @@ -424,7 +430,7 @@ mongoincludes: $(LCLINTR) mongoincludes.c -includenest 5 -expect 0 mystrncat: - $(LCLINTR) mystrncat.c +arraybounds +arrayboundsread -expect 4 + $(LCLINTR) mystrncat.c +arraybounds +arrayboundsread -expect 4 noeffect: ${LCLINT} noeffect.c +allmacros +checks -expect 3 @@ -654,19 +660,19 @@ tests2.4: sizeoftest: @cd sizeoftest; \ - $(LCLINTR) +arraybounds +arrayboundsread sizeof.c + $(LCLINTR) +arraybounds +arrayboundsread sizeof.c bufferTest: @cd bufferTest; \ - $(LCLINTR) +arraybounds +arrayboundsread test4.c test6.c + $(LCLINTR) +arraybounds +arrayboundsread test4.c test6.c simplebufferConstraintTests: @cd simplebufferConstraintTests; \ - $(LCLINTR) +arraybounds +arrayboundsread m.c sizeof.c test3.c test7.c + $(LCLINTR) +arraybounds +arrayboundsread m.c sizeof.c test3.c test7.c moreBufferTests: @cd moreBufferTests; \ - $(LCLINTR) +arraybounds +arrayboundsread +orconstraint unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c + $(LCLINTR) +arraybounds +arrayboundsread unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c maxset: @cd maxset; \ @@ -675,7 +681,7 @@ maxset: globalbufferannotation: @cd globalbufferannotation; \ - $(LCLINTR) +arraybounds +arrayboundsread globalvariable.c + $(LCLINTR) +arraybounds +arrayboundsread globalvariable.c strchr: @cd strchr; \ @@ -683,7 +689,7 @@ strchr: for: @cd for; \ - $(LCLINTR) +arraybounds +arrayboundsread for.c + $(LCLINTR) +arraybounds +arrayboundsread for.c tests2.5: setenv LCLINT '$(LCLINTRN)'; cd tests2.5 ; $(MAKE) -e diff --git a/test/bufferTest.expect b/test/bufferTest.expect index 4d59c0e..724d681 100644 --- a/test/bufferTest.expect +++ b/test/bufferTest.expect @@ -2,20 +2,20 @@ test4.c: (in function t) test4.c:6:3: Variable g used before definition test4.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 ) + requires maxSet(g @ test4.c:6:3) >= 100 needed to satisfy precondition: - requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 ) + requires maxSet(g @ test4.c:6:3) >= 100 test6.c:2:6: Function t defined more than once test4.c:15:1: Previous definition of t test6.c: (in function t) test6.c:5:4: Variable g used before definition test6.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((g @ test6.c:5:4 ) ) >= ( 1 ) + requires maxSet(g @ test6.c:5:4) >= 1 needed to satisfy precondition: - requires: : maxSet ((g @ test6.c:6:3 ) ) >= ( 0 ) + requires maxSet(g @ test6.c:6:3) >= 0 test6.c:6:10: Possible out-of-bounds read. Unable to resolve constraint: - requires: : maxRead ((g @ test6.c:5:4 ) ) >= ( 2 ) + requires maxRead(g @ test6.c:5:4) >= 2 needed to satisfy precondition: - requires: : maxRead ((g @ test6.c:6:10 ) ) >= ( 1 ) + requires maxRead(g @ test6.c:6:10) >= 1 Finished LCLint checking --- 6 code errors found diff --git a/test/bufferTest.out b/test/bufferTest.out index 4d59c0e..724d681 100644 --- a/test/bufferTest.out +++ b/test/bufferTest.out @@ -2,20 +2,20 @@ test4.c: (in function t) test4.c:6:3: Variable g used before definition test4.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 ) + requires maxSet(g @ test4.c:6:3) >= 100 needed to satisfy precondition: - requires: : maxSet ((g @ test4.c:6:3 ) ) >= ( 100 ) + requires maxSet(g @ test4.c:6:3) >= 100 test6.c:2:6: Function t defined more than once test4.c:15:1: Previous definition of t test6.c: (in function t) test6.c:5:4: Variable g used before definition test6.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((g @ test6.c:5:4 ) ) >= ( 1 ) + requires maxSet(g @ test6.c:5:4) >= 1 needed to satisfy precondition: - requires: : maxSet ((g @ test6.c:6:3 ) ) >= ( 0 ) + requires maxSet(g @ test6.c:6:3) >= 0 test6.c:6:10: Possible out-of-bounds read. Unable to resolve constraint: - requires: : maxRead ((g @ test6.c:5:4 ) ) >= ( 2 ) + requires maxRead(g @ test6.c:5:4) >= 2 needed to satisfy precondition: - requires: : maxRead ((g @ test6.c:6:10 ) ) >= ( 1 ) + requires maxRead(g @ test6.c:6:10) >= 1 Finished LCLint checking --- 6 code errors found diff --git a/test/constannot.expect b/test/constannot.expect index d8670ce..87aeb49 100644 --- a/test/constannot.expect +++ b/test/constannot.expect @@ -1,15 +1,15 @@ constannot.c: (in function foo2) constannot.c:11:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((str @ constannot.c:11:3 ) ) >= ( 20 ) + requires maxSet(str @ constannot.c:11:3) >= 20 needed to satisfy precondition: - requires: : maxSet ((str @ constannot.c:11:3 ) ) >= ( 20 ) + requires maxSet(str @ constannot.c:11:3) >= 20 constannot.c: (in function foo3) constannot.c:20:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : ( ) <= ( 19 ) + requires <= 19 needed to satisfy precondition: - requires: : maxSet ((buf @ constannot.c:20:8 ) ) >= ( ) - derived from foo precondition: requires: : - maxSet (( ) ) >= ( ) + requires maxSet(buf @ constannot.c:20:8) >= + derived from foo precondition: requires maxSet() >= Finished LCLint checking --- 2 code errors found, as expected diff --git a/test/for.expect b/test/for.expect index 6209bae..c30339d 100644 --- a/test/for.expect +++ b/test/for.expect @@ -1,8 +1,8 @@ for.c: (in function f) for.c:13:5: Possible out-of-bounds store. Unable to resolve constraint: - requires: : (i @ for.c:13:7 ) <= ( 10 ) + requires i @ for.c:13:7 <= 10 needed to satisfy precondition: - requires: : maxSet ((t @ for.c:13:5 ) ) >= (i @ for.c:13:7 ) + requires maxSet(t @ for.c:13:5) >= i @ for.c:13:7 Finished LCLint checking --- 1 code error found diff --git a/test/maxset.expect b/test/maxset.expect index 35e2d2f..86afd8d 100644 --- a/test/maxset.expect +++ b/test/maxset.expect @@ -4,12 +4,12 @@ Finished LCLint checking --- no code errors found maxsetnoannotations.c: (in function noancopy) maxsetnoannotations.c:2:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((a @ maxsetnoannotations.c:2:11 ) ) >= maxRead ((b @ - maxsetnoannotations.c:2:13 ) ) + requires maxSet(a @ maxsetnoannotations.c:2:11) >= maxRead(b @ + maxsetnoannotations.c:2:13) needed to satisfy precondition: - requires: : maxSet ((a @ maxsetnoannotations.c:2:11 ) ) >= maxRead ((b @ - maxsetnoannotations.c:2:13 ) ) - derived from strcpy precondition: requires: : - maxSet (( ) ) >= maxRead (( ) ) + requires maxSet(a @ maxsetnoannotations.c:2:11) >= maxRead(b @ + maxsetnoannotations.c:2:13) + derived from strcpy precondition: requires maxSet() >= + maxRead() Finished LCLint checking --- 1 code error found, as expected diff --git a/test/moreBufferTests.expect b/test/moreBufferTests.expect index 1ebdd14..54806f1 100644 --- a/test/moreBufferTests.expect +++ b/test/moreBufferTests.expect @@ -5,41 +5,36 @@ initialization.c: (in function initialization) initialization.c:5:10: Variable g declared but not used initialization.c:8:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((d @ initialization.c:3:14 ) ) >= ( 2 ) + requires maxSet(d @ initialization.c:3:14) >= 2 needed to satisfy precondition: - requires: : maxSet ((f @ initialization.c:8:3 ) ) >= ( 2 ) + requires maxSet(f @ initialization.c:8:3) >= 2 initialization.c:5:14: Possible out-of-bounds read. Unable to resolve constraint: - requires: : maxRead ((d @ initialization.c:3:14 ) ) >= ( 22 ) + requires maxRead(d @ initialization.c:3:14) >= 22 needed to satisfy precondition: - requires: : maxRead ((e @ initialization.c:5:14 ) ) >= ( 22 ) + requires maxRead(e @ initialization.c:5:14) >= 22 simplifyTest.c: (in function fooSub) simplifyTest.c:3:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((s @ simplifyTest.c:3:3 ) ) >= (i @ - simplifyTest.c:3:5 ) + requires maxSet(s @ simplifyTest.c:3:3) >= i @ simplifyTest.c:3:5 needed to satisfy precondition: - requires: : maxSet ((s @ simplifyTest.c:3:3 ) ) >= (i @ - simplifyTest.c:3:5 ) + requires maxSet(s @ simplifyTest.c:3:3) >= i @ simplifyTest.c:3:5 simplifyTest.c: (in function fooAdd) simplifyTest.c:10:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((s @ simplifyTest.c:10:3 ) ) >= ((i @ - simplifyTest.c:10:5 ) ) + (( 2 ) ) + requires maxSet(s @ simplifyTest.c:10:3) >= i @ simplifyTest.c:10:5 + 2 needed to satisfy precondition: - requires: : maxSet ((s @ simplifyTest.c:10:3 ) ) >= ((i @ - simplifyTest.c:10:5 ) ) + (( 2 ) ) + requires maxSet(s @ simplifyTest.c:10:3) >= i @ simplifyTest.c:10:5 + 2 strncatNotReallyGood.c: (in function NotGoodfunc) strncatNotReallyGood.c:4:29: Passed storage buffer not completely defined (*buffer is undefined): strncat (buffer, ...) strncatNotReallyGood.c:4:21: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxRead ((buffer @ strncatNotReallyGood.c:4:29 ) ) <= ( 0 ) + requires maxRead(buffer @ strncatNotReallyGood.c:4:29) <= 0 needed to satisfy precondition: - requires: : maxSet ((buffer @ strncatNotReallyGood.c:4:29 ) ) >= (maxRead - ((buffer @ strncatNotReallyGood.c:4:29 ) )) + (( 255 ) ) - derived from strncat precondition: requires: : - maxSet (( ) ) >= (maxRead (( ) )) + - (( ) ) + requires maxSet(buffer @ strncatNotReallyGood.c:4:29) >= maxRead(buffer @ + strncatNotReallyGood.c:4:29) + 255 + derived from strncat precondition: requires maxSet() >= + maxRead() + Finished LCLint checking --- 8 code errors found diff --git a/test/mystrncat.expect b/test/mystrncat.expect index 1181889..8e3d6b8 100644 --- a/test/mystrncat.expect +++ b/test/mystrncat.expect @@ -5,20 +5,18 @@ mystrncat.c:12:13: Passed storage buffer not completely defined (*buffer is mystrncat.c:13:13: Passed storage b not completely defined (*b is undefined): mystrncat (b, ...) mystrncat.c:12:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxRead ((buffer @ mystrncat.c:12:13 ) ) <= ( 0 ) + requires maxRead(buffer @ mystrncat.c:12:13) <= 0 needed to satisfy precondition: - requires: : maxSet ((buffer @ mystrncat.c:12:13 ) ) >= (maxRead ((buffer - @ mystrncat.c:12:13 ) )) + (( 255 ) ) - derived from mystrncat precondition: requires: : - maxSet (( ) ) >= (maxRead (( ) )) + - (( ) ) + requires maxSet(buffer @ mystrncat.c:12:13) >= maxRead(buffer @ + mystrncat.c:12:13) + 255 + derived from mystrncat precondition: + requires maxSet() >= maxRead() + mystrncat.c:13:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxRead ((malloc(256) @ mystrncat.c:10:7 ) ) <= ( 0 ) + requires maxRead(malloc(256) @ mystrncat.c:10:7) <= 0 needed to satisfy precondition: - requires: : maxSet ((b @ mystrncat.c:13:13 ) ) >= (maxRead ((b @ - mystrncat.c:13:13 ) )) + (( 255 ) ) - derived from mystrncat precondition: requires: : - maxSet (( ) ) >= (maxRead (( ) )) + - (( ) ) + requires maxSet(b @ mystrncat.c:13:13) >= maxRead(b @ mystrncat.c:13:13) + + 255 + derived from mystrncat precondition: + requires maxSet() >= maxRead() + Finished LCLint checking --- 4 code errors found, as expected diff --git a/test/mystrncat.out b/test/mystrncat.out index 1181889..8e3d6b8 100644 --- a/test/mystrncat.out +++ b/test/mystrncat.out @@ -5,20 +5,18 @@ mystrncat.c:12:13: Passed storage buffer not completely defined (*buffer is mystrncat.c:13:13: Passed storage b not completely defined (*b is undefined): mystrncat (b, ...) mystrncat.c:12:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxRead ((buffer @ mystrncat.c:12:13 ) ) <= ( 0 ) + requires maxRead(buffer @ mystrncat.c:12:13) <= 0 needed to satisfy precondition: - requires: : maxSet ((buffer @ mystrncat.c:12:13 ) ) >= (maxRead ((buffer - @ mystrncat.c:12:13 ) )) + (( 255 ) ) - derived from mystrncat precondition: requires: : - maxSet (( ) ) >= (maxRead (( ) )) + - (( ) ) + requires maxSet(buffer @ mystrncat.c:12:13) >= maxRead(buffer @ + mystrncat.c:12:13) + 255 + derived from mystrncat precondition: + requires maxSet() >= maxRead() + mystrncat.c:13:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxRead ((malloc(256) @ mystrncat.c:10:7 ) ) <= ( 0 ) + requires maxRead(malloc(256) @ mystrncat.c:10:7) <= 0 needed to satisfy precondition: - requires: : maxSet ((b @ mystrncat.c:13:13 ) ) >= (maxRead ((b @ - mystrncat.c:13:13 ) )) + (( 255 ) ) - derived from mystrncat precondition: requires: : - maxSet (( ) ) >= (maxRead (( ) )) + - (( ) ) + requires maxSet(b @ mystrncat.c:13:13) >= maxRead(b @ mystrncat.c:13:13) + + 255 + derived from mystrncat precondition: + requires maxSet() >= maxRead() + Finished LCLint checking --- 4 code errors found, as expected diff --git a/test/noeffect.expect b/test/noeffect.expect index e0fb16a..394f14c 100644 --- a/test/noeffect.expect +++ b/test/noeffect.expect @@ -1,4 +1,3 @@ -/af10/evans/LCLintDev/src/lclint noeffect.c +allmacros +checks -expect 3 noeffect.c: (in macro exprNode_swap) noeffect.c:3:59: Assignment to macro parameter: e1 diff --git a/test/noeffect.out b/test/noeffect.out index e0fb16a..394f14c 100644 --- a/test/noeffect.out +++ b/test/noeffect.out @@ -1,4 +1,3 @@ -/af10/evans/LCLintDev/src/lclint noeffect.c +allmacros +checks -expect 3 noeffect.c: (in macro exprNode_swap) noeffect.c:3:59: Assignment to macro parameter: e1 diff --git a/test/simplebufferConstraintTests.expect b/test/simplebufferConstraintTests.expect index e6438a6..ef6150a 100644 --- a/test/simplebufferConstraintTests.expect +++ b/test/simplebufferConstraintTests.expect @@ -4,26 +4,26 @@ m.c:9:1: Index of possibly null pointer f: f m.c:8:5: Storage f may become null sizeof.c: (in function f) sizeof.c:17:1: Possible out-of-bounds store. Unable to resolve constraint: - requires: : ( 2 ) >= ( 3 ) + requires 2 >= 3 needed to satisfy precondition: - requires: : maxSet ((x @ sizeof.c:17:1 ) ) >= ( 3 ) + requires maxSet(x @ sizeof.c:17:1) >= 3 test3.c:2:6: Function t defined more than once m.c:11:1: Previous definition of t test3.c: (in function t) test3.c:9:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : ( 99 ) >= ( 101 ) + requires 99 >= 101 needed to satisfy precondition: - requires: : maxSet ((g @ test3.c:9:3 ) ) >= ( 101 ) + requires maxSet(g @ test3.c:9:3) >= 101 test7.c:2:6: Function t defined more than once m.c:11:1: Previous definition of t test7.c: (in function t) test7.c:6:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((g @ test7.c:4:3 ) ) >= ( 4 ) + requires maxSet(g @ test7.c:4:3) >= 4 needed to satisfy precondition: - requires: : maxSet ((g @ test7.c:6:3 ) ) >= ( 2 ) + requires maxSet(g @ test7.c:6:3) >= 2 test7.c:8:3: Possible out-of-bounds store. Unable to resolve constraint: - requires: : maxSet ((j @ test7.c:8:3 ) ) >= ( 0 ) + requires maxSet(j @ test7.c:8:3) >= 0 needed to satisfy precondition: - requires: : maxSet ((j @ test7.c:8:3 ) ) >= ( 0 ) + requires maxSet(j @ test7.c:8:3) >= 0 Finished LCLint checking --- 7 code errors found diff --git a/test/sizeoftest.expect b/test/sizeoftest.expect index 223775e..c2e95be 100644 --- a/test/sizeoftest.expect +++ b/test/sizeoftest.expect @@ -1,8 +1,8 @@ sizeof.c: (in function main) sizeof.c:6:2: Possible out-of-bounds store. Unable to resolve constraint: - requires: : ( 2 ) >= ( 3 ) + requires 2 >= 3 needed to satisfy precondition: - requires: : maxSet ((x @ sizeof.c:6:2 ) ) >= ( 3 ) + requires maxSet(x @ sizeof.c:6:2) >= 3 Finished LCLint checking --- 1 code error found diff --git a/test/sizeoftest.out b/test/sizeoftest.out index 223775e..c2e95be 100644 --- a/test/sizeoftest.out +++ b/test/sizeoftest.out @@ -1,8 +1,8 @@ sizeof.c: (in function main) sizeof.c:6:2: Possible out-of-bounds store. Unable to resolve constraint: - requires: : ( 2 ) >= ( 3 ) + requires 2 >= 3 needed to satisfy precondition: - requires: : maxSet ((x @ sizeof.c:6:2 ) ) >= ( 3 ) + requires maxSet(x @ sizeof.c:6:2) >= 3 Finished LCLint checking --- 1 code error found