MCPcopy Create free account
hub / github.com/MikeMirzayanov/testlib / refill

Method refill

testlib.h:1882–1905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1880 size_t bufferSize;
1881
1882 bool refill() {
1883 if (NULL == file)
1884 __testlib_fail("BufferedFileInputStreamReader: file == NULL (" + getName() + ")");
1885
1886 if (bufferPos >= int(bufferSize)) {
1887 size_t readSize = fread(
1888 buffer + MAX_UNREAD_COUNT,
1889 1,
1890 BUFFER_SIZE - MAX_UNREAD_COUNT,
1891 file
1892 );
1893
1894 if (readSize < BUFFER_SIZE - MAX_UNREAD_COUNT
1895 && ferror(file))
1896 __testlib_fail("BufferedFileInputStreamReader: unable to read (" + getName() + ")");
1897
1898 bufferSize = MAX_UNREAD_COUNT + readSize;
1899 bufferPos = int(MAX_UNREAD_COUNT);
1900 std::memset(isEof + MAX_UNREAD_COUNT, 0, sizeof(isEof[0]) * readSize);
1901
1902 return readSize > 0;
1903 } else
1904 return true;
1905 }
1906
1907 char increment() {
1908 char c;

Callers

nothing calls this directly

Calls 1

__testlib_failFunction · 0.70

Tested by

no test coverage detected