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

Seeking before beginning of file should fail #157

Merged
merged 2 commits into from
Aug 1, 2017

Commits on Jul 26, 2017

  1. Seeking before beginning of file should fail

    When seeking in a file to a location before the beginning of the file,
    the operation seems to succeed. While if i try to do the same with a
    "real" file then the seek command will return an error.
    
    So i changed the seek method to return false if the offset is less
    than 0. This seems to solve my problem and behaves in the same
    way as seeking in a real file. However I do not know if there are
    situations where seeking before the beginning of the file could be
    a valid use case. testing with fseek on unix fs always returns -1
    when seeking past the beginning of the file. Added five test
    assertions to validate this behavior.
    merijnvdk committed Jul 26, 2017
    Configuration menu
    Copy the full SHA
    44348c5 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2017

  1. Seeking before beginning of file should fail

    Implemented pull request feedback:
    
    - Refactor seek so internal offset is not modified when the seek fails.
    
    - Moved "seek before beginning" assertions into their own test methods.
    merijnvdk committed Jul 31, 2017
    Configuration menu
    Copy the full SHA
    dbf28b5 View commit details
    Browse the repository at this point in the history