| 347 | } |
| 348 | |
| 349 | void TEST_FOR_FAIL(const char* name, const char* str, const char* error) |
| 350 | { |
| 351 | testsCount[TEST_FAILURE_INDEX]++; |
| 352 | nullres good = nullcCompile(str); |
| 353 | if(!good) |
| 354 | { |
| 355 | char buf[1024]; |
| 356 | strncpy(buf, strstr(nullcGetLastError(), "ERROR:"), 1023); buf[1023] = 0; |
| 357 | if(char *lineEnd = strchr(buf, '\r')) |
| 358 | *lineEnd = 0; |
| 359 | if(strcmp(error, buf) != 0) |
| 360 | { |
| 361 | printf("Failed %s but for wrong reason:\r\n %s\r\nexpected:\r\n %s\r\n", name, buf, error); |
| 362 | }else{ |
| 363 | testsPassed[TEST_FAILURE_INDEX]++; |
| 364 | } |
| 365 | }else{ |
| 366 | printf("Test \"%s\" failed to fail.\r\n", name); |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | void TEST_FOR_FAIL_GENERIC(const char* name, const char* str, const char* error1, const char* error2) |
| 371 | { |
no test coverage detected