MCPcopy Create free account
hub / github.com/OpenPrinting/cups / read_test

Function read_test

cups/rasterbench.c:168–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 */
167
168static void
169read_test(int fd) /* I - File descriptor to read from */
170{
171 unsigned y; /* Looping var */
172 cups_raster_t *r; /* Raster stream */
173 cups_page_header2_t header; /* Page header */
174 unsigned char buffer[8 * TEST_WIDTH];
175 /* Read buffer */
176
177
178 /*
179 * Test read speed...
180 */
181
182 if ((r = cupsRasterOpen(fd, CUPS_RASTER_READ)) == NULL)
183 {
184 perror("Unable to create raster input stream");
185 return;
186 }
187
188 while (cupsRasterReadHeader2(r, &header))
189 {
190 for (y = 0; y < header.cupsHeight; y ++)
191 cupsRasterReadPixels(r, buffer, header.cupsBytesPerLine);
192 }
193
194 cupsRasterClose(r);
195}
196
197
198/*

Callers 1

run_read_testFunction · 0.85

Calls 4

cupsRasterOpenFunction · 0.85
cupsRasterReadHeader2Function · 0.85
cupsRasterReadPixelsFunction · 0.85
cupsRasterCloseFunction · 0.85

Tested by

no test coverage detected