Skip to content

Commit

Permalink
flush writer so that it is still written to file if .Sample throws an…
Browse files Browse the repository at this point in the history
… exception due to failed test case
  • Loading branch information
pppls committed Sep 4, 2024
1 parent 72ecc70 commit affd392
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ data
/dataSources/
/dataSources.local.xml
.idea
CsCheck.sln.DotSettings.user
2 changes: 1 addition & 1 deletion CsCheck/Check.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static void Process<T>(
metric.Succeeded ? "passed" : "failed", metric.input
, "reason", d, "testing", d, null, d, d));
genLogParameters.streamWriter.Write(JsonSerializer.Serialize(tycheData));

genLogParameters.streamWriter.Flush();
break;
default:
throw new ArgumentOutOfRangeException(nameof(genLogParameters), genLogParameters, null);
Expand Down
4 changes: 1 addition & 3 deletions Tests/MetricLogsTest.cs → Tests/GenLogsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Tests;

public class MetricLogsTest
public class GenLogsTest
{
static int[] Tally(int n, int[] ia)
{
Expand Down Expand Up @@ -37,8 +37,6 @@ public void Bool_Distribution_WithTycheLogs(int generatedIntUponTrue)
{
}

writer.Flush();

memoryStream.Position = 0;
string json;
using (StreamReader reader = new StreamReader(memoryStream, Encoding.UTF8))
Expand Down

0 comments on commit affd392

Please sign in to comment.