| 325 | struct Test_testDepthOverflowUnmanaged : TestQueue |
| 326 | { |
| 327 | virtual void Run() |
| 328 | { |
| 329 | nullcSetJiTStack((void*)0x20000000, (void*)(0x20000000 + 1024*1024), false); |
| 330 | if(Tests::messageVerbose) |
| 331 | printf("Depth overflow in unmanaged memory\r\n"); |
| 332 | { |
| 333 | testsCount[1]++; |
| 334 | nullcSetExecutor(NULLC_X86); |
| 335 | nullres good = nullcBuild(testDepthOverflowUnmanaged); |
| 336 | assert(good); |
| 337 | good = nullcRun(); |
| 338 | if(!good) |
| 339 | { |
| 340 | const char *error = "ERROR: failed to reserve new stack memory"; |
| 341 | char buf[512];\ |
| 342 | strcpy(buf, strstr(nullcGetLastError(), "ERROR:")); |
| 343 | if(char *lineEnd = strchr(buf, '\r')) |
| 344 | *lineEnd = 0; |
| 345 | if(strcmp(error, buf) != 0) |
| 346 | { |
| 347 | if(Tests::messageVerbose) |
| 348 | printf("Depth overflow in unmanaged memory\r\n"); |
| 349 | printf("X86 failed but for wrong reason:\r\n %s\r\nexpected:\r\n %s\r\n", buf, error); |
| 350 | }else{ |
| 351 | testsPassed[1]++; |
| 352 | } |
| 353 | }else{ |
| 354 | if(Tests::messageVerbose) |
| 355 | printf("Depth overflow in unmanaged memory\r\n"); |
| 356 | printf("Test should have failed.\r\n"); |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | nullcSetJiTStack((void*)0x20000000, NULL, false); |
| 361 | } |
| 362 | }; |
| 363 | Test_testDepthOverflowUnmanaged test_testDepthOverflowUnmanaged; |
| 364 |
nothing calls this directly
no test coverage detected