FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: fix captured-disposed analyzer hint and ambiguous OpenImageStre… · purelogiccode/XISOSharp@66653b0 · GitHub

Repository navigation

Commit 66653b0

Browse files
test: fix captured-disposed analyzer hint and ambiguous OpenImageStream cref
- XisoExplorerKeepOpenTests: block-scope the keep-open explorer so the Parallel.For lambda capture no longer trips 'captured variable is disposed in the outer scope'. - XisoStreamApiTests: qualify the OpenImageStream doc reference to the string overload (the new FileShare overload made the bare cref ambiguous).
1 parent 1346f72 commit 66653b0

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

‎XISOSharp.Tests/XisoExplorerKeepOpenTests.cs‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,27 @@ public void KeepOpen_OperationsMatchStatelessExplorer()
8282
public void KeepOpen_ParallelMetadataOperations_Smoke()
8383
{
8484
string iso = CreateIso();
85-
using XisoExplorer explorer = new(iso, new XisoExplorerOptions { KeepOpen = true });
86-
87-
Parallel.For(0, 64, i =>
85+
using (XisoExplorer explorer = new(iso, new XisoExplorerOptions { KeepOpen = true }))
8886
{
89-
switch (i % 4)
87+
Parallel.For(0, 64, i =>
9088
{
91-
case 0:
92-
Assert.Equal(4, explorer.ListChildren("/").Count);
93-
break;
94-
case 1:
95-
Assert.Equal("a.txt", explorer.GetNode("/a.txt")!.Name);
96-
break;
97-
case 2:
98-
Assert.NotNull(explorer.ComputeHashHex("/b.txt", HashAlgorithmName.SHA256));
99-
break;
100-
default:
101-
Assert.Equal("c.txt", explorer.ListChildren("/sub").Single().Name);
102-
break;
103-
}
104-
});
89+
switch (i % 4)
90+
{
91+
case 0:
92+
Assert.Equal(4, explorer.ListChildren("/").Count);
93+
break;
94+
case 1:
95+
Assert.Equal("a.txt", explorer.GetNode("/a.txt")!.Name);
96+
break;
97+
case 2:
98+
Assert.NotNull(explorer.ComputeHashHex("/b.txt", HashAlgorithmName.SHA256));
99+
break;
100+
default:
101+
Assert.Equal("c.txt", explorer.ListChildren("/sub").Single().Name);
102+
break;
103+
}
104+
});
105+
}
105106
}
106107

107108
[Fact]

‎XISOSharp.Tests/XisoStreamApiTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace XISOSharp.Tests;
55

66
/// <summary>
77
/// Tests for the public stream-based read API (TODO #12, third bullet):
8-
/// <see cref="XisoReader.OpenImageStream"/>, the <c>Stream</c> overloads of
8+
/// <see cref="XisoReader.OpenImageStream(string)"/>, the <c>Stream</c> overloads of
99
/// <c>Extract</c>/<c>UnpackImage</c>/<c>List</c>/<c>Tree</c>/<c>DecodeXiso</c>,
1010
/// and <see cref="XisoReader.IsOptimizedImage(Stream, int?)"/>.
1111
/// </summary>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL