test vector file open mode fix

- if data contained EOF in binary, test vector reading was not finished
- small refactoring