| 1163 | */ |
| 1164 | |
| 1165 | static int /* O - 1 on success, 0 on failure */ |
| 1166 | do_test(_ipp_file_t *f, /* I - IPP data file */ |
| 1167 | ipptool_test_t *data) /* I - Test data */ |
| 1168 | |
| 1169 | { |
| 1170 | int i, /* Looping var */ |
| 1171 | status_ok, /* Did we get a matching status? */ |
| 1172 | repeat_count = 0, /* Repeat count */ |
| 1173 | repeat_test; /* Repeat the test? */ |
| 1174 | ipptool_expect_t *expect; /* Current expected attribute */ |
| 1175 | ipp_t *request, /* IPP request */ |
| 1176 | *response; /* IPP response */ |
| 1177 | size_t length; /* Length of IPP request */ |
| 1178 | http_status_t status; /* HTTP status */ |
| 1179 | cups_array_t *a; /* Duplicate attribute array */ |
| 1180 | ipp_tag_t group; /* Current group */ |
| 1181 | ipp_attribute_t *attrptr, /* Attribute pointer */ |
| 1182 | *found; /* Found attribute */ |
| 1183 | char temp[1024]; /* Temporary string */ |
| 1184 | cups_file_t *reqfile; /* File to send */ |
| 1185 | ssize_t bytes; /* Bytes read/written */ |
| 1186 | char buffer[1024 * 1024]; /* Copy buffer */ |
| 1187 | size_t widths[200]; /* Width of columns */ |
| 1188 | const char *error; /* Current error */ |
| 1189 | |
| 1190 | |
| 1191 | if (Cancel) |
| 1192 | return (0); |
| 1193 | |
| 1194 | /* |
| 1195 | * Show any PAUSE message, as needed... |
| 1196 | */ |
| 1197 | |
| 1198 | if (data->pause[0]) |
| 1199 | { |
| 1200 | if (!data->skip_test && !data->pass_test) |
| 1201 | pause_message(data->pause); |
| 1202 | |
| 1203 | data->pause[0] = '\0'; |
| 1204 | } |
| 1205 | |
| 1206 | /* |
| 1207 | * Start the background thread as needed... |
| 1208 | */ |
| 1209 | |
| 1210 | if (data->monitor_uri) |
| 1211 | { |
| 1212 | data->monitor_done = 0; |
| 1213 | data->monitor_thread = _cupsThreadCreate((_cups_thread_func_t)do_monitor_printer_state, data); |
| 1214 | } |
| 1215 | |
| 1216 | /* |
| 1217 | * Take over control of the attributes in the request... |
| 1218 | */ |
| 1219 | |
| 1220 | request = f->attrs; |
| 1221 | f->attrs = NULL; |
| 1222 |
no test coverage detected