stream: STREAM_TYPE_FILE will now read file upfront
No more having to chunk read - if ~stream_init_file~ is used, the constructor slurps the entire file into the cache. This pays up front for a bunch of checks essentially. ~stream_init_pipe~ should be used for chunked reading.
This commit is contained in:
@@ -113,9 +113,8 @@ void stream_test_file(void)
|
||||
TEST(err == STREAM_ERR_OK, "Expected initialisating to be okay: %s",
|
||||
stream_err_to_cstr(err));
|
||||
}
|
||||
TEST(stream_size(&stream) == 0, "Stream doesn't read on init: size = %lu",
|
||||
stream_size(&stream));
|
||||
TEST(!stream_eoc(&stream), "Stream should not be at the EoC from init.");
|
||||
stream_stop(&stream);
|
||||
}
|
||||
|
||||
// try to initialise the stream again but against a nonexistent file - we're
|
||||
|
||||
Reference in New Issue
Block a user