Skip to content

Commit

Permalink
[style] fixed style
Browse files Browse the repository at this point in the history
  • Loading branch information
MchKosticyn committed Jan 17, 2024
1 parent c43d215 commit 69fb4a8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions VSharp.API/VSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public void GenerateReport(TextWriter writer)
{
writer.WriteLine("Total time: {0:00}:{1:00}:{2:00}.{3}.", TestGenerationTime.Hours,
TestGenerationTime.Minutes, TestGenerationTime.Seconds, TestGenerationTime.Milliseconds);
writer.WriteLine("Approximate coverage: {0}", GeneratedTestInfos.LastOrDefault().Coverage);
writer.WriteLine($"Approximate coverage: {GeneratedTestInfos.LastOrDefault().Coverage}");
if (Coverage >= 0)
writer.WriteLine("Precise coverage: {0}", Coverage);
writer.WriteLine($"Precise coverage: {Coverage}");
var count = IncompleteBranches.Count();
if (count > 0)
{
Expand Down
5 changes: 1 addition & 4 deletions VSharp.Explorer/Statistics.fs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ type public SVMStatistics(entryMethods : Method seq, generalizeGenericsCoverage
Logger.traceWithTag Logger.stateTraceTag $"{stepsCount} FORWARD: {s.internalId}"

let setCoveredIfNeeded (loc : codeLocation) =
// 'Call' instructions are considered covered only after return, because 'call' can throw exception
if s.StackSize <= stackSize && loc.offset = loc.BasicBlock.FinalOffset then
s.AddLocationToHistory loc

Expand Down Expand Up @@ -202,10 +203,6 @@ type public SVMStatistics(entryMethods : Method seq, generalizeGenericsCoverage
if currentMethod.InCoverageZone && not isCovered then
visitedBlocksNotCoveredByTests.TryAdd(s, Set.empty) |> ignore
Interlocked.Exchange(ref isVisitedBlocksNotCoveredByTestsRelevant, 0) |> ignore
(*
Call instructions are considered covered only after return
(because call can throw exception)
*)
setCoveredIfNeeded currentLoc
| Some currentLoc -> setCoveredIfNeeded currentLoc
| None -> ()
Expand Down
4 changes: 2 additions & 2 deletions VSharp.IL/MethodBody.fs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ type MethodWithBody internal (m : MethodBase) =
| None -> None)

let instructions = lazy(
match rawBody.Value with
| Some rawBody -> ILRewriter.instructionsOfMethod rawBody actualMethod
match methodBody.Value with
| Some methodBody -> ILRewriter.instructionsOfMethod methodBody actualMethod
| None -> internalfailf $"Getting instructions of method {m} without body (extern or abstract)")

let invocationFlags = lazy (
Expand Down
2 changes: 1 addition & 1 deletion VSharp.Test/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ private TestResult Explore(TestExecutionContext context)
else
{
context.CurrentResult.SetResult(
_expectedCoverage is not null
_expectedCoverage > 0
? ResultState.Failure
: ResultState.Success
);
Expand Down

0 comments on commit 69fb4a8

Please sign in to comment.