本文整理汇总了C++中RTR3InitExe函数的典型用法代码示例。如果您正苦于以下问题:C++ RTR3InitExe函数的具体用法?C++ RTR3InitExe怎么用?C++ RTR3InitExe使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTR3InitExe函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
RTR3InitExe(argc, &argv, 0);
int rcRet = 0;
if (argc <= 1)
{
RTPrintf("usage: %s <module> [more modules]\n", argv[0]);
return 1;
}
/*
* Iterate the files.
*/
for (int argi = 1; argi < argc; argi++)
{
RTPrintf("tstLdr: TESTING '%s'...\n", argv[argi]);
rcRet += testLdrOne(argv[argi]);
}
/*
* Test result summary.
*/
if (!rcRet)
RTPrintf("tstLdr: SUCCESS\n");
else
RTPrintf("tstLdr: FAILURE - %d errors\n", rcRet);
return !!rcRet;
}
示例2: main
int main(int argc, char **argv)
{
RTR3InitExe(argc, &argv, 0);
/*
* Initialize IPRT and create the test.
*/
RTTEST hTest;
int rc = RTTestInitAndCreate("tstAudioMixBuffer", &hTest);
if (rc)
return rc;
RTTestBanner(hTest);
rc = tstSingle(hTest);
if (RT_SUCCESS(rc))
rc = tstParentChild(hTest);
if (RT_SUCCESS(rc))
rc = tstConversion8(hTest);
if (RT_SUCCESS(rc))
rc = tstConversion16(hTest);
if (RT_SUCCESS(rc))
rc = tstVolume(hTest);
/*
* Summary
*/
return RTTestSummaryAndDestroy(hTest);
}
示例3: main
int main(int argc, char **argv)
{
int rc = RTR3InitExe(argc, &argv, 0);
if (RT_FAILURE(rc))
return RTMsgInitFailure(rc);
return RTPathRmCmd(argc, argv);
}
示例4: main
/**
* Main entry point.
*/
int main(int argc, char **argv, char **envp)
{
int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
if (RT_FAILURE(rc))
return RTMsgInitFailure(rc);
return TrustedMain(argc, argv, envp);
}
示例5: main
int main(int argc, char *argv[])
{
int rc;
RTR3InitExe(argc, &argv, 0);
RTPrintf("tstVD-2: TESTING...\n");
rc = tstVDBackendInfo();
if (RT_FAILURE(rc))
{
RTPrintf("tstVD-2: getting backend info test failed! rc=%Rrc\n", rc);
g_cErrors++;
}
rc = VDShutdown();
if (RT_FAILURE(rc))
{
RTPrintf("tstVD-2: unloading backends failed! rc=%Rrc\n", rc);
g_cErrors++;
}
/*
* Summary
*/
if (!g_cErrors)
RTPrintf("tstVD-2: SUCCESS\n");
else
RTPrintf("tstVD-2: FAILURE - %d errors\n", g_cErrors);
return !!g_cErrors;
}
示例6: tstRTCreateProcEx5Child
static int tstRTCreateProcEx5Child(int argc, char **argv)
{
int rc = RTR3InitExe(argc, &argv, 0);
if (RT_FAILURE(rc))
return RTMsgInitFailure(rc);
uint32_t cErrors = 0;
/* Check that the OS thinks we're running as the user we're supposed to. */
char *pszUser;
rc = RTProcQueryUsernameA(NIL_RTPROCESS, &pszUser);
if (RT_SUCCESS(rc))
{
#ifdef RT_OS_WINDOWS
if (RTStrICmp(pszUser, argv[2]) != 0)
#else
if (RTStrCmp(pszUser, argv[2]) != 0)
#endif
{
RTStrmPrintf(g_pStdErr, "child4: user name is '%s', expected '%s'\n", pszUser, argv[2]);
cErrors++;
}
RTStrFree(pszUser);
}
else
{
RTStrmPrintf(g_pStdErr, "child4: RTProcQueryUsernameA failed: %Rrc\n", rc);
cErrors++;
}
return cErrors == 0 ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
}
示例7: main
int main( int argc, char **argv)
{
int rc = VINF_SUCCESS;
char ach[2];
RTR3InitExe(argc, &argv, 0);
RTPrintf("VirtualBox guest additions X11 seamless mode testcase\n");
if (0 == XInitThreads())
{
RTPrintf("Failed to initialise X11 threading, exiting.\n");
exit(1);
}
/* Set an X11 error handler, so that we don't die when we get unavoidable errors. */
XSetErrorHandler(vboxClientXLibErrorHandler);
RTPrintf("\nPress <Enter> to exit...\n");
RTSemEventCreate(&eventSem);
/** Our instance of the seamless class. */
VBoxGuestSeamless seamless;
LogRel(("Starting seamless Guest Additions...\n"));
rc = seamless.init();
if (rc != VINF_SUCCESS)
{
RTPrintf("Failed to initialise seamless Additions, rc = %d\n", rc);
}
RTStrmGetLine(g_pStdIn, ach, sizeof(ach));
seamless.uninit();
return rc;
}
示例8: main
int main(int argc, char **argv)
{
int rc = RTR3InitExe(argc, &argv, 0);
if (RT_FAILURE(rc))
return RTMsgInitFailure(rc);
/*
* Switch on the command.
*/
RTEXITCODE rcExit = RTEXITCODE_SYNTAX;
if (argc < 2)
rtDbgSymCacheUsage(argv[0], NULL);
else if (!strcmp(argv[1], "add"))
rcExit = rtDbgSymCacheCmdAdd(argv[0], argc - 2, argv + 2);
else if ( !strcmp(argv[1], "-h")
|| !strcmp(argv[1], "-?")
|| !strcmp(argv[1], "--help"))
rcExit = rtDbgSymCacheUsage(argv[0], NULL);
else if ( !strcmp(argv[1], "-V")
|| !strcmp(argv[1], "--version"))
rcExit = rtDbgSymCacheVersion();
else
RTMsgError("Unknown command: '%s'", argv[1]);
return rcExit;
}
示例9: main
int main(int argc, char **argv)
{
int rc;
RTR3InitExe(argc, &argv, 0);
rc = SUPR3Init(NULL);
if (RT_SUCCESS(rc))
{
SUPPAGINGMODE enmMode = SUPR3GetPagingMode();
switch (enmMode)
{
case SUPPAGINGMODE_INVALID:
RTPrintf("SUPPAGINGMODE_INVALID\n");
break;
case SUPPAGINGMODE_32_BIT:
RTPrintf("SUPPAGINGMODE_32_BIT\n");
break;
case SUPPAGINGMODE_32_BIT_GLOBAL:
RTPrintf("SUPPAGINGMODE_32_BIT_GLOBAL\n");
break;
case SUPPAGINGMODE_PAE:
RTPrintf("SUPPAGINGMODE_PAE\n");
break;
case SUPPAGINGMODE_PAE_GLOBAL:
RTPrintf("SUPPAGINGMODE_PAE_GLOBAL\n");
break;
case SUPPAGINGMODE_PAE_NX:
RTPrintf("SUPPAGINGMODE_PAE_NX\n");
break;
case SUPPAGINGMODE_PAE_GLOBAL_NX:
RTPrintf("SUPPAGINGMODE_PAE_GLOBAL_NX\n");
break;
case SUPPAGINGMODE_AMD64:
RTPrintf("SUPPAGINGMODE_AMD64\n");
break;
case SUPPAGINGMODE_AMD64_GLOBAL:
RTPrintf("SUPPAGINGMODE_AMD64_GLOBAL\n");
break;
case SUPPAGINGMODE_AMD64_NX:
RTPrintf("SUPPAGINGMODE_AMD64_NX\n");
break;
case SUPPAGINGMODE_AMD64_GLOBAL_NX:
RTPrintf("SUPPAGINGMODE_AMD64_GLOBAL_NX\n");
break;
default:
RTPrintf("Unknown mode %d\n", enmMode);
rc = VERR_INTERNAL_ERROR;
break;
}
int rc2 = SUPR3Term(false /*fForced*/);
RTPrintf("SUPR3Term -> rc=%Rrc\n", rc2);
}
else
RTPrintf("SUPR3Init -> rc=%Rrc\n", rc);
return !RT_SUCCESS(rc);
}
示例10: main
int main(int argc, char **argv)
{
/*
* Initialize the runtime and VD.
*/
int rc = RTR3InitExe(argc, &argv, 0);
if (RT_FAILURE(rc))
{
RTStrmPrintf(g_pStdErr, "VBoxFUSE: RTR3InitExe failed, rc=%Rrc\n", rc);
return 1;
}
RTPrintf("VBoxFUSE: Hello...\n");
rc = VDInit();
if (RT_FAILURE(rc))
{
RTStrmPrintf(g_pStdErr, "VBoxFUSE: VDInit failed, rc=%Rrc\n", rc);
return 1;
}
/*
* Initializes the globals and populate the file hierarchy.
*/
rc = vboxfuseDirCreate("/", NULL);
if (RT_SUCCESS(rc))
rc = vboxfuseDirCreate("/FlattenedImages", NULL);
if (RT_FAILURE(rc))
{
RTStrmPrintf(g_pStdErr, "VBoxFUSE: vboxfuseDirCreate failed, rc=%Rrc\n", rc);
return 1;
}
/*
* Initialize the g_vboxfuseOps. (C++ sucks!)
*/
memset(&g_vboxfuseOps, 0, sizeof(g_vboxfuseOps));
g_vboxfuseOps.getattr = vboxfuseOp_getattr;
g_vboxfuseOps.opendir = vboxfuseOp_opendir;
g_vboxfuseOps.readdir = vboxfuseOp_readdir;
g_vboxfuseOps.releasedir = vboxfuseOp_releasedir;
g_vboxfuseOps.symlink = vboxfuseOp_symlink;
g_vboxfuseOps.open = vboxfuseOp_open;
g_vboxfuseOps.read = vboxfuseOp_read;
g_vboxfuseOps.write = vboxfuseOp_write;
g_vboxfuseOps.release = vboxfuseOp_release;
/*
* Hand control over to libfuse.
*/
#if 0
/** @todo multithreaded fun. */
#else
rc = fuse_main(argc, argv, &g_vboxfuseOps, NULL);
#endif
RTPrintf("VBoxFUSE: fuse_main -> %d\n", rc);
return rc;
}
示例11: main
int main(int argc, char *argv[])
{
RTR3InitExe(argc, &argv, 0);
int rc;
RTPrintf("tstVD: TESTING...\n");
/*
* Clean up potential leftovers from previous unsuccessful runs.
*/
RTFileDelete("tmpVDCreate.vdi");
if (!RTDirExists("tmp"))
{
rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU, 0);
if (RT_FAILURE(rc))
{
RTPrintf("tstVD: Failed to create 'tmp' directory! rc=%Rrc\n", rc);
g_cErrors++;
}
}
#ifdef VDI_TEST
rc = tstVDCreateShareDelete("VDI", "tmpVDCreate.vdi", 10 * _1M,
VD_IMAGE_FLAGS_FIXED);
if (RT_FAILURE(rc))
{
RTPrintf("tstVD: VDI shareable test failed! rc=%Rrc\n", rc);
g_cErrors++;
}
#endif /* VDI_TEST */
/*
* Clean up any leftovers.
*/
RTFileDelete("tmpVDCreate.vdi");
rc = VDShutdown();
if (RT_FAILURE(rc))
{
RTPrintf("tstVD: unloading backends failed! rc=%Rrc\n", rc);
g_cErrors++;
}
/*
* Summary
*/
if (!g_cErrors)
RTPrintf("tstVD: SUCCESS\n");
else
RTPrintf("tstVD: FAILURE - %d errors\n", g_cErrors);
return !!g_cErrors;
}
示例12: main
int main(int argc, char *argv[])
{
RTR3InitExe(argc, &argv, 0);
int rc;
VDSNAPTEST Test;
RTPrintf("tstVDSnap: TESTING...\n");
rc = RTRandAdvCreateParkMiller(&g_hRand);
if (RT_FAILURE(rc))
{
RTPrintf("tstVDSnap: Creating RNG failed rc=%Rrc\n", rc);
return 1;
}
RTRandAdvSeed(g_hRand, 0x12345678);
Test.pcszBackend = "vmdk";
Test.pcszBaseImage = "tstVDSnapBase.vmdk";
Test.pcszDiffSuff = "vmdk";
Test.cIterations = 30;
Test.cbTestPattern = 10 * _1M;
Test.cDiskSegsMin = 10;
Test.cDiskSegsMax = 50;
Test.cDiffsMinBeforeMerge = 5;
Test.uCreateDiffChance = 50; /* % */
Test.uChangeSegChance = 50; /* % */
Test.uAllocatedBlocks = 50; /* 50% allocated */
Test.fForward = true;
tstVDOpenCreateWriteMerge(&Test);
/* Same test with backwards merge */
Test.fForward = false;
tstVDOpenCreateWriteMerge(&Test);
rc = VDShutdown();
if (RT_FAILURE(rc))
{
RTPrintf("tstVDSnap: unloading backends failed! rc=%Rrc\n", rc);
g_cErrors++;
}
/*
* Summary
*/
if (!g_cErrors)
RTPrintf("tstVDSnap: SUCCESS\n");
else
RTPrintf("tstVDSnap: FAILURE - %d errors\n", g_cErrors);
RTRandAdvDestroy(g_hRand);
return !!g_cErrors;
}
示例13: main
int main(int argc, char **argv)
{
int rcRet = 0; /* error count. */
RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
/*
* Doesn't work and I'm sick of rebooting the machine to try figure out
* what the heck is going wrong. (Linux sucks at this)
*/
RTPrintf(TESTCASE ": This testcase hits a bunch of breakpoint assertions which\n"
TESTCASE ": causes kernel panics on linux regardless of what\n"
TESTCASE ": RTAssertDoBreakpoint returns. Only checked AMD-V on linux.\n");
/** @todo Make tstVMM-Hm to cause kernel panics. */
return 1;
/*
* Create empty VM.
*/
RTPrintf(TESTCASE ": Initializing...\n");
PVM pVM;
PUVM pUVM;
int rc = VMR3Create(1, NULL, NULL, NULL, tstVmmHmConfigConstructor, NULL, &pVM, &pUVM);
if (RT_SUCCESS(rc))
{
/*
* Do testing.
*/
RTPrintf(TESTCASE ": Testing...\n");
rc = VMR3ReqCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)VMMDoHmTest, 1, pVM);
AssertRC(rc);
STAMR3Dump(pUVM, "*");
/*
* Cleanup.
*/
rc = VMR3Destroy(pUVM);
if (RT_FAILURE(rc))
{
RTPrintf(TESTCASE ": error: failed to destroy vm! rc=%d\n", rc);
rcRet++;
}
VMR3ReleaseUVM(pUVM);
}
else
{
RTPrintf(TESTCASE ": fatal error: failed to create vm! rc=%d\n", rc);
rcRet++;
}
return rcRet;
}
示例14: main
int main(int argc, char **argv)
{
int rc;
RTR3InitExe(argc, &argv, 0);
rc = SUPR3Init(NULL);
RTPrintf("tstInit: SUPR3Init -> rc=%Rrc\n", rc);
if (!rc)
{
rc = SUPR3Term(false /*fForced*/);
RTPrintf("tstInit: SUPR3Term -> rc=%Rrc\n", rc);
}
return rc;
}
示例15: main
int main(int argc, char **argv)
{
int rcRet = 0;
RTR3InitExe(argc, &argv, 0);
/*
* If no args, display usage.
*/
if (argc <= 1)
{
RTPrintf("Syntax: %s [so/dll [so/dll [..]]\n", argv[0]);
return 1;
}
/*
* Iterate the arguments and treat all of them as so/dll paths.
*/
for (int i = 1; i < argc; i++)
{
RTLDRMOD hLdrMod = (RTLDRMOD)0xbaadffaa;
int rc = RTLdrLoad(argv[i], &hLdrMod);
if (RT_SUCCESS(rc))
{
RTPrintf("tstLdrLoad: %d - %s\n", i, argv[i]);
rc = RTLdrClose(hLdrMod);
if (RT_FAILURE(rc))
{
RTPrintf("tstLdrLoad: rc=%Rrc RTLdrClose()\n", rc);
rcRet++;
}
}
else
{
RTPrintf("tstLdrLoad: rc=%Rrc RTLdrOpen('%s')\n", rc, argv[i]);
rcRet++;
}
}
/*
* Summary.
*/
if (!rcRet)
RTPrintf("tstLdrLoad: SUCCESS\n");
else
RTPrintf("tstLdrLoad: FAILURE - %d errors\n", rcRet);
return !!rcRet;
}