コード例 #1
0
ファイル: test_fork_8.C プロジェクト: cuviper/testsuite
/* And verify them when they exit */
static void exitFunc(BPatch_thread *thread, BPatch_exitType exit_type) {
    dprintf("Exit func called\n");
    if (thread == parentThread) {
        dprintf("Parent exit reached, checking...\n");
        checkTestCase4(Parent_p, thread);
        parentDone = true;
        dprintf("Parent done\n");
    }
    else if (thread == childThread) {
        dprintf("Child exit reached, checking...\n");
        checkTestCase4(Child_p, thread);
        dprintf("Child done\n");
        childDone = true;
    }
    else {
        dprintf("Thread ptr 0x%x, parent 0x%x, child 0x%x\n",
                thread, parentThread, childThread);
        assert(0 && "Unexpected BPatch_thread in exitFunc");
    }
    return;
}
コード例 #2
0
ファイル: test7.C プロジェクト: vishalmistry/imitate
void checkTests(procType proc_type, BPatch_thread *thread)
{
  //cerr << "checkTests, proc_type: " << proc_type << "\n";
   for(unsigned testNum=1; testNum<=MAX_TEST; testNum++) {
     //cerr << "testNum: " << testNum << "\n";
      if(! runTest[testNum] || passedTest[testNum]==false) continue;
      switch(testNum) {
	case 1:  checkTestCase1(proc_type, thread);  break;
	case 2:  checkTestCase2(proc_type, thread);  break;
	case 3:  checkTestCase3(proc_type, thread);  break;
	case 4:  checkTestCase4(proc_type, thread);  break;
	case 5:  checkTestCase5(proc_type, thread);  break;
	case 6:  checkTestCase6(proc_type, thread);  break;
	case 7:  checkTestCase7(proc_type, thread);  break;
	case 8:  checkTestCase8(proc_type, thread);  break;
	case 9:  checkTestCase9(proc_type, thread);  break;
	default: 
	   fprintf(stderr, "checkTest: Invalid test num type\n");
	   exit(0);
	   break;
      }
   }
}