MCPcopy Create free account
hub / github.com/Snaipe/Criterion / read_array

Function read_array

samples/asserts.c:133–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131};
132
133static int read_array(void *cookie, void *buffer, size_t *size)
134{
135 struct array_cursor *arr = cookie;
136 size_t rem = *size;
137 if (rem > arr->size - arr->off) {
138 rem = arr->size - arr->off;
139 }
140
141 memcpy(buffer, (char *) arr->buf + arr->off, rem);
142 arr->off += rem;
143 *size = rem;
144
145 return 0;
146}
147
148Test(asserts, stream) {
149 struct array_cursor arr1 = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected