File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -107,9 +107,11 @@ type public SILI(options : SiliOptions) =
107
107
if method.DeclaringType.IsValueType || methodHasByRefParameter method
108
108
then Memory.ForcePopFrames ( callStackSize - 2 ) cilState.state
109
109
else Memory.ForcePopFrames ( callStackSize - 1 ) cilState.state
110
- match TestGenerator.state2test isError method cmdArgs cilState message with
111
- | Some test -> reporter test
112
- | None -> ()
110
+ if not isError || statistics.EmitError cilState message
111
+ then
112
+ match TestGenerator.state2test isError method cmdArgs cilState message with
113
+ | Some test -> reporter test
114
+ | None -> ()
113
115
with :? InsufficientInformationException as e ->
114
116
cilState.iie <- Some e
115
117
reportIncomplete cilState
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ type public SILIStatistics() =
42
42
let startIp2currentIp = Dictionary< codeLocation, Dictionary< codeLocation, uint>>()
43
43
let totalVisited = Dictionary< codeLocation, uint>()
44
44
let visitedWithHistory = Dictionary< codeLocation, HashSet< codeLocation>>()
45
+ let emittedErrors = Dictionary< codeLocation * string, unit>()
45
46
46
47
let mutable isVisitedBlocksNotCoveredByTestsRelevant = true
47
48
let visitedBlocksNotCoveredByTests = Dictionary< cilState, Set< codeLocation>>()
@@ -220,6 +221,12 @@ type public SILIStatistics() =
220
221
221
222
visitedBlocksNotCoveredByTests.Remove s |> ignore
222
223
224
+ member x.EmitError ( s : cilState ) ( errorMessage : string ) =
225
+ let currentLoc = ip2codeLocation ( currentIp s)
226
+ match currentLoc with
227
+ | Some loc -> emittedErrors.TryAdd(( loc, errorMessage), ())
228
+ | _ -> true
229
+
223
230
member x.TrackStepBackward ( pob : pob ) ( cilState : cilState ) =
224
231
// TODO
225
232
()
Original file line number Diff line number Diff line change @@ -121,6 +121,20 @@ public int DisallowNullCallsNotNullTest([DisallowNull] object obj)
121
121
{
122
122
return NotNullTest1 ( obj ) ;
123
123
}
124
+
125
+ [ TestSvm ( guidedMode : false , strat : SearchStrategy . ShortestDistance ) ]
126
+ public int ReadAll ( [ NotNull ] byte [ ] buffer )
127
+ {
128
+ int next ;
129
+ int count = 0 ;
130
+ int count2 = 10 ;
131
+ while ( count2 >= 0 )
132
+ {
133
+ -- count2 ;
134
+ }
135
+
136
+ return count ;
137
+ }
124
138
}
125
139
126
140
[ TestSvmFixture ]
You can’t perform that action at this time.
0 commit comments