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

Function read_array

samples/asserts.cc:129–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected