-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/ios-voiceover
- Loading branch information
Showing
11 changed files
with
165 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/Avalonia.Base.UnitTests/Platform/SlicedStreamTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.IO; | ||
using Avalonia.Platform.Internal; | ||
using Xunit; | ||
|
||
namespace Avalonia.Base.UnitTests; | ||
|
||
public class SlicedStreamTests | ||
{ | ||
[Theory] | ||
[InlineData(2, SeekOrigin.Begin, 22, 2, 9)] | ||
[InlineData(2, SeekOrigin.Current, 22, 17, 24)] | ||
[InlineData(-2, SeekOrigin.End, 22, 40, 47)] | ||
public void Seek_Works( | ||
long offset, | ||
SeekOrigin origin, | ||
long startingUnderlyingPosition, | ||
long expectedPosition, | ||
long expectedUnderlyingPosition) | ||
{ | ||
var memoryStream = new MemoryStream(new byte[1024]); | ||
var slicedStream = new SlicedStream(memoryStream, 7, 42); | ||
memoryStream.Position = startingUnderlyingPosition; | ||
|
||
slicedStream.Seek(offset, origin); | ||
|
||
Assert.Equal(expectedPosition, slicedStream.Position); | ||
Assert.Equal(expectedUnderlyingPosition, memoryStream.Position); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters