| 248 | static int testErrorsSize = 0; |
| 249 | |
| 250 | static void |
| 251 | testErrorHandler(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { |
| 252 | va_list args; |
| 253 | int res; |
| 254 | |
| 255 | if (testErrorsSize >= 32768) |
| 256 | return; |
| 257 | va_start(args, msg); |
| 258 | res = vsnprintf(&testErrors[testErrorsSize], |
| 259 | 32768 - testErrorsSize, |
| 260 | msg, args); |
| 261 | va_end(args); |
| 262 | if (testErrorsSize + res >= 32768) { |
| 263 | /* buffer is full */ |
| 264 | testErrorsSize = 32768; |
| 265 | testErrors[testErrorsSize] = 0; |
| 266 | } else { |
| 267 | testErrorsSize += res; |
| 268 | } |
| 269 | testErrors[testErrorsSize] = 0; |
| 270 | } |
| 271 | |
| 272 | static void |
| 273 | testStructuredErrorHandler(void *ctx ATTRIBUTE_UNUSED, const xmlError *err) { |
no outgoing calls
no test coverage detected