mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Refactor IMediaImage.ReadSector(s) to return error status instead of buffer.
This commit is contained in:
@@ -114,6 +114,7 @@ namespace Aaru.Tests.Images
|
||||
public void Hashes()
|
||||
{
|
||||
Environment.CurrentDirectory = DataFolder;
|
||||
ErrorNumber errno;
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
@@ -151,15 +152,18 @@ namespace Aaru.Tests.Images
|
||||
|
||||
if(image.Info.Sectors - doneSectors >= SECTORS_TO_READ)
|
||||
{
|
||||
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
|
||||
errno = image.ReadSectors(doneSectors, SECTORS_TO_READ, out sector);
|
||||
doneSectors += SECTORS_TO_READ;
|
||||
}
|
||||
else
|
||||
{
|
||||
sector = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors));
|
||||
errno = image.ReadSectors(doneSectors, (uint)(image.Info.Sectors - doneSectors),
|
||||
out sector);
|
||||
|
||||
doneSectors += image.Info.Sectors - doneSectors;
|
||||
}
|
||||
|
||||
Assert.AreEqual(ErrorNumber.NoError, errno);
|
||||
ctx.Update(sector);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user