Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix Position getter of uninitiliazed LazyFileStream returning 0 #211

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

pleonex
Copy link
Member

@pleonex pleonex commented Jul 15, 2024

The getter of Position of a LazyFileStream (type used to open files for Nodes by default) was already returning always 0. There was already logic in place to keep the initial position set, and used when opening the file later, but it was not returned.

Quality check list

  • Related code has been tested automatically or manually
  • Related documentation is updated
  • I acknowledge I have read and filled this checklist and accept the
    developer certificate of origin

Acceptance criteria

Accessing Position of a lazy FileStream should return the previous assigned value without opening the Stream.

Follow-up work

N/A

Example

using var stream = new LazyFileStream(filePath, FileOpenMode.ReadWrite);
Assert.That(stream.Position, Is.EqualTo(0));

stream.Position = 0x42;
Assert.That(stream.BaseStream, Is.Null);
Assert.That(stream.Position, Is.EqualTo(0x42));

@pleonex pleonex added the bug label Jul 15, 2024
@pleonex pleonex self-assigned this Jul 15, 2024
@pleonex pleonex merged commit aaf9996 into develop Jul 15, 2024
5 checks passed
@pleonex pleonex deleted the feature/fix-lazyfile-initialpos branch July 15, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant