本文整理汇总了C++中RTTestSub函数的典型用法代码示例。如果您正苦于以下问题:C++ RTTestSub函数的具体用法?C++ RTTestSub怎么用?C++ RTTestSub使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTTestSub函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
/*
* Init.
*/
RTTEST hTest;
int rc;
if ( RT_FAILURE(rc = RTR3InitExeNoArguments(0))
|| RT_FAILURE(rc = RTTestCreate("tstVMMR0CallHost-1", &hTest)))
{
RTStrmPrintf(g_pStdErr, "tstVMMR0CallHost-1: Fatal error during init: %Rrc\n", rc);
return 1;
}
RTTestBanner(hTest);
g_Jmp.pvSavedStack = (RTR0PTR)RTTestGuardedAllocTail(hTest, VMM_STACK_SIZE);
/*
* Run two test with about 1000 long jumps each.
*/
RTTestSub(hTest, "Increasing stack usage");
tst(0, 7000, 1);
RTTestSub(hTest, "Decreasing stack usage");
tst(7599, 0, -1);
return RTTestSummaryAndDestroy(hTest);
}
示例2: main
int main()
{
int rc = RTTestInitAndCreate("tstRTFileAio", &g_hTest);
if (rc)
return rc;
/* Check if the API is available. */
RTTestSub(g_hTest, "RTFileAioGetLimits");
RTFILEAIOLIMITS AioLimits;
RT_ZERO(AioLimits);
RTTESTI_CHECK_RC(rc = RTFileAioGetLimits(&AioLimits), VINF_SUCCESS);
if (RT_SUCCESS(rc))
{
RTTestSub(g_hTest, "Write");
RTFILE hFile;
RTTESTI_CHECK_RC(rc = RTFileOpen(&hFile, "tstFileAio#1.tst",
RTFILE_O_READWRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_NONE | RTFILE_O_ASYNC_IO),
VINF_SUCCESS);
if (RT_SUCCESS(rc))
{
uint8_t *pbTestBuf = (uint8_t *)RTTestGuardedAllocTail(g_hTest, TSTFILEAIO_BUFFER_SIZE);
for (unsigned i = 0; i < TSTFILEAIO_BUFFER_SIZE; i++)
pbTestBuf[i] = i % 256;
uint32_t cReqsMax = AioLimits.cReqsOutstandingMax < TSTFILEAIO_MAX_REQS_IN_FLIGHT
? AioLimits.cReqsOutstandingMax
: TSTFILEAIO_MAX_REQS_IN_FLIGHT;
/* Basic write test. */
RTTestIPrintf(RTTESTLVL_ALWAYS, "Preparing test file, this can take some time and needs quite a bit of harddisk space...\n");
tstFileAioTestReadWriteBasic(hFile, true /*fWrite*/, pbTestBuf, TSTFILEAIO_BUFFER_SIZE, 100*_1M, cReqsMax);
/* Reopen the file before doing the next test. */
RTTESTI_CHECK_RC(RTFileClose(hFile), VINF_SUCCESS);
if (RTTestErrorCount(g_hTest) == 0)
{
RTTestSub(g_hTest, "Read/Write");
RTTESTI_CHECK_RC(rc = RTFileOpen(&hFile, "tstFileAio#1.tst",
RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE | RTFILE_O_ASYNC_IO),
VINF_SUCCESS);
if (RT_SUCCESS(rc))
{
tstFileAioTestReadWriteBasic(hFile, false /*fWrite*/, pbTestBuf, TSTFILEAIO_BUFFER_SIZE, 100*_1M, cReqsMax);
RTFileClose(hFile);
}
}
/* Cleanup */
RTFileDelete("tstFileAio#1.tst");
}
}
/*
* Summary
*/
return RTTestSummaryAndDestroy(g_hTest);
}
示例3: usbTestExec
/**
* Test execution worker.
*
* @returns nothing.
* @param pszDevice The device to use for testing.
*/
static void usbTestExec(const char *pszDevice)
{
int iDevFd;
RTTestSub(g_hTest, "Opening device");
iDevFd = open(pszDevice, O_RDWR);
if (iDevFd != -1)
{
USBTESTPARAMS Params;
RTTestPassed(g_hTest, "Opening device successful\n");
/*
* Fill params with some defaults.
* @todo: Make them configurable.
*/
Params.cIterations = 1000;
Params.cbData = 512;
Params.cbVariation = 512;
Params.cSgLength = 32;
for (unsigned i = 0; i < USBTEST_TEST_CASES; i++)
{
RTTestSub(g_hTest, g_apszTests[i]);
Params.idxTest = i;
/* Assume the test interface has the number 0 for now. */
int rcPosix = usbTestIoctl(iDevFd, 0, &Params);
if (rcPosix < 0 && errno == EOPNOTSUPP)
{
RTTestSkipped(g_hTest, "Not supported");
continue;
}
if (rcPosix < 0)
RTTestFailed(g_hTest, "Test failed with %Rrc\n", RTErrConvertFromErrno(errno));
else
{
uint64_t u64Ns = Params.TimeTest.tv_sec * RT_NS_1SEC + Params.TimeTest.tv_usec * RT_NS_1US;
RTTestValue(g_hTest, "Runtime", u64Ns, RTTESTUNIT_NS);
}
RTTestSubDone(g_hTest);
}
close(iDevFd);
}
else
RTTestFailed(g_hTest, "Opening device failed with %Rrc\n", RTErrConvertFromErrno(errno));
}
示例4: testFSInfoQuerySetEndOfFile
void testFSInfoQuerySetEndOfFile(RTTEST hTest)
{
VBOXHGCMSVCFNTABLE svcTable;
VBOXHGCMSVCHELPERS svcHelpers;
SHFLROOT Root;
const RTFILE hcFile = (RTFILE) 0x10000;
const RTFOFF cbNew = 50000;
SHFLFSOBJINFO Info;
SHFLHANDLE Handle;
int rc;
RTTestSub(hTest, "Set end of file position");
Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers,
"/test/mapping", "testname");
testRTFileOpenpFile = hcFile;
rc = createFile(&svcTable, Root, "/test/file", SHFL_CF_ACCESS_READ,
&Handle, NULL);
RTTEST_CHECK_RC_OK(hTest, rc);
RT_ZERO(Info);
Info.cbObject = cbNew;
rc = sfInformation(&svcTable, Root, Handle, SHFL_INFO_SET | SHFL_INFO_SIZE,
sizeof(Info), &Info);
RTTEST_CHECK_RC_OK(hTest, rc);
RTTEST_CHECK_MSG(hTest, testRTFileSetSizeFile == hcFile,
(hTest, "File=%llu\n", LLUIFY(testRTFileSetSizeFile)));
RTTEST_CHECK_MSG(hTest, testRTFileSetSizeSize == cbNew,
(hTest, "Size=%llu\n", LLUIFY(testRTFileSetSizeSize)));
unmapAndRemoveMapping(hTest, &svcTable, Root, "testname");
AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService));
RTTestGuardedFree(hTest, svcTable.pvService);
RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile,
(hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile)));
}
示例5: testCreateDirSimple
void testCreateDirSimple(RTTEST hTest)
{
VBOXHGCMSVCFNTABLE svcTable;
VBOXHGCMSVCHELPERS svcHelpers;
SHFLROOT Root;
PRTDIR pcDir = (PRTDIR)0x10000;
SHFLCREATERESULT Result;
int rc;
RTTestSub(hTest, "Create directory simple");
Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers,
"/test/mapping", "testname");
testRTDirOpenpDir = pcDir;
rc = createFile(&svcTable, Root, "test/dir",
SHFL_CF_DIRECTORY | SHFL_CF_ACCESS_READ, NULL, &Result);
RTTEST_CHECK_RC_OK(hTest, rc);
RTTEST_CHECK_MSG(hTest,
!strcmp(testRTDirCreatePath, "/test/mapping/test/dir"),
(hTest, "pszPath=%s\n", testRTDirCreatePath));
RTTEST_CHECK_MSG(hTest,
!strcmp(testRTDirOpenName, "/test/mapping/test/dir"),
(hTest, "pszFilename=%s\n", testRTDirOpenName));
RTTEST_CHECK_MSG(hTest, Result == SHFL_FILE_CREATED,
(hTest, "Result=%d\n", (int) Result));
unmapAndRemoveMapping(hTest, &svcTable, Root, "testname");
AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService));
RTTestGuardedFree(hTest, svcTable.pvService);
RTTEST_CHECK_MSG(hTest,
testRTDirClosepDir == pcDir,
(hTest, "pDir=%llu\n", LLUIFY(testRTDirClosepDir)));
}
示例6: Test3
static void Test3(void)
{
RTTestSub(g_hTest, "Negative");
bool fSavedAssertQuiet = RTAssertSetQuiet(true);
bool fSavedAssertMayPanic = RTAssertSetMayPanic(false);
bool fSavedLckValEnabled = RTLockValidatorSetEnabled(false);
RTSEMRW hSemRW;
RTTEST_CHECK_RC_RETV(g_hTest, RTSemRWCreate(&hSemRW), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTSemRWReleaseRead(hSemRW), VERR_NOT_OWNER);
RTTEST_CHECK_RC(g_hTest, RTSemRWReleaseWrite(hSemRW), VERR_NOT_OWNER);
RTTEST_CHECK_RC(g_hTest, RTSemRWRequestWrite(hSemRW, RT_INDEFINITE_WAIT), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTSemRWReleaseRead(hSemRW), VERR_NOT_OWNER);
RTTEST_CHECK_RC(g_hTest, RTSemRWRequestRead(hSemRW, RT_INDEFINITE_WAIT), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTSemRWReleaseWrite(hSemRW), VERR_WRONG_ORDER); /* cannot release the final write before the reads. */
RTTEST_CHECK_RC(g_hTest, RTSemRWReleaseRead(hSemRW), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTSemRWReleaseWrite(hSemRW), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTSemRWDestroy(hSemRW), VINF_SUCCESS);
RTLockValidatorSetEnabled(fSavedLckValEnabled);
RTAssertSetMayPanic(fSavedAssertMayPanic);
RTAssertSetQuiet(fSavedAssertQuiet);
}
示例7: testReadFileSimple
void testReadFileSimple(RTTEST hTest)
{
VBOXHGCMSVCFNTABLE svcTable;
VBOXHGCMSVCHELPERS svcHelpers;
SHFLROOT Root;
const RTFILE hcFile = (RTFILE) 0x10000;
SHFLHANDLE Handle;
const char *pcszReadData = "Data to read";
char acBuf[sizeof(pcszReadData) + 10];
uint32_t cbRead;
int rc;
RTTestSub(hTest, "Read file simple");
Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers,
"/test/mapping", "testname");
testRTFileOpenpFile = hcFile;
rc = createFile(&svcTable, Root, "/test/file", SHFL_CF_ACCESS_READ,
&Handle, NULL);
RTTEST_CHECK_RC_OK(hTest, rc);
testRTFileReadData = pcszReadData;
rc = readFile(&svcTable, Root, Handle, 0, strlen(pcszReadData) + 1,
&cbRead, acBuf, (uint32_t)sizeof(acBuf));
RTTEST_CHECK_RC_OK(hTest, rc);
RTTEST_CHECK_MSG(hTest,
!strncmp(acBuf, pcszReadData, sizeof(acBuf)),
(hTest, "pvBuf=%.*s\n", sizeof(acBuf), acBuf));
RTTEST_CHECK_MSG(hTest, cbRead == strlen(pcszReadData) + 1,
(hTest, "cbRead=%llu\n", LLUIFY(cbRead)));
unmapAndRemoveMapping(hTest, &svcTable, Root, "testname");
RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile,
(hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile)));
AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService));
RTTestGuardedFree(hTest, svcTable.pvService);
}
示例8: testInit
static void testInit(RTTEST hTest)
{
RTTestSub(hTest, "Testing USBProxyLinuxChooseMethod");
for (unsigned i = 0; i < RT_ELEMENTS(s_testEnvironment); ++i)
{
bool fUsingUsbfs = true;
const char *pcszDevicesRoot = "";
TestUSBSetEnv(s_testEnvironment[i].pcszEnvUsb,
s_testEnvironment[i].pcszEnvUsbRoot);
TestUSBSetupInit(s_testEnvironment[i].pcszUsbfsRoot,
s_testEnvironment[i].fUsbfsAccessible,
s_testEnvironment[i].pcszDevicesRoot,
s_testEnvironment[i].fDevicesAccessible,
s_testEnvironment[i].rcMethodInit);
int rc = USBProxyLinuxChooseMethod(&fUsingUsbfs, &pcszDevicesRoot);
RTTESTI_CHECK_MSG(rc == s_testEnvironment[i].rcExpected,
("rc=%Rrc (test index %i) instead of %Rrc!\n",
rc, i, s_testEnvironment[i].rcExpected));
RTTESTI_CHECK_MSG(!RTStrCmp(pcszDevicesRoot,
s_testEnvironment[i].pcszDevicesRootExpected),
("testGetDevicesRoot() returned %s (test index %i) instead of %s!\n",
pcszDevicesRoot, i,
s_testEnvironment[i].pcszDevicesRootExpected));
RTTESTI_CHECK_MSG( fUsingUsbfs
== s_testEnvironment[i].fUsingUsbfsExpected,
("testGetUsingUsbfs() returned %RTbool (test index %i) instead of %RTbool!\n",
fUsingUsbfs, i,
s_testEnvironment[i].fUsingUsbfsExpected));
}
}
示例9: testWriteFileSimple
void testWriteFileSimple(RTTEST hTest)
{
VBOXHGCMSVCFNTABLE svcTable;
VBOXHGCMSVCHELPERS svcHelpers;
SHFLROOT Root;
const RTFILE hcFile = (RTFILE) 0x10000;
SHFLHANDLE Handle;
const char *pcszWrittenData = "Data to write";
uint32_t cbToWrite = (uint32_t)strlen(pcszWrittenData) + 1;
uint32_t cbWritten;
int rc;
RTTestSub(hTest, "Write file simple");
Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers,
"/test/mapping", "testname");
testRTFileOpenpFile = hcFile;
rc = createFile(&svcTable, Root, "/test/file", SHFL_CF_ACCESS_READ,
&Handle, NULL);
RTTEST_CHECK_RC_OK(hTest, rc);
rc = writeFile(&svcTable, Root, Handle, 0, cbToWrite, &cbWritten,
pcszWrittenData, cbToWrite);
RTTEST_CHECK_RC_OK(hTest, rc);
RTTEST_CHECK_MSG(hTest,
!strcmp(testRTFileWriteData, pcszWrittenData),
(hTest, "pvBuf=%s\n", testRTFileWriteData));
RTTEST_CHECK_MSG(hTest, cbWritten == cbToWrite,
(hTest, "cbWritten=%llu\n", LLUIFY(cbWritten)));
unmapAndRemoveMapping(hTest, &svcTable, Root, "testname");
RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile,
(hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile)));
AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService));
RTTestGuardedFree(hTest, svcTable.pvService);
}
示例10: testDirListEmpty
void testDirListEmpty(RTTEST hTest)
{
VBOXHGCMSVCFNTABLE svcTable;
VBOXHGCMSVCHELPERS svcHelpers;
SHFLROOT Root;
PRTDIR pcDir = (PRTDIR)0x10000;
SHFLHANDLE Handle;
SHFLDIRINFO DirInfo;
uint32_t cFiles;
int rc;
RTTestSub(hTest, "List empty directory");
Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers,
"/test/mapping", "testname");
testRTDirOpenpDir = pcDir;
rc = createFile(&svcTable, Root, "test/dir",
SHFL_CF_DIRECTORY | SHFL_CF_ACCESS_READ, &Handle, NULL);
RTTEST_CHECK_RC_OK(hTest, rc);
rc = listDir(&svcTable, Root, Handle, 0, sizeof (SHFLDIRINFO), NULL,
&DirInfo, sizeof(DirInfo), 0, &cFiles);
RTTEST_CHECK_RC(hTest, rc, VERR_NO_MORE_FILES);
RTTEST_CHECK_MSG(hTest, testRTDirReadExDir == pcDir,
(hTest, "Dir=%llu\n", LLUIFY(testRTDirReadExDir)));
RTTEST_CHECK_MSG(hTest, cFiles == 0,
(hTest, "cFiles=%llu\n", LLUIFY(cFiles)));
unmapAndRemoveMapping(hTest, &svcTable, Root, "testname");
AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService));
RTTestGuardedFree(hTest, svcTable.pvService);
RTTEST_CHECK_MSG(hTest,
testRTDirClosepDir == pcDir,
(hTest, "pDir=%llu\n", LLUIFY(testRTDirClosepDir)));
}
示例11: testFlushFileSimple
void testFlushFileSimple(RTTEST hTest)
{
VBOXHGCMSVCFNTABLE svcTable;
VBOXHGCMSVCHELPERS svcHelpers;
SHFLROOT Root;
const RTFILE hcFile = (RTFILE) 0x10000;
SHFLHANDLE Handle;
int rc;
RTTestSub(hTest, "Flush file simple");
Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers,
"/test/mapping", "testname");
testRTFileOpenpFile = hcFile;
rc = createFile(&svcTable, Root, "/test/file", SHFL_CF_ACCESS_READ,
&Handle, NULL);
RTTEST_CHECK_RC_OK(hTest, rc);
rc = flushFile(&svcTable, Root, Handle);
RTTEST_CHECK_RC_OK(hTest, rc);
RTTEST_CHECK_MSG(hTest, testRTFileFlushFile == hcFile,
(hTest, "File=%llu\n", LLUIFY(testRTFileFlushFile)));
unmapAndRemoveMapping(hTest, &svcTable, Root, "testname");
AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService));
RTTestGuardedFree(hTest, svcTable.pvService);
RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile,
(hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile)));
}
示例12: TestNegative
static void TestNegative(void)
{
RTTestSub(g_hTest, "Negative");
bool fSavedAssertQuiet = RTAssertSetQuiet(true);
bool fSavedAssertMayPanic = RTAssertSetMayPanic(false);
bool fSavedLckValEnabled = RTLockValidatorSetEnabled(false);
RTCRITSECTRW CritSectRw;
RTTEST_CHECK_RC_RETV(g_hTest, RTCritSectRwInit(&CritSectRw), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwLeaveShared(&CritSectRw), VERR_NOT_OWNER);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwLeaveExcl(&CritSectRw), VERR_NOT_OWNER);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwEnterExcl(&CritSectRw), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwLeaveShared(&CritSectRw), VERR_NOT_OWNER);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwEnterShared(&CritSectRw), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwLeaveExcl(&CritSectRw), VERR_WRONG_ORDER); /* cannot release the final write before the reads. */
RTTEST_CHECK_RC(g_hTest, RTCritSectRwLeaveShared(&CritSectRw), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwLeaveExcl(&CritSectRw), VINF_SUCCESS);
RTTEST_CHECK_RC(g_hTest, RTCritSectRwDelete(&CritSectRw), VINF_SUCCESS);
RTLockValidatorSetEnabled(fSavedLckValEnabled);
RTAssertSetMayPanic(fSavedAssertMayPanic);
RTAssertSetQuiet(fSavedAssertQuiet);
}
示例13: tstBasics
static bool tstBasics(void)
{
RTTestSub(g_hTest, "Basics");
RTSEMXROADS hXRoads;
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsCreate(&hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsNSEnter(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsNSLeave(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsEWEnter(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsEWLeave(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsEWEnter(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsEWLeave(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsNSEnter(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsNSLeave(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsNSEnter(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsNSLeave(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsDestroy(hXRoads), VINF_SUCCESS, false);
RTTEST_CHECK_RC_RET(g_hTest, RTSemXRoadsDestroy(NIL_RTSEMXROADS), VINF_SUCCESS, false);
return true;
}
示例14: testCreateFileSimple
void testCreateFileSimple(RTTEST hTest)
{
VBOXHGCMSVCFNTABLE svcTable;
VBOXHGCMSVCHELPERS svcHelpers;
SHFLROOT Root;
const RTFILE hcFile = (RTFILE) 0x10000;
SHFLCREATERESULT Result;
int rc;
RTTestSub(hTest, "Create file simple");
Root = initWithWritableMapping(hTest, &svcTable, &svcHelpers,
"/test/mapping", "testname");
testRTFileOpenpFile = hcFile;
rc = createFile(&svcTable, Root, "/test/file", SHFL_CF_ACCESS_READ, NULL,
&Result);
RTTEST_CHECK_RC_OK(hTest, rc);
RTTEST_CHECK_MSG(hTest,
!strcmp(testRTFileOpenName, "/test/mapping/test/file"),
(hTest, "pszFilename=%s\n", testRTFileOpenName));
RTTEST_CHECK_MSG(hTest, testRTFileOpenFlags == 0x181,
(hTest, "fOpen=%llu\n", LLUIFY(testRTFileOpenFlags)));
RTTEST_CHECK_MSG(hTest, Result == SHFL_FILE_CREATED,
(hTest, "Result=%d\n", (int) Result));
unmapAndRemoveMapping(hTest, &svcTable, Root, "testname");
AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService));
RTTestGuardedFree(hTest, svcTable.pvService);
RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile,
(hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile)));
}
示例15: test1
static void test1(void)
{
RTTestSub(g_hTest, "Interrupt RTThreadSleep");
RTTHREAD hThread;
RTTESTI_CHECK_RC_RETV(RTThreadCreate(&hThread, test1Thread, NULL, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "test1"),
VINF_SUCCESS);
RTThreadSleep(500); RTThreadSleep(1500); /* fudge */
RTTESTI_CHECK_RC(RTThreadPoke(hThread), VINF_SUCCESS);
RTTESTI_CHECK_RC(RTThreadWait(hThread, RT_INDEFINITE_WAIT, NULL), VINF_SUCCESS);
}