MCPcopy Create free account
hub / github.com/WheretIB/nullc / Run

Method Run

tests/TestRuntimeFail.cpp:327–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325struct 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};
363Test_testDepthOverflowUnmanaged test_testDepthOverflowUnmanaged;
364

Callers

nothing calls this directly

Calls 9

nullcSetJiTStackFunction · 0.85
nullcSetExecutorFunction · 0.85
nullcBuildFunction · 0.85
assertFunction · 0.85
nullcRunFunction · 0.85
strstrFunction · 0.85
nullcGetLastErrorFunction · 0.85
strchrFunction · 0.85
strcmpFunction · 0.85

Tested by

no test coverage detected