Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4249 lines
79 KiB

  1. //-------------------------------------------------------------------------
  2. //
  3. // Microsoft OLE
  4. // Copyright (C) Microsoft Corporation, 1994 - 1995.
  5. //
  6. // File: init.cxx
  7. //
  8. // Contents: OLE storage base tests
  9. //
  10. // Functions: main
  11. // ProcessCmdLine
  12. // RunAllTests
  13. // RunSingleTest
  14. // RunAllCOMTests
  15. // RunSingleCOMTest
  16. // RunAllDFTests
  17. // RunSingleDFTest
  18. // RunAllAPITests
  19. // RunSingleAPITest
  20. // RunAllROOTTests
  21. // RunSingleROOTTest
  22. // RunAllSTMTests
  23. // RunSingleSTMTest
  24. // RunAllSTGTests
  25. // RunSingleSTGTest
  26. // RunAllVCPYTests
  27. // RunSingleVCPYTest
  28. // RunAllIVCPYTests
  29. // RunSingleIVCPYTest
  30. // RunAllENUMTests
  31. // RunSingleENUMTest
  32. // RunAllIROOTSTGTests
  33. // RunSingleIROOTSTGTest
  34. // RunAllHGLOBALTests
  35. // RunSingleHGLOBALTest
  36. // RunAllSNBTests
  37. // RunSingleSNBTest
  38. // RunAllMISCTests
  39. // RunSingleMISCTest
  40. // RunAllILKBTests
  41. // RunSingleILKBTest
  42. // RunAllFlatTests
  43. // RunSingleFlatTest
  44. //
  45. // History: 20-May-1996 NarindK Created.
  46. //
  47. //--------------------------------------------------------------------------
  48. #include <dfheader.hxx>
  49. #pragma hdrstop
  50. #include "init.hxx"
  51. void CheckCurrentDirectory (int argc, char *argv[]);
  52. HRESULT ProcessCmdLine(int argc, char *argv[]) ;
  53. HRESULT RunSingleTest(char *pszTestName, int argc, char *argv[]) ;
  54. HRESULT RunAllTests(int argc, char *argv[]) ;
  55. HRESULT RunAllCOMTests(int argc, char *argv[]);
  56. HRESULT RunAllDFTests(int argc, char *argv[]);
  57. HRESULT RunAllAPITests(int argc, char *argv[]);
  58. HRESULT RunAllROOTTests(int argc, char *argv[]);
  59. HRESULT RunAllSTMTests(int argc, char *argv[]);
  60. HRESULT RunAllSTGTests(int argc, char *argv[]);
  61. HRESULT RunAllVCPYTests(int argc, char *argv[]);
  62. HRESULT RunAllIVCPYTests(int argc, char *argv[]);
  63. HRESULT RunAllENUMTests(int argc, char *argv[]);
  64. HRESULT RunAllIROOTSTGTests(int argc, char *argv[]);
  65. HRESULT RunAllHGLOBALTests(int argc, char *argv[]);
  66. HRESULT RunAllSNBTests(int argc, char *argv[]);
  67. HRESULT RunAllMISCTests(int argc, char *argv[]);
  68. HRESULT RunAllILKBTests(int argc, char *argv[]);
  69. HRESULT RunAllFlatTests(int argc, char *argv[]);
  70. HRESULT RunSingleCOMTest(LONG lTestNum, int argc, char *argv[]);
  71. HRESULT RunSingleDFTest(LONG lTestNum, int argc, char *argv[]);
  72. HRESULT RunSingleAPITest(LONG lTestNum, int argc, char *argv[]);
  73. HRESULT RunSingleROOTTest(LONG lTestNum, int argc, char *argv[]);
  74. HRESULT RunSingleSTMTest(LONG lTestNum, int argc, char *argv[]);
  75. HRESULT RunSingleSTGTest(LONG lTestNum, int argc, char *argv[]);
  76. HRESULT RunSingleVCPYTest(LONG lTestNum, int argc, char *argv[]);
  77. HRESULT RunSingleIVCPYTest(LONG lTestNum, int argc, char *argv[]);
  78. HRESULT RunSingleENUMTest(LONG lTestNum, int argc, char *argv[]);
  79. HRESULT RunSingleIROOTSTGTest(LONG lTestNum, int argc, char *argv[]);
  80. HRESULT RunSingleHGLOBALTest(LONG lTestNum, int argc, char *argv[]);
  81. HRESULT RunSingleSNBTest(LONG lTestNum, int argc, char *argv[]);
  82. HRESULT RunSingleMISCTest(LONG lTestNum, int argc, char *argv[]);
  83. HRESULT RunSingleILKBTest(LONG lTestNum, int argc, char *argv[]);
  84. HRESULT RunSingleFlatTest(LONG lTestNum, int argc, char *argv[]);
  85. // Debug object
  86. DH_DEFINE ;
  87. // Logs: The log file would be stgbase.log
  88. #define LOG_FILE_NAME "/t:stgbase"
  89. // Misc
  90. BOOL g_fDebugMode = FALSE ;
  91. BOOL g_fFirstFailureExits = FALSE ;
  92. BOOL g_fDebugBreakAtTestStart = FALSE ;
  93. BOOL g_fRunAllMode = FALSE ;
  94. BOOL g_fDoLargeSeekAndWrite = FALSE;
  95. BOOL g_fUseStdBlk = FALSE ;
  96. BOOL g_fRevert = FALSE;
  97. BOOL g_fDeleteTestDF = TRUE;
  98. UINT g_uOpenCreateDF = FL_DISTRIB_NONE;
  99. // Help text
  100. LPCTSTR lptszStgbaseUsage = {
  101. TEXT("StgBase command line options:\n")
  102. TEXT(" /t:{testname} - Run {testname} Test\n")
  103. TEXT(" /FFX - First Failure Exits\n")
  104. TEXT(" /BTS - Break at Test Start\n")
  105. TEXT(" /DM - Debug Mode\n")
  106. TEXT(" /stdblock - Use std block sizes\n")
  107. TEXT(" /lgseekwrite - Do large seek and write\n")
  108. TEXT(" /revert - Do revert instead of commit\n")
  109. TEXT(" /CWD:cwd - Make cwd Current Directory\n")
  110. };
  111. //+-------------------------------------------------------------------
  112. // Function: main
  113. //
  114. // Synopsis: main for stgbase test suite
  115. //
  116. // Arguments: [argc]
  117. // [argv]
  118. //
  119. // Returns: -1 if main fails
  120. //
  121. // History: 20-May-1996 NarindK Created
  122. //--------------------------------------------------------------------
  123. #ifdef _MAC
  124. int __stdcall WinMain(HINSTANCE hInstance,
  125. HINSTANCE hPrevInstance,
  126. LPSTR lpCmdLine,
  127. int nCmdShow)
  128. {
  129. int argc;
  130. char **argv;
  131. // the pointer is used for retrieving the command line
  132. // from the Arguments file on Mac
  133. LPSTR lpszCmdLine = NULL;
  134. int count;
  135. #else
  136. int __cdecl main(int argc, char *argv[])
  137. {
  138. #endif // _MAC
  139. HRESULT hr = S_OK;
  140. // Check if we should change CurrentDirectory, before creating the logfile
  141. CheckCurrentDirectory (argc, argv);
  142. // Initialize our log object
  143. DH_CREATELOGCMDLINE( LOG_FILE_NAME );
  144. hr = InitializeDebugObject();
  145. DH_ASSERT( S_OK == hr);
  146. if (DH_GETLOGLOC == DH_LOC_TERM)
  147. {
  148. DH_SETLOGLOC( DH_LOC_TERM | DH_LOC_LOG) ;
  149. }
  150. if (DH_GETTRACELOC == DH_LOC_TERM)
  151. {
  152. DH_SETTRACELOC( DH_LOC_TERM | DH_LOC_LOG) ;
  153. }
  154. // ProcessCmdLine() will run all the tests we
  155. // need to run...
  156. if (S_OK == hr)
  157. {
  158. #ifdef _MAC
  159. lpszCmdLine = GetCommandLine();
  160. if(lpszCmdLine == NULL)
  161. {
  162. hr = E_FAIL;
  163. DH_LOG((LOG_INFO, TEXT("Failed to get the command line.\r")) ) ;
  164. }
  165. if(S_OK == hr)
  166. {
  167. hr = CmdlineToArgs(lpszCmdLine, &argc, &argv);
  168. }
  169. #endif //_MAC
  170. // init our StgAPI wrapper - to determine whether we want to call
  171. // StgAPIs or StgExAPIs for open/create.
  172. StgInitStgFormatWrapper (argc, argv);
  173. if(S_OK == hr)
  174. {
  175. hr = ProcessCmdLine(argc, argv) ;
  176. }
  177. }
  178. // Log our stats regarding how many tests passed, failed
  179. // aborted, etc, etc.
  180. DH_LOGSTATS ;
  181. // BUGBUG: The following code that has been commented out reads from a
  182. // test.ini file and runs different tests as specified there.
  183. /*
  184. {
  185. int targc = 0;
  186. char **targv = NULL;
  187. ULONG i = 0;
  188. char buffer[256];
  189. char testName[20];
  190. for (;;)
  191. {
  192. sprintf (testName, "Test%lu", i);
  193. i++;
  194. GetPrivateProfileStringA(
  195. "MyTests",
  196. testName,
  197. "Fail",
  198. buffer,
  199. sizeof(buffer),
  200. "test.ini" );
  201. if(0 == strcmp(buffer, "EndTest"))
  202. {
  203. break;
  204. }
  205. hr = CmdlineToArgs(buffer, &targc, &targv) ;
  206. if(S_OK == hr)
  207. {
  208. hr = RunTest(targc, targv);
  209. }
  210. // CmdlineToArgs allocates a bunch of strings and a table of
  211. // pointers to them, so we need to free them.
  212. if (NULL != targv)
  213. {
  214. for (i=0; i<targc; i++)
  215. {
  216. delete targv[i] ;
  217. }
  218. delete [] targv ;
  219. }
  220. }
  221. }
  222. */
  223. // End of commented code for reading from win.ini file.
  224. #ifdef _MAC
  225. // cleanup for arguments strings
  226. if (NULL != argv)
  227. {
  228. for (count=0; count<argc; count++)
  229. {
  230. delete argv[count] ;
  231. }
  232. delete [] argv ;
  233. }
  234. #endif //_MAC
  235. return (int)hr;
  236. }
  237. //+-------------------------------------------------------------------
  238. // Function: CheckCurrentDirectory
  239. //
  240. // Synopsis: look at cmdline and if requested make CWD as specd
  241. //
  242. // Arguments: [argc]
  243. // [argv]
  244. //
  245. // Returns: void
  246. //
  247. // History: 27-Jul-1997 SCousens Created
  248. //--------------------------------------------------------------------
  249. void CheckCurrentDirectory (int argc, char *argv[])
  250. {
  251. HRESULT hr = S_OK;
  252. CBaseCmdlineObj Ccwd (OLESTR("cwd"),
  253. OLESTR("Make this Current Working Directory"),
  254. OLESTR("none"));
  255. CBaseCmdlineObj *CArgList[] =
  256. {
  257. &Ccwd
  258. };
  259. CCmdline CCmdlineArgs(argc, argv);
  260. if (CMDLINE_NO_ERROR != CCmdlineArgs.QueryError())
  261. {
  262. hr = E_FAIL ;
  263. }
  264. if (S_OK == hr)
  265. {
  266. if (CMDLINE_NO_ERROR != CCmdlineArgs.Parse(CArgList,
  267. ARRAYSIZE (CArgList),
  268. FALSE))
  269. {
  270. hr = E_FAIL;
  271. }
  272. }
  273. if (S_OK == hr && TRUE == Ccwd.IsFound ())
  274. {
  275. // Try changing current working directory
  276. LPTSTR ptszCWD;
  277. HRESULT hr = OleStringToTString (Ccwd.GetValue(), &ptszCWD);
  278. if (S_OK == hr)
  279. {
  280. if (FALSE == SetCurrentDirectory (ptszCWD))
  281. {
  282. DH_TRACE ((DH_LVL_ERROR,
  283. TEXT("SetCurrentDirectory to %s FAILED. hr=%#lx"),
  284. ptszCWD,
  285. HRESULT_FROM_WIN32 (GetLastError ())));
  286. }
  287. else
  288. {
  289. DH_TRACE ((DH_LVL_TRACE1,
  290. TEXT("CurrentWorkingDirectory now:%s"),
  291. ptszCWD));
  292. }
  293. delete ptszCWD;
  294. ptszCWD = NULL;
  295. }
  296. }
  297. return;
  298. }
  299. //+-------------------------------------------------------------------
  300. // Function: RunTestAltPath
  301. //
  302. // Synopsis: -Look at cmdline for /altpath switch.
  303. // -If not found, call the specified test with NULL for
  304. // the alternate path - thus using cwd.
  305. // -If found with nothing specified, enumerate all local
  306. // drives and use the root of each drive as alternate.
  307. // -If found with drive letters specified, use the
  308. // specified drive letters.
  309. // -Currently we only look at the 1st char, and ',;' are
  310. // the acceptible delimiters
  311. // eg: /altpath enumerate and use all drives
  312. // eg: /altpath:c:;d,e use C, D and E drives.
  313. //
  314. // Arguments: [argc]
  315. // [argv]
  316. // [pfn] - pointer to the test function to call
  317. //
  318. // Returns: HRESULT whatever the test returned.
  319. // If multiple tests ran, returns first error.
  320. //
  321. // Notes: The test functions must be modified to accept
  322. // a third parameter, and then optionally use
  323. // it when creating a new file.
  324. //
  325. // History: 14-Oct-1997 SCousens Created
  326. //--------------------------------------------------------------------
  327. HRESULT RunTestAltPath(int argc, char *argv[],
  328. HRESULT (*pfnTestFunc) (int argc, char*argv[], LPTSTR ptAltPath))
  329. {
  330. ULONG ulDriveMap;
  331. TCHAR szDrive[] = {TEXT("C:\\")};
  332. HRESULT hr = S_OK;
  333. HRESULT hrTest = S_OK;
  334. LPTSTR ptAltPath = NULL;
  335. BOOL fAltFound = FALSE;
  336. DH_FUNCENTRY (&hr, DH_LVL_DFLIB, TEXT("RunTestAltPath"));
  337. // look for /altpath in commandline
  338. CBaseCmdlineObj Caltpath (OLESTR("AltPath"),
  339. OLESTR("Use a different drive/path"),
  340. OLESTR("none"));
  341. CBaseCmdlineObj *CArgList[] =
  342. {
  343. &Caltpath // just for spewage
  344. };
  345. CCmdline CCmdlineArgs(argc, argv);
  346. ptAltPath = NULL;
  347. if (CMDLINE_NO_ERROR == CCmdlineArgs.QueryError())
  348. {
  349. if (CMDLINE_NO_ERROR ==
  350. CCmdlineArgs.Parse(CArgList, ARRAYSIZE(CArgList), FALSE))
  351. {
  352. if (Caltpath.IsFound ())
  353. {
  354. DH_TRACE ((DH_LVL_TRACE4, TEXT("/altpath option found on cmdline")));
  355. HRESULT hr = OleStringToTString (Caltpath.GetValue (), &ptAltPath);
  356. DH_HRCHECK (hr, TEXT("OleStringToTString"));
  357. fAltFound = TRUE;
  358. }
  359. }
  360. }
  361. // if altpath not on the cmdline, just call the test and bail.
  362. if (!fAltFound)
  363. {
  364. DH_TRACE ((DH_LVL_TRACE4, TEXT("no /altpath option. Using CWD")));
  365. hr = (*pfnTestFunc)(argc, argv, NULL);
  366. return hr;
  367. }
  368. //if altpath has something, get what we got.
  369. ulDriveMap = 0;
  370. if (NULL != ptAltPath)
  371. {
  372. // make upper case so math below is easier
  373. CharUpperBuff(ptAltPath, _tcslen(ptAltPath));
  374. LPTSTR ptr = _tcstok (ptAltPath, TEXT(";,"));
  375. // take string and fill DriveMap with specified drives
  376. while (NULL != ptr)
  377. {
  378. if (*ptr >= TCHAR('A') && *ptr <= TCHAR('Z'))
  379. {
  380. // c: -> 0x4, d: -> 0x8, e: -> 0x10
  381. ulDriveMap = ulDriveMap | (0x01 << (*ptr-TCHAR('C')));
  382. DH_TRACE ((DH_LVL_TRACE4, TEXT("Processed drive %C:"), *ptr));
  383. }
  384. ptr = _tcstok (NULL, TEXT(";,"));
  385. }
  386. }
  387. // if /altpath: not found, enum local disks and use them all.
  388. if (0 == ulDriveMap)
  389. {
  390. DH_TRACE ((DH_LVL_TRACE4, TEXT("Enumerating local drives")));
  391. ulDriveMap = EnumLocalDrives()>>2; //ignore A:, B:
  392. }
  393. DH_TRACE ((DH_LVL_TRACE4, TEXT("Drive map : %#x"), ulDriveMap));
  394. while (ulDriveMap)
  395. {
  396. if (ulDriveMap & 0x01)
  397. {
  398. DH_TRACE ((DH_LVL_TRACE4, TEXT("Testing to:%s"), szDrive));
  399. hrTest = (*pfnTestFunc)(argc, argv, szDrive);
  400. hr = FirstError (hr, hrTest);
  401. }
  402. ++*szDrive;
  403. ulDriveMap = ulDriveMap>>1;
  404. }
  405. // cleanup
  406. delete []ptAltPath;
  407. // return an error if any of the tests failed.
  408. return hr;
  409. }
  410. //+-------------------------------------------------------------------
  411. // Function: ProcessCmdLine
  412. //
  413. // Synopsis: Analyzes the command line and takes appropriate action
  414. // depending on what is there.
  415. //
  416. // Arguments: [argc]
  417. // [argv] - The command line argument list. Valid switches
  418. // are:
  419. //
  420. // 1. /T:{string defining test num}
  421. //
  422. // For test num strings, see
  423. // %ctolestg%\docs
  424. //
  425. // If no /T: switches are on the command
  426. // line, all the tests are run.
  427. //
  428. // An unlimited number of tests can be
  429. // specified on the command line using
  430. // the /t: switches
  431. //
  432. // 2. /BTS - Break when each test starts
  433. //
  434. // 3. /DM - Debug mode. In debug mode, the
  435. // test DLL provides more debugging
  436. // information than normal about the
  437. // state of the tests.
  438. //
  439. // 4. /FFX - First test failure exits the test
  440. // suite
  441. //
  442. // 5. /stdblock - If standard block sizes from
  443. // array ausSIZE_ARRAY needs to be
  444. // used for test.
  445. //
  446. // 6. /lgseekwrite - if large seek and write needs
  447. // to be done in test.
  448. //
  449. // 7. /revert - Do revert operation in tests
  450. // instead of commit, if flag set.
  451. //
  452. // NOTE: For OTHER valid switches, please
  453. // see documentation.
  454. //
  455. // Returns: S_OK if the function succeeds, another HRESULT otherwise
  456. //
  457. // History: 20-May-1996 NarindK Enhanced for stgbase test suite
  458. //
  459. //--------------------------------------------------------------------
  460. HRESULT ProcessCmdLine(int argc, char *argv[])
  461. {
  462. HRESULT hr = S_OK ;
  463. INT i = 0;
  464. INT cTestsRun = 0 ;
  465. INT cParseErrors= 0 ;
  466. int targc = 0;
  467. char **targv = NULL;
  468. //
  469. // If we are running on DEBUG OLE, set the debug flag to TRUE
  470. //
  471. if (S_OK == RunningDebugOle())
  472. {
  473. g_fDebugMode = TRUE ;
  474. }
  475. //
  476. // First, check for any switches
  477. //
  478. if (S_OK == hr)
  479. {
  480. CBoolCmdlineObj Cbts (OLESTR("BTS"), OLESTR(""), OLESTR("FALSE")) ;
  481. CBoolCmdlineObj Cffx (OLESTR("FFX"), OLESTR(""), OLESTR("FALSE")) ;
  482. CBoolCmdlineObj Cdm (OLESTR("DM"), OLESTR(""), OLESTR("FALSE")) ;
  483. CBoolCmdlineObj Chlp (OLESTR("HELP"), OLESTR("get help"), OLESTR("FALSE")) ;
  484. CBoolCmdlineObj Chelp (OLESTR("?"), OLESTR("get help"), OLESTR("FALSE")) ;
  485. CBoolCmdlineObj Cstdblk (OLESTR("stdblock"), OLESTR(""), OLESTR("FALSE")) ;
  486. CBoolCmdlineObj Clgseekwrite(OLESTR("lgseekwrite"),OLESTR(""), OLESTR("FALSE")) ;
  487. CBoolCmdlineObj Crevert (OLESTR("revert"), OLESTR(""), OLESTR("FALSE")) ;
  488. CBaseCmdlineObj COpenDF (OLESTR("Distrib"),
  489. OLESTR("Distributed tests. Create/Open docfile"),
  490. OLESTR("none"));
  491. // these are checked and dealt with in chancedf. look here so we can
  492. // put some meaningful useful information into the log
  493. CBaseCmdlineObj Cmode (OLESTR("dfRootMode"),
  494. OLESTR("Direct, Transacted modes"),
  495. OLESTR("none"));
  496. CBaseCmdlineObj Ctest (OLESTR("t"),
  497. OLESTR("Test name"),
  498. OLESTR("none"));
  499. CBaseCmdlineObj *CArgList[] =
  500. {
  501. &Cmode, // just for spewage
  502. &Ctest, // just for spewage
  503. &COpenDF, // 2 phase testing (conversion over redirector)
  504. &Cbts, // Break at test start
  505. &Cffx, // Break at first failure
  506. &Cdm, // Debug mode
  507. &Chlp, // Help
  508. &Chelp, // display help?
  509. &Cstdblk, // Standard block size
  510. &Clgseekwrite, // Do large seek and write
  511. &Crevert // Revert instead of committing
  512. } ;
  513. CCmdline CCmdlineArgs(argc, argv);
  514. if (CMDLINE_NO_ERROR != CCmdlineArgs.QueryError())
  515. {
  516. hr = E_FAIL ;
  517. }
  518. if (S_OK == hr)
  519. {
  520. if (CMDLINE_NO_ERROR !=
  521. CCmdlineArgs.Parse(
  522. CArgList,
  523. ( sizeof(CArgList) / sizeof(CArgList[0]) ),
  524. FALSE))
  525. {
  526. hr = E_FAIL ;
  527. }
  528. if (S_OK == hr)
  529. {
  530. g_fDebugBreakAtTestStart = *(Cbts.GetValue()) ;
  531. g_fFirstFailureExits = *(Cffx.GetValue()) ;
  532. g_fDebugMode = FALSE;
  533. if (FALSE != *(Cdm.GetValue()))
  534. {
  535. g_fDebugMode = TRUE ;
  536. }
  537. if (TRUE == Chelp.IsFound() || TRUE == Chlp.IsFound())
  538. {
  539. // Help switch
  540. // We are a console app. Dump to stdout.
  541. // and debug window for good measure.
  542. _tprintf (TEXT("%s\r\n"), lptszStgbaseUsage);
  543. OutputDebugString ((LPTSTR)lptszStgbaseUsage);
  544. _tprintf (TEXT("%s"), GetDebugHelperUsage());
  545. OutputDebugString ((LPTSTR)GetDebugHelperUsage());
  546. //
  547. // If someone asked for help, don't run any
  548. // of the tests
  549. //
  550. hr = S_FALSE ;
  551. }
  552. g_fUseStdBlk = FALSE;
  553. if (FALSE != *(Cstdblk.GetValue()))
  554. {
  555. g_fUseStdBlk = TRUE ;
  556. }
  557. g_fDoLargeSeekAndWrite = FALSE;
  558. if (FALSE != *(Clgseekwrite.GetValue()))
  559. {
  560. g_fDoLargeSeekAndWrite = TRUE ;
  561. }
  562. g_fRevert = FALSE;
  563. if (FALSE != *(Crevert.GetValue()))
  564. {
  565. g_fRevert = TRUE ;
  566. }
  567. g_uOpenCreateDF = FL_DISTRIB_NONE;
  568. g_fDeleteTestDF = TRUE;
  569. if (TRUE == COpenDF.IsFound ())
  570. {
  571. if (NULL == _olestricmp (COpenDF.GetValue (), OLESTR(SZ_DISTRIB_OPEN)))
  572. {
  573. g_uOpenCreateDF = FL_DISTRIB_OPEN;
  574. }
  575. else if (NULL == _olestricmp (COpenDF.GetValue (), OLESTR(SZ_DISTRIB_OPENNODELETE)))
  576. {
  577. g_uOpenCreateDF = FL_DISTRIB_OPEN;
  578. g_fDeleteTestDF = FALSE;
  579. }
  580. else if (NULL ==_olestricmp (COpenDF.GetValue (), OLESTR(SZ_DISTRIB_CREATE)))
  581. {
  582. g_uOpenCreateDF = FL_DISTRIB_CREATE;
  583. }
  584. }
  585. #ifdef UNICODE //dont bother with OleStringToTString if TString is ansi.
  586. // for spewage only
  587. if (TRUE == Ctest.IsFound () && TRUE == Cmode.IsFound ())
  588. {
  589. DH_TRACE ((DH_LVL_ALWAYS,
  590. TEXT("Running %s in %s mode"),
  591. Ctest.GetValue(),
  592. Cmode.GetValue()));
  593. }
  594. #endif
  595. }
  596. }
  597. }
  598. //
  599. // Start up the tests
  600. //
  601. targc = argc;
  602. targv = argv;
  603. if (S_OK == hr)
  604. {
  605. for (i=0; i<argc; i++)
  606. {
  607. //
  608. // Switch must be in the form "{- | /}T:{test name}"
  609. //
  610. if ( ('/' != argv[i][0]) && ('-' != argv[i][0]) )
  611. {
  612. continue ;
  613. }
  614. if ( ('t' != argv[i][1]) && ('T' != argv[i][1]) )
  615. {
  616. continue ;
  617. }
  618. if (':' != argv[i][2])
  619. {
  620. continue ;
  621. }
  622. if (0 == argv[i][3])
  623. {
  624. cParseErrors++ ;
  625. continue ;
  626. }
  627. hr = RunSingleTest(&argv[i][3], targc, targv) ;
  628. // test failed. let the world know what tried to do
  629. if (S_OK != hr)
  630. {
  631. LPTSTR lpszCmdLine = GetCommandLine();
  632. if(lpszCmdLine != NULL)
  633. {
  634. DH_LOG((LOG_INFO, TEXT("CommandLine:%s"), lpszCmdLine ));
  635. }
  636. }
  637. if ( (S_OK != hr) && (FALSE != g_fFirstFailureExits) )
  638. {
  639. break ;
  640. }
  641. cTestsRun++ ;
  642. }
  643. }
  644. // If we did not find any tests to run and there were
  645. // no parse errors, then run all the tests
  646. //
  647. if (S_OK == hr)
  648. {
  649. g_fRunAllMode = FALSE;
  650. if ( (0 == cTestsRun) && (0 == cParseErrors) )
  651. {
  652. g_fRunAllMode = TRUE ;
  653. hr = RunAllTests(targc, targv) ;
  654. }
  655. }
  656. return hr ;
  657. }
  658. //+-------------------------------------------------------------------
  659. // Function: RunAllTests
  660. //
  661. // Synopsis: Runs all tests
  662. //
  663. // Arguments: [argc]
  664. // [argv]
  665. //
  666. // Returns: S_OK if the function succeeds, another HRESULT otherwise
  667. //
  668. // History: 28-Jul-1995 AlexE Created
  669. // 20-May-1996 NarindK Adapted for stgbase test suite
  670. //--------------------------------------------------------------------
  671. HRESULT RunAllTests(int argc, char *argv[])
  672. {
  673. HRESULT hr = S_OK ;
  674. INT cFailures = 0 ;
  675. // Run "COM" tests
  676. hr = RunAllCOMTests(argc, argv) ;
  677. if (S_OK != hr)
  678. {
  679. if (FALSE != g_fFirstFailureExits)
  680. {
  681. return hr ;
  682. }
  683. else
  684. {
  685. cFailures++ ;
  686. }
  687. }
  688. // Run "DF" tests
  689. hr = RunAllDFTests(argc, argv) ;
  690. if (S_OK != hr)
  691. {
  692. if (FALSE != g_fFirstFailureExits)
  693. {
  694. return hr ;
  695. }
  696. else
  697. {
  698. cFailures++ ;
  699. }
  700. }
  701. // Run "API" tests
  702. hr = RunAllAPITests(argc, argv) ;
  703. if (S_OK != hr)
  704. {
  705. if (FALSE != g_fFirstFailureExits)
  706. {
  707. return hr ;
  708. }
  709. else
  710. {
  711. cFailures++ ;
  712. }
  713. }
  714. // Run "ROOT" tests
  715. hr = RunAllROOTTests(argc, argv) ;
  716. if (S_OK != hr)
  717. {
  718. if (FALSE != g_fFirstFailureExits)
  719. {
  720. return hr ;
  721. }
  722. else
  723. {
  724. cFailures++ ;
  725. }
  726. }
  727. // Run "STM" tests
  728. hr = RunAllSTMTests(argc, argv) ;
  729. if (S_OK != hr)
  730. {
  731. if (FALSE != g_fFirstFailureExits)
  732. {
  733. return hr ;
  734. }
  735. else
  736. {
  737. cFailures++ ;
  738. }
  739. }
  740. // Run "STG" tests
  741. hr = RunAllSTGTests(argc, argv) ;
  742. if (S_OK != hr)
  743. {
  744. if (FALSE != g_fFirstFailureExits)
  745. {
  746. return hr ;
  747. }
  748. else
  749. {
  750. cFailures++ ;
  751. }
  752. }
  753. // Run "VCPY" tests
  754. hr = RunAllVCPYTests(argc, argv) ;
  755. if (S_OK != hr)
  756. {
  757. if (FALSE != g_fFirstFailureExits)
  758. {
  759. return hr ;
  760. }
  761. else
  762. {
  763. cFailures++ ;
  764. }
  765. }
  766. // Run "IVCPY" tests
  767. hr = RunAllIVCPYTests(argc, argv) ;
  768. if (S_OK != hr)
  769. {
  770. if (FALSE != g_fFirstFailureExits)
  771. {
  772. return hr ;
  773. }
  774. else
  775. {
  776. cFailures++ ;
  777. }
  778. }
  779. // Run "ENUM" tests
  780. hr = RunAllENUMTests(argc, argv) ;
  781. if (S_OK != hr)
  782. {
  783. if (FALSE != g_fFirstFailureExits)
  784. {
  785. return hr ;
  786. }
  787. else
  788. {
  789. cFailures++ ;
  790. }
  791. }
  792. // Run "IROOTSTG" tests
  793. hr = RunAllIROOTSTGTests(argc, argv) ;
  794. if (S_OK != hr)
  795. {
  796. if (FALSE != g_fFirstFailureExits)
  797. {
  798. return hr ;
  799. }
  800. else
  801. {
  802. cFailures++ ;
  803. }
  804. }
  805. // Run "HGLOBAL" tests
  806. hr = RunAllHGLOBALTests(argc, argv) ;
  807. if (S_OK != hr)
  808. {
  809. if (FALSE != g_fFirstFailureExits)
  810. {
  811. return hr ;
  812. }
  813. else
  814. {
  815. cFailures++ ;
  816. }
  817. }
  818. // Run "SNB" tests
  819. hr = RunAllSNBTests(argc, argv) ;
  820. if (S_OK != hr)
  821. {
  822. if (FALSE != g_fFirstFailureExits)
  823. {
  824. return hr ;
  825. }
  826. else
  827. {
  828. cFailures++ ;
  829. }
  830. }
  831. // Run "MISC" tests
  832. hr = RunAllMISCTests(argc, argv) ;
  833. if (S_OK != hr)
  834. {
  835. if (FALSE != g_fFirstFailureExits)
  836. {
  837. return hr ;
  838. }
  839. else
  840. {
  841. cFailures++ ;
  842. }
  843. }
  844. // Run "FLAT" tests
  845. hr = RunAllFlatTests(argc, argv) ;
  846. if (S_OK != hr)
  847. {
  848. if (FALSE != g_fFirstFailureExits)
  849. {
  850. return hr ;
  851. }
  852. else
  853. {
  854. cFailures++ ;
  855. }
  856. }
  857. // If the last test passed, but a previous test
  858. // failed, return a failure code for the whole
  859. // operation
  860. if ( (S_OK == hr) && (0 != cFailures) )
  861. {
  862. hr = E_FAIL ;
  863. }
  864. return hr ;
  865. }
  866. //+-------------------------------------------------------------------
  867. // Function: RunSingleTest
  868. //
  869. // Synopsis: Runs a single test
  870. //
  871. // Arguments: [pszTestName] - The test name string.
  872. // [argc]
  873. // [argv]
  874. //
  875. // Returns: S_OK if the function succeeds, another HRESULT otherwise
  876. //
  877. // History: 28-Jul-1995 AlexE Created
  878. // 20-May-1996 NarindK Adapted for stgbase test suite
  879. //--------------------------------------------------------------------
  880. HRESULT RunSingleTest(char *pszTestName, int argc, char *argv[])
  881. {
  882. char *pszNum = NULL ;
  883. LONG lNum = -1 ;
  884. //
  885. // The test name should be in the form
  886. //
  887. // "{description string}{-}{test number}"
  888. //
  889. pszNum = pszTestName ;
  890. while (0 != *pszNum)
  891. {
  892. if ('-' == *pszNum)
  893. {
  894. *pszNum++ = 0 ;
  895. break ;
  896. }
  897. pszNum++ ;
  898. }
  899. if (0 == *pszNum)
  900. {
  901. DH_LOG((LOG_INFO, TEXT("No test number in test name string")) ) ;
  902. return E_INVALIDARG ;
  903. }
  904. //
  905. // Now see if the test name part is one we recognize.
  906. // If it is, dispatch the test.
  907. //
  908. if (S_OK != PrivAtol(pszNum, &lNum))
  909. {
  910. DH_LOG((LOG_INFO, TEXT("Invalid number in test name string")) ) ;
  911. return E_INVALIDARG ;
  912. }
  913. if (0 == _strcmpi(pszTestName, "COMTEST"))
  914. {
  915. return RunSingleCOMTest(lNum, argc, argv) ;
  916. }
  917. else
  918. if (0 == _strcmpi(pszTestName, "DFTEST"))
  919. {
  920. return RunSingleDFTest(lNum, argc, argv) ;
  921. }
  922. else
  923. if (0 == _strcmpi(pszTestName, "APITEST"))
  924. {
  925. return RunSingleAPITest(lNum, argc, argv) ;
  926. }
  927. else
  928. if (0 == _strcmpi(pszTestName, "ROOTTEST"))
  929. {
  930. return RunSingleROOTTest(lNum, argc, argv) ;
  931. }
  932. else
  933. if (0 == _strcmpi(pszTestName, "STMTEST"))
  934. {
  935. return RunSingleSTMTest(lNum, argc, argv) ;
  936. }
  937. else
  938. if (0 == _strcmpi(pszTestName, "STGTEST"))
  939. {
  940. return RunSingleSTGTest(lNum, argc, argv) ;
  941. }
  942. else
  943. if (0 == _strcmpi(pszTestName, "VCPYTEST"))
  944. {
  945. return RunSingleVCPYTest(lNum, argc, argv) ;
  946. }
  947. else
  948. if (0 == _strcmpi(pszTestName, "IVCPYTEST"))
  949. {
  950. return RunSingleIVCPYTest(lNum, argc, argv) ;
  951. }
  952. else
  953. if (0 == _strcmpi(pszTestName, "ENUMTEST"))
  954. {
  955. return RunSingleENUMTest(lNum, argc, argv) ;
  956. }
  957. else
  958. if (0 == _strcmpi(pszTestName, "IROOTSTGTEST"))
  959. {
  960. return RunSingleIROOTSTGTest(lNum, argc, argv) ;
  961. }
  962. if (0 == _strcmpi(pszTestName, "HGLOBALTEST"))
  963. {
  964. return RunSingleHGLOBALTest(lNum, argc, argv) ;
  965. }
  966. else
  967. if (0 == _strcmpi(pszTestName, "SNBTEST"))
  968. {
  969. return RunSingleSNBTest(lNum, argc, argv) ;
  970. }
  971. else
  972. if (0 == _strcmpi(pszTestName, "MISCTEST"))
  973. {
  974. return RunSingleMISCTest(lNum, argc, argv) ;
  975. }
  976. else
  977. if (0 == _strcmpi(pszTestName, "ILKBTEST"))
  978. {
  979. return RunSingleILKBTest(lNum, argc, argv) ;
  980. }
  981. else
  982. if (0 == _strcmpi(pszTestName, "FLATTEST"))
  983. {
  984. return RunSingleFlatTest(lNum, argc, argv) ;
  985. }
  986. else
  987. {
  988. DH_LOG((LOG_INFO, TEXT("Invalid test name string")) ) ;
  989. return E_INVALIDARG ;
  990. }
  991. }
  992. //+-------------------------------------------------------------------
  993. // Function: RunAllCOMTests
  994. //
  995. // Synopsis: Runs all "COM" tests. For information on these tests,
  996. // see %ctolestg%\docs\stgbase\testplan.doc
  997. //
  998. // Arguments: [argc]
  999. // [argv]
  1000. //
  1001. // Returns: HRESULT
  1002. //
  1003. // History: 28-May-1996 NarindK Created
  1004. //--------------------------------------------------------------------
  1005. HRESULT RunAllCOMTests(int argc, char *argv[])
  1006. {
  1007. HRESULT hr = S_OK ;
  1008. INT cFailures = 0 ;
  1009. hr = COMTEST_100(argc, argv) ;
  1010. if (S_OK != hr)
  1011. {
  1012. if (FALSE != g_fFirstFailureExits)
  1013. {
  1014. return hr ;
  1015. }
  1016. else
  1017. {
  1018. cFailures++ ;
  1019. }
  1020. }
  1021. hr = COMTEST_101(argc, argv) ;
  1022. if (S_OK != hr)
  1023. {
  1024. if (FALSE != g_fFirstFailureExits)
  1025. {
  1026. return hr ;
  1027. }
  1028. else
  1029. {
  1030. cFailures++ ;
  1031. }
  1032. }
  1033. hr = COMTEST_102(argc, argv) ;
  1034. if (S_OK != hr)
  1035. {
  1036. if (FALSE != g_fFirstFailureExits)
  1037. {
  1038. return hr ;
  1039. }
  1040. else
  1041. {
  1042. cFailures++ ;
  1043. }
  1044. }
  1045. hr = COMTEST_103(argc, argv) ;
  1046. if (S_OK != hr)
  1047. {
  1048. if (FALSE != g_fFirstFailureExits)
  1049. {
  1050. return hr ;
  1051. }
  1052. else
  1053. {
  1054. cFailures++ ;
  1055. }
  1056. }
  1057. hr = COMTEST_104(argc, argv) ;
  1058. if (S_OK != hr)
  1059. {
  1060. if (FALSE != g_fFirstFailureExits)
  1061. {
  1062. return hr ;
  1063. }
  1064. else
  1065. {
  1066. cFailures++ ;
  1067. }
  1068. }
  1069. hr = COMTEST_105(argc, argv) ;
  1070. if (S_OK != hr)
  1071. {
  1072. if (FALSE != g_fFirstFailureExits)
  1073. {
  1074. return hr ;
  1075. }
  1076. else
  1077. {
  1078. cFailures++ ;
  1079. }
  1080. }
  1081. hr = COMTEST_106(argc, argv) ;
  1082. if (S_OK != hr)
  1083. {
  1084. if (FALSE != g_fFirstFailureExits)
  1085. {
  1086. return hr ;
  1087. }
  1088. else
  1089. {
  1090. cFailures++ ;
  1091. }
  1092. }
  1093. // If the last test passed, but a previous test
  1094. // failed, return a failure code for the whole
  1095. // If the last test passed, but a previous test
  1096. // failed, return a failure code for the whole
  1097. // operation
  1098. if ( (S_OK == hr) && (0 != cFailures) )
  1099. {
  1100. hr = E_FAIL ;
  1101. }
  1102. return hr ;
  1103. }
  1104. //+-------------------------------------------------------------------
  1105. // Function: RunAllDFTests
  1106. //
  1107. // Synopsis: Runs all "DF" tests. For information on these tests,
  1108. // see %ctolestg%\docs\stgbase\testplan.doc
  1109. //
  1110. // Arguments: [argc]
  1111. // [argv]
  1112. //
  1113. // Returns: HRESULT
  1114. //
  1115. // History: 3-June-1996 NarindK Created
  1116. //--------------------------------------------------------------------
  1117. HRESULT RunAllDFTests(int argc, char *argv[])
  1118. {
  1119. HRESULT hr = S_OK ;
  1120. INT cFailures = 0 ;
  1121. hr = DFTEST_100(argc, argv) ;
  1122. if (S_OK != hr)
  1123. {
  1124. if (FALSE != g_fFirstFailureExits)
  1125. {
  1126. return hr ;
  1127. }
  1128. else
  1129. {
  1130. cFailures++ ;
  1131. }
  1132. }
  1133. hr = DFTEST_101(argc, argv) ;
  1134. if (S_OK != hr)
  1135. {
  1136. if (FALSE != g_fFirstFailureExits)
  1137. {
  1138. return hr ;
  1139. }
  1140. else
  1141. {
  1142. cFailures++ ;
  1143. }
  1144. }
  1145. hr = DFTEST_102(argc, argv) ;
  1146. if (S_OK != hr)
  1147. {
  1148. if (FALSE != g_fFirstFailureExits)
  1149. {
  1150. return hr ;
  1151. }
  1152. else
  1153. {
  1154. cFailures++ ;
  1155. }
  1156. }
  1157. // Obtain Seed from CommandLine and call DFTEST_107
  1158. ULONG ulSeed = 0;
  1159. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  1160. hr = DFTEST_103(ulSeed) ;
  1161. if (S_OK != hr)
  1162. {
  1163. if (FALSE != g_fFirstFailureExits)
  1164. {
  1165. return hr ;
  1166. }
  1167. else
  1168. {
  1169. cFailures++ ;
  1170. }
  1171. }
  1172. hr = DFTEST_104(argc, argv) ;
  1173. if (S_OK != hr)
  1174. {
  1175. if (FALSE != g_fFirstFailureExits)
  1176. {
  1177. return hr ;
  1178. }
  1179. else
  1180. {
  1181. cFailures++ ;
  1182. }
  1183. }
  1184. hr = DFTEST_105(argc, argv) ;
  1185. if (S_OK != hr)
  1186. {
  1187. if (FALSE != g_fFirstFailureExits)
  1188. {
  1189. return hr ;
  1190. }
  1191. else
  1192. {
  1193. cFailures++ ;
  1194. }
  1195. }
  1196. hr = DFTEST_106(argc, argv) ;
  1197. if (S_OK != hr)
  1198. {
  1199. if (FALSE != g_fFirstFailureExits)
  1200. {
  1201. return hr ;
  1202. }
  1203. else
  1204. {
  1205. cFailures++ ;
  1206. }
  1207. }
  1208. hr = DFTEST_107(ulSeed) ;
  1209. if (S_OK != hr)
  1210. {
  1211. if (FALSE != g_fFirstFailureExits)
  1212. {
  1213. return hr ;
  1214. }
  1215. else
  1216. {
  1217. cFailures++ ;
  1218. }
  1219. }
  1220. hr = DFTEST_108(ulSeed) ;
  1221. if (S_OK != hr)
  1222. {
  1223. if (FALSE != g_fFirstFailureExits)
  1224. {
  1225. return hr ;
  1226. }
  1227. else
  1228. {
  1229. cFailures++ ;
  1230. }
  1231. }
  1232. hr = DFTEST_109(ulSeed) ;
  1233. if (S_OK != hr)
  1234. {
  1235. if (FALSE != g_fFirstFailureExits)
  1236. {
  1237. return hr ;
  1238. }
  1239. else
  1240. {
  1241. cFailures++ ;
  1242. }
  1243. }
  1244. // If the last test passed, but a previous test
  1245. // failed, return a failure code for the whole
  1246. // operation
  1247. if ( (S_OK == hr) && (0 != cFailures) )
  1248. {
  1249. hr = E_FAIL ;
  1250. }
  1251. return hr ;
  1252. }
  1253. //+-------------------------------------------------------------------
  1254. // Function: RunAllAPITests
  1255. //
  1256. // Synopsis: Runs all "API" tests. For information on these tests,
  1257. // see %ctolestg%\docs\stgbase\testplan.doc
  1258. //
  1259. // Arguments: [argc]
  1260. // [argv]
  1261. //
  1262. // Returns: HRESULT
  1263. //
  1264. // History: 18-June-1996 NarindK Created
  1265. //--------------------------------------------------------------------
  1266. HRESULT RunAllAPITests(int argc, char *argv[])
  1267. {
  1268. HRESULT hr = S_OK ;
  1269. INT cFailures = 0 ;
  1270. hr = APITEST_100(argc, argv) ;
  1271. if (S_OK != hr)
  1272. {
  1273. if (FALSE != g_fFirstFailureExits)
  1274. {
  1275. return hr ;
  1276. }
  1277. else
  1278. {
  1279. cFailures++ ;
  1280. }
  1281. }
  1282. hr = APITEST_101(argc, argv) ;
  1283. if (S_OK != hr)
  1284. {
  1285. if (FALSE != g_fFirstFailureExits)
  1286. {
  1287. return hr ;
  1288. }
  1289. else
  1290. {
  1291. cFailures++ ;
  1292. }
  1293. }
  1294. hr = APITEST_102(argc, argv) ;
  1295. if (S_OK != hr)
  1296. {
  1297. if (FALSE != g_fFirstFailureExits)
  1298. {
  1299. return hr ;
  1300. }
  1301. else
  1302. {
  1303. cFailures++ ;
  1304. }
  1305. }
  1306. hr = APITEST_103(argc, argv) ;
  1307. if (S_OK != hr)
  1308. {
  1309. if (FALSE != g_fFirstFailureExits)
  1310. {
  1311. return hr ;
  1312. }
  1313. else
  1314. {
  1315. cFailures++ ;
  1316. }
  1317. }
  1318. hr = APITEST_104(argc, argv) ;
  1319. if (S_OK != hr)
  1320. {
  1321. if (FALSE != g_fFirstFailureExits)
  1322. {
  1323. return hr ;
  1324. }
  1325. else
  1326. {
  1327. cFailures++ ;
  1328. }
  1329. }
  1330. // If the last test passed, but a previous test
  1331. // failed, return a failure code for the whole
  1332. // operation
  1333. if ( (S_OK == hr) && (0 != cFailures) )
  1334. {
  1335. hr = E_FAIL ;
  1336. }
  1337. return hr ;
  1338. }
  1339. //+-------------------------------------------------------------------
  1340. // Function: RunAllROOTTests
  1341. //
  1342. // Synopsis: Runs all "ROOT" tests. For information on these tests,
  1343. // see %ctolestg%\docs\stgbase\testplan.doc
  1344. //
  1345. // Arguments: [argc]
  1346. // [argv]
  1347. //
  1348. // Returns: HRESULT
  1349. //
  1350. // History: 24-June-1996 NarindK Created
  1351. //--------------------------------------------------------------------
  1352. HRESULT RunAllROOTTests(int argc, char *argv[])
  1353. {
  1354. HRESULT hr = S_OK ;
  1355. INT cFailures = 0 ;
  1356. hr = ROOTTEST_100(argc, argv) ;
  1357. if (S_OK != hr)
  1358. {
  1359. if (FALSE != g_fFirstFailureExits)
  1360. {
  1361. return hr ;
  1362. }
  1363. else
  1364. {
  1365. cFailures++ ;
  1366. }
  1367. }
  1368. hr = ROOTTEST_101(argc, argv) ;
  1369. if (S_OK != hr)
  1370. {
  1371. if (FALSE != g_fFirstFailureExits)
  1372. {
  1373. return hr ;
  1374. }
  1375. else
  1376. {
  1377. cFailures++ ;
  1378. }
  1379. }
  1380. hr = ROOTTEST_102(argc, argv) ;
  1381. if (S_OK != hr)
  1382. {
  1383. if (FALSE != g_fFirstFailureExits)
  1384. {
  1385. return hr ;
  1386. }
  1387. else
  1388. {
  1389. cFailures++ ;
  1390. }
  1391. }
  1392. hr = ROOTTEST_103(argc, argv) ;
  1393. if (S_OK != hr)
  1394. {
  1395. if (FALSE != g_fFirstFailureExits)
  1396. {
  1397. return hr ;
  1398. }
  1399. else
  1400. {
  1401. cFailures++ ;
  1402. }
  1403. }
  1404. hr = ROOTTEST_104(argc, argv) ;
  1405. if (S_OK != hr)
  1406. {
  1407. if (FALSE != g_fFirstFailureExits)
  1408. {
  1409. return hr ;
  1410. }
  1411. else
  1412. {
  1413. cFailures++ ;
  1414. }
  1415. }
  1416. // If the last test passed, but a previous test
  1417. // failed, return a failure code for the whole
  1418. // operation
  1419. if ( (S_OK == hr) && (0 != cFailures) )
  1420. {
  1421. hr = E_FAIL ;
  1422. }
  1423. return hr ;
  1424. }
  1425. //+-------------------------------------------------------------------
  1426. // Function: RunAllSTMTests
  1427. //
  1428. // Synopsis: Runs all "STM" tests. For information on these tests,
  1429. // see %ctolestg%\docs\stgbase\testplan.doc
  1430. //
  1431. // Arguments: [argc]
  1432. // [argv]
  1433. //
  1434. // Returns: HRESULT
  1435. //
  1436. // History: 28-June-1996 NarindK Created
  1437. //--------------------------------------------------------------------
  1438. HRESULT RunAllSTMTests(int argc, char *argv[])
  1439. {
  1440. HRESULT hr = S_OK ;
  1441. INT cFailures = 0 ;
  1442. hr = STMTEST_100(argc, argv) ;
  1443. if (S_OK != hr)
  1444. {
  1445. if (FALSE != g_fFirstFailureExits)
  1446. {
  1447. return hr ;
  1448. }
  1449. else
  1450. {
  1451. cFailures++ ;
  1452. }
  1453. }
  1454. hr = STMTEST_101(argc, argv) ;
  1455. if (S_OK != hr)
  1456. {
  1457. if (FALSE != g_fFirstFailureExits)
  1458. {
  1459. return hr ;
  1460. }
  1461. else
  1462. {
  1463. cFailures++ ;
  1464. }
  1465. }
  1466. hr = STMTEST_102(argc, argv) ;
  1467. if (S_OK != hr)
  1468. {
  1469. if (FALSE != g_fFirstFailureExits)
  1470. {
  1471. return hr ;
  1472. }
  1473. else
  1474. {
  1475. cFailures++ ;
  1476. }
  1477. }
  1478. hr = STMTEST_103(argc, argv) ;
  1479. if (S_OK != hr)
  1480. {
  1481. if (FALSE != g_fFirstFailureExits)
  1482. {
  1483. return hr ;
  1484. }
  1485. else
  1486. {
  1487. cFailures++ ;
  1488. }
  1489. }
  1490. hr = STMTEST_104(argc, argv) ;
  1491. if (S_OK != hr)
  1492. {
  1493. if (FALSE != g_fFirstFailureExits)
  1494. {
  1495. return hr ;
  1496. }
  1497. else
  1498. {
  1499. cFailures++ ;
  1500. }
  1501. }
  1502. hr = STMTEST_105(argc, argv) ;
  1503. if (S_OK != hr)
  1504. {
  1505. if (FALSE != g_fFirstFailureExits)
  1506. {
  1507. return hr ;
  1508. }
  1509. else
  1510. {
  1511. cFailures++ ;
  1512. }
  1513. }
  1514. hr = STMTEST_106(argc, argv) ;
  1515. if (S_OK != hr)
  1516. {
  1517. if (FALSE != g_fFirstFailureExits)
  1518. {
  1519. return hr ;
  1520. }
  1521. else
  1522. {
  1523. cFailures++ ;
  1524. }
  1525. }
  1526. hr = STMTEST_107(argc, argv) ;
  1527. if (S_OK != hr)
  1528. {
  1529. if (FALSE != g_fFirstFailureExits)
  1530. {
  1531. return hr ;
  1532. }
  1533. else
  1534. {
  1535. cFailures++ ;
  1536. }
  1537. }
  1538. hr = STMTEST_108(argc, argv) ;
  1539. if (S_OK != hr)
  1540. {
  1541. if (FALSE != g_fFirstFailureExits)
  1542. {
  1543. return hr ;
  1544. }
  1545. else
  1546. {
  1547. cFailures++ ;
  1548. }
  1549. }
  1550. hr = STMTEST_109(argc, argv) ;
  1551. if (S_OK != hr)
  1552. {
  1553. if (FALSE != g_fFirstFailureExits)
  1554. {
  1555. return hr ;
  1556. }
  1557. else
  1558. {
  1559. cFailures++ ;
  1560. }
  1561. }
  1562. // If the last test passed, but a previous test
  1563. // failed, return a failure code for the whole
  1564. // operation
  1565. if ( (S_OK == hr) && (0 != cFailures) )
  1566. {
  1567. hr = E_FAIL ;
  1568. }
  1569. return hr ;
  1570. }
  1571. //+-------------------------------------------------------------------
  1572. // Function: RunAllSTGTests
  1573. //
  1574. // Synopsis: Runs all "STG" tests. For information on these tests,
  1575. // see %ctolestg%\docs\stgbase\testplan.doc
  1576. //
  1577. // Arguments: [argc]
  1578. // [argv]
  1579. //
  1580. // Returns: HRESULT
  1581. //
  1582. // History: 10-July-1996 NarindK Created
  1583. //--------------------------------------------------------------------
  1584. HRESULT RunAllSTGTests(int argc, char *argv[])
  1585. {
  1586. HRESULT hr = S_OK ;
  1587. INT cFailures = 0 ;
  1588. hr = STGTEST_100(argc, argv) ;
  1589. if (S_OK != hr)
  1590. {
  1591. if (FALSE != g_fFirstFailureExits)
  1592. {
  1593. return hr ;
  1594. }
  1595. else
  1596. {
  1597. cFailures++ ;
  1598. }
  1599. }
  1600. hr = STGTEST_101(argc, argv) ;
  1601. if (S_OK != hr)
  1602. {
  1603. if (FALSE != g_fFirstFailureExits)
  1604. {
  1605. return hr ;
  1606. }
  1607. else
  1608. {
  1609. cFailures++ ;
  1610. }
  1611. }
  1612. hr = STGTEST_102(argc, argv) ;
  1613. if (S_OK != hr)
  1614. {
  1615. if (FALSE != g_fFirstFailureExits)
  1616. {
  1617. return hr ;
  1618. }
  1619. else
  1620. {
  1621. cFailures++ ;
  1622. }
  1623. }
  1624. hr = STGTEST_103(argc, argv) ;
  1625. if (S_OK != hr)
  1626. {
  1627. if (FALSE != g_fFirstFailureExits)
  1628. {
  1629. return hr ;
  1630. }
  1631. else
  1632. {
  1633. cFailures++ ;
  1634. }
  1635. }
  1636. hr = STGTEST_104(argc, argv) ;
  1637. if (S_OK != hr)
  1638. {
  1639. if (FALSE != g_fFirstFailureExits)
  1640. {
  1641. return hr ;
  1642. }
  1643. else
  1644. {
  1645. cFailures++ ;
  1646. }
  1647. }
  1648. hr = STGTEST_105(argc, argv) ;
  1649. if (S_OK != hr)
  1650. {
  1651. if (FALSE != g_fFirstFailureExits)
  1652. {
  1653. return hr ;
  1654. }
  1655. else
  1656. {
  1657. cFailures++ ;
  1658. }
  1659. }
  1660. hr = STGTEST_107(argc, argv) ;
  1661. if (S_OK != hr)
  1662. {
  1663. if (FALSE != g_fFirstFailureExits)
  1664. {
  1665. return hr ;
  1666. }
  1667. else
  1668. {
  1669. cFailures++ ;
  1670. }
  1671. }
  1672. hr = STGTEST_108(argc, argv) ;
  1673. if (S_OK != hr)
  1674. {
  1675. if (FALSE != g_fFirstFailureExits)
  1676. {
  1677. return hr ;
  1678. }
  1679. else
  1680. {
  1681. cFailures++ ;
  1682. }
  1683. }
  1684. hr = STGTEST_109(argc, argv) ;
  1685. if (S_OK != hr)
  1686. {
  1687. if (FALSE != g_fFirstFailureExits)
  1688. {
  1689. return hr ;
  1690. }
  1691. else
  1692. {
  1693. cFailures++ ;
  1694. }
  1695. }
  1696. hr = STGTEST_110(argc, argv) ;
  1697. if (S_OK != hr)
  1698. {
  1699. if (FALSE != g_fFirstFailureExits)
  1700. {
  1701. return hr ;
  1702. }
  1703. else
  1704. {
  1705. cFailures++ ;
  1706. }
  1707. }
  1708. // If the last test passed, but a previous test
  1709. // failed, return a failure code for the whole
  1710. // operation
  1711. if ( (S_OK == hr) && (0 != cFailures) )
  1712. {
  1713. hr = E_FAIL ;
  1714. }
  1715. return hr ;
  1716. }
  1717. //+-------------------------------------------------------------------
  1718. // Function: RunAllVCPYTests
  1719. //
  1720. // Synopsis: Runs all "VCPY" tests. For information on these tests,
  1721. // see %ctolestg%\docs\stgbase\testplan.doc
  1722. //
  1723. // Arguments: [argc]
  1724. // [argv]
  1725. //
  1726. // Returns: HRESULT
  1727. //
  1728. // History: 15-July-1996 NarindK Created
  1729. //--------------------------------------------------------------------
  1730. HRESULT RunAllVCPYTests(int argc, char *argv[])
  1731. {
  1732. HRESULT hr = S_OK ;
  1733. INT cFailures = 0 ;
  1734. hr = VCPYTEST_100(argc, argv) ;
  1735. if (S_OK != hr)
  1736. {
  1737. if (FALSE != g_fFirstFailureExits)
  1738. {
  1739. return hr ;
  1740. }
  1741. else
  1742. {
  1743. cFailures++ ;
  1744. }
  1745. }
  1746. hr = VCPYTEST_101(argc, argv) ;
  1747. if (S_OK != hr)
  1748. {
  1749. if (FALSE != g_fFirstFailureExits)
  1750. {
  1751. return hr ;
  1752. }
  1753. else
  1754. {
  1755. cFailures++ ;
  1756. }
  1757. }
  1758. hr = VCPYTEST_102(argc, argv) ;
  1759. if (S_OK != hr)
  1760. {
  1761. if (FALSE != g_fFirstFailureExits)
  1762. {
  1763. return hr ;
  1764. }
  1765. else
  1766. {
  1767. cFailures++ ;
  1768. }
  1769. }
  1770. hr = VCPYTEST_103(argc, argv) ;
  1771. if (S_OK != hr)
  1772. {
  1773. if (FALSE != g_fFirstFailureExits)
  1774. {
  1775. return hr ;
  1776. }
  1777. else
  1778. {
  1779. cFailures++ ;
  1780. }
  1781. }
  1782. hr = VCPYTEST_104(argc, argv) ;
  1783. if (S_OK != hr)
  1784. {
  1785. if (FALSE != g_fFirstFailureExits)
  1786. {
  1787. return hr ;
  1788. }
  1789. else
  1790. {
  1791. cFailures++ ;
  1792. }
  1793. }
  1794. hr = VCPYTEST_105(argc, argv) ;
  1795. if (S_OK != hr)
  1796. {
  1797. if (FALSE != g_fFirstFailureExits)
  1798. {
  1799. return hr ;
  1800. }
  1801. else
  1802. {
  1803. cFailures++ ;
  1804. }
  1805. }
  1806. hr = VCPYTEST_106(argc, argv) ;
  1807. if (S_OK != hr)
  1808. {
  1809. if (FALSE != g_fFirstFailureExits)
  1810. {
  1811. return hr ;
  1812. }
  1813. else
  1814. {
  1815. cFailures++ ;
  1816. }
  1817. }
  1818. // If the last test passed, but a previous test
  1819. // failed, return a failure code for the whole
  1820. // operation
  1821. if ( (S_OK == hr) && (0 != cFailures) )
  1822. {
  1823. hr = E_FAIL ;
  1824. }
  1825. return hr ;
  1826. }
  1827. //+-------------------------------------------------------------------
  1828. // Function: RunAllIVCPYTests
  1829. //
  1830. // Synopsis: Runs all "IVCPY" tests. For information on these tests,
  1831. // see %ctolestg%\docs\stgbase\testplan.doc
  1832. //
  1833. // Arguments: [argc]
  1834. // [argv]
  1835. //
  1836. // Returns: HRESULT
  1837. //
  1838. // History: 21-July-1996 NarindK Created
  1839. //--------------------------------------------------------------------
  1840. HRESULT RunAllIVCPYTests(int argc, char *argv[])
  1841. {
  1842. HRESULT hr = S_OK ;
  1843. INT cFailures = 0 ;
  1844. hr = IVCPYTEST_100(argc, argv) ;
  1845. if (S_OK != hr)
  1846. {
  1847. if (FALSE != g_fFirstFailureExits)
  1848. {
  1849. return hr ;
  1850. }
  1851. else
  1852. {
  1853. cFailures++ ;
  1854. }
  1855. }
  1856. hr = IVCPYTEST_101(argc, argv) ;
  1857. if (S_OK != hr)
  1858. {
  1859. if (FALSE != g_fFirstFailureExits)
  1860. {
  1861. return hr ;
  1862. }
  1863. else
  1864. {
  1865. cFailures++ ;
  1866. }
  1867. }
  1868. // If the last test passed, but a previous test
  1869. // failed, return a failure code for the whole
  1870. // operation
  1871. if ( (S_OK == hr) && (0 != cFailures) )
  1872. {
  1873. hr = E_FAIL ;
  1874. }
  1875. return hr ;
  1876. }
  1877. //+-------------------------------------------------------------------
  1878. // Function: RunAllENUMTests
  1879. //
  1880. // Synopsis: Runs all "ENUM" tests. For information on these tests,
  1881. // see %ctolestg%\docs\stgbase\testplan.doc
  1882. //
  1883. // Arguments: [argc]
  1884. // [argv]
  1885. //
  1886. // Returns: HRESULT
  1887. //
  1888. // History: 22-July-1996 NarindK Created
  1889. //--------------------------------------------------------------------
  1890. HRESULT RunAllENUMTests(int argc, char *argv[])
  1891. {
  1892. HRESULT hr = S_OK ;
  1893. INT cFailures = 0 ;
  1894. hr = ENUMTEST_100(argc, argv) ;
  1895. if (S_OK != hr)
  1896. {
  1897. if (FALSE != g_fFirstFailureExits)
  1898. {
  1899. return hr ;
  1900. }
  1901. else
  1902. {
  1903. cFailures++ ;
  1904. }
  1905. }
  1906. hr = ENUMTEST_101(argc, argv) ;
  1907. if (S_OK != hr)
  1908. {
  1909. if (FALSE != g_fFirstFailureExits)
  1910. {
  1911. return hr ;
  1912. }
  1913. else
  1914. {
  1915. cFailures++ ;
  1916. }
  1917. }
  1918. hr = ENUMTEST_102(argc, argv) ;
  1919. if (S_OK != hr)
  1920. {
  1921. if (FALSE != g_fFirstFailureExits)
  1922. {
  1923. return hr ;
  1924. }
  1925. else
  1926. {
  1927. cFailures++ ;
  1928. }
  1929. }
  1930. hr = ENUMTEST_103(argc, argv) ;
  1931. if (S_OK != hr)
  1932. {
  1933. if (FALSE != g_fFirstFailureExits)
  1934. {
  1935. return hr ;
  1936. }
  1937. else
  1938. {
  1939. cFailures++ ;
  1940. }
  1941. }
  1942. hr = ENUMTEST_104(argc, argv) ;
  1943. if (S_OK != hr)
  1944. {
  1945. if (FALSE != g_fFirstFailureExits)
  1946. {
  1947. return hr ;
  1948. }
  1949. else
  1950. {
  1951. cFailures++ ;
  1952. }
  1953. }
  1954. // If the last test passed, but a previous test
  1955. // failed, return a failure code for the whole
  1956. // operation
  1957. if ( (S_OK == hr) && (0 != cFailures) )
  1958. {
  1959. hr = E_FAIL ;
  1960. }
  1961. return hr ;
  1962. }
  1963. //+-------------------------------------------------------------------
  1964. // Function: RunAllIROOTSTGTests
  1965. //
  1966. // Synopsis: Runs all "IROOTSTG" tests. For information on these tests,
  1967. // see %ctolestg%\docs\stgbase\testplan.doc
  1968. //
  1969. // Arguments: [argc]
  1970. // [argv]
  1971. //
  1972. // Returns: HRESULT
  1973. //
  1974. // History: 25-July-1996 NarindK Created
  1975. //--------------------------------------------------------------------
  1976. HRESULT RunAllIROOTSTGTests(int argc, char *argv[])
  1977. {
  1978. HRESULT hr = S_OK ;
  1979. INT cFailures = 0 ;
  1980. hr = IROOTSTGTEST_100(argc, argv) ;
  1981. if (S_OK != hr)
  1982. {
  1983. if (FALSE != g_fFirstFailureExits)
  1984. {
  1985. return hr ;
  1986. }
  1987. else
  1988. {
  1989. cFailures++ ;
  1990. }
  1991. }
  1992. hr = IROOTSTGTEST_101(argc, argv) ;
  1993. if (S_OK != hr)
  1994. {
  1995. if (FALSE != g_fFirstFailureExits)
  1996. {
  1997. return hr ;
  1998. }
  1999. else
  2000. {
  2001. cFailures++ ;
  2002. }
  2003. }
  2004. hr = IROOTSTGTEST_102(argc, argv) ;
  2005. if (S_OK != hr)
  2006. {
  2007. if (FALSE != g_fFirstFailureExits)
  2008. {
  2009. return hr ;
  2010. }
  2011. else
  2012. {
  2013. cFailures++ ;
  2014. }
  2015. }
  2016. hr = IROOTSTGTEST_103(argc, argv) ;
  2017. if (S_OK != hr)
  2018. {
  2019. if (FALSE != g_fFirstFailureExits)
  2020. {
  2021. return hr ;
  2022. }
  2023. else
  2024. {
  2025. cFailures++ ;
  2026. }
  2027. }
  2028. // If the last test passed, but a previous test
  2029. // failed, return a failure code for the whole
  2030. // operation
  2031. if ( (S_OK == hr) && (0 != cFailures) )
  2032. {
  2033. hr = E_FAIL ;
  2034. }
  2035. return hr ;
  2036. }
  2037. //+-------------------------------------------------------------------
  2038. // Function: RunAllHGLOBALTests
  2039. //
  2040. // Synopsis: Runs all "HGLOBAL" tests. For information on these tests,
  2041. // see %ctolestg%\docs\stgbase\testplan.doc
  2042. //
  2043. // Arguments: [argc]
  2044. // [argv]
  2045. //
  2046. // Returns: HRESULT
  2047. //
  2048. // History: 25-July-1996 T-ScottG Created
  2049. //--------------------------------------------------------------------
  2050. HRESULT RunAllHGLOBALTests(int argc, char *argv[])
  2051. {
  2052. HRESULT hr = S_OK ;
  2053. ULONG ulSeed = 0;
  2054. INT cFailures = 0;
  2055. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  2056. hr = HGLOBALTEST_100(ulSeed) ;
  2057. if (S_OK != hr)
  2058. {
  2059. if (FALSE != g_fFirstFailureExits)
  2060. {
  2061. return hr ;
  2062. }
  2063. else
  2064. {
  2065. cFailures++ ;
  2066. }
  2067. }
  2068. /* OLE bugs
  2069. hr = HGLOBALTEST_101(ulSeed) ;
  2070. if (S_OK != hr)
  2071. {
  2072. if (FALSE != g_fFirstFailureExits)
  2073. {
  2074. return hr ;
  2075. }
  2076. else
  2077. {
  2078. cFailures++ ;
  2079. }
  2080. }
  2081. */
  2082. hr = HGLOBALTEST_110(ulSeed) ;
  2083. if (S_OK != hr)
  2084. {
  2085. if (FALSE != g_fFirstFailureExits)
  2086. {
  2087. return hr ;
  2088. }
  2089. else
  2090. {
  2091. cFailures++ ;
  2092. }
  2093. }
  2094. hr = HGLOBALTEST_120(ulSeed) ;
  2095. if (S_OK != hr)
  2096. {
  2097. if (FALSE != g_fFirstFailureExits)
  2098. {
  2099. return hr ;
  2100. }
  2101. else
  2102. {
  2103. cFailures++ ;
  2104. }
  2105. }
  2106. /* OLE bugs
  2107. hr = HGLOBALTEST_121(ulSeed) ;
  2108. if (S_OK != hr)
  2109. {
  2110. if (FALSE != g_fFirstFailureExits)
  2111. {
  2112. return hr ;
  2113. }
  2114. else
  2115. {
  2116. cFailures++ ;
  2117. }
  2118. }
  2119. */
  2120. hr = HGLOBALTEST_130(ulSeed) ;
  2121. if (S_OK != hr)
  2122. {
  2123. if (FALSE != g_fFirstFailureExits)
  2124. {
  2125. return hr ;
  2126. }
  2127. else
  2128. {
  2129. cFailures++ ;
  2130. }
  2131. }
  2132. hr = HGLOBALTEST_140(ulSeed) ;
  2133. if (S_OK != hr)
  2134. {
  2135. if (FALSE != g_fFirstFailureExits)
  2136. {
  2137. return hr ;
  2138. }
  2139. else
  2140. {
  2141. cFailures++ ;
  2142. }
  2143. }
  2144. hr = HGLOBALTEST_150(ulSeed) ;
  2145. if (S_OK != hr)
  2146. {
  2147. if (FALSE != g_fFirstFailureExits)
  2148. {
  2149. return hr ;
  2150. }
  2151. else
  2152. {
  2153. cFailures++ ;
  2154. }
  2155. }
  2156. // If the last test passed, but a previous test
  2157. // failed, return a failure code for the whole
  2158. // operation
  2159. if ( (S_OK == hr) && (0 != cFailures) )
  2160. {
  2161. hr = E_FAIL ;
  2162. }
  2163. return hr ;
  2164. }
  2165. //+-------------------------------------------------------------------
  2166. // Function: RunAllSNBTests
  2167. //
  2168. // Synopsis: Runs all "SNB" tests. For information on these tests,
  2169. // see %ctolestg%\docs\stgbase\testplan.doc
  2170. //
  2171. // Arguments: [argc]
  2172. // [argv]
  2173. //
  2174. // Returns: HRESULT
  2175. //
  2176. // History: 26-July-1996 Jiminli Created
  2177. //--------------------------------------------------------------------
  2178. HRESULT RunAllSNBTests(int argc, char *argv[])
  2179. {
  2180. HRESULT hr = S_OK ;
  2181. INT cFailures = 0 ;
  2182. hr = SNBTEST_100(argc, argv) ;
  2183. if (S_OK != hr)
  2184. {
  2185. if (FALSE != g_fFirstFailureExits)
  2186. {
  2187. return hr ;
  2188. }
  2189. else
  2190. {
  2191. cFailures++ ;
  2192. }
  2193. }
  2194. hr = SNBTEST_101(argc, argv) ;
  2195. if (S_OK != hr)
  2196. {
  2197. if (FALSE != g_fFirstFailureExits)
  2198. {
  2199. return hr ;
  2200. }
  2201. else
  2202. {
  2203. cFailures++ ;
  2204. }
  2205. }
  2206. hr = SNBTEST_102(argc, argv) ;
  2207. if (S_OK != hr)
  2208. {
  2209. if (FALSE != g_fFirstFailureExits)
  2210. {
  2211. return hr ;
  2212. }
  2213. else
  2214. {
  2215. cFailures++ ;
  2216. }
  2217. }
  2218. hr = SNBTEST_103(argc, argv) ;
  2219. if (S_OK != hr)
  2220. {
  2221. if (FALSE != g_fFirstFailureExits)
  2222. {
  2223. return hr ;
  2224. }
  2225. else
  2226. {
  2227. cFailures++ ;
  2228. }
  2229. }
  2230. // If the last test passed, but a previous test
  2231. // failed, return a failure code for the whole
  2232. // operation
  2233. if ( (S_OK == hr) && (0 != cFailures) )
  2234. {
  2235. hr = E_FAIL ;
  2236. }
  2237. return hr ;
  2238. }
  2239. //+-------------------------------------------------------------------
  2240. // Function: RunAllMISCTests
  2241. //
  2242. // Synopsis: Runs all "MISC" tests. For information on these tests,
  2243. // see %ctolestg%\docs\stgbase\testplan.doc
  2244. //
  2245. // Arguments: [argc]
  2246. // [argv]
  2247. //
  2248. // Returns: HRESULT
  2249. //
  2250. // History: 5-Aug-1996 Jiminli Created
  2251. //--------------------------------------------------------------------
  2252. HRESULT RunAllMISCTests(int argc, char *argv[])
  2253. {
  2254. HRESULT hr = S_OK ;
  2255. INT cFailures = 0 ;
  2256. hr = MISCTEST_100(argc, argv) ;
  2257. if (S_OK != hr)
  2258. {
  2259. if (FALSE != g_fFirstFailureExits)
  2260. {
  2261. return hr ;
  2262. }
  2263. else
  2264. {
  2265. cFailures++ ;
  2266. }
  2267. }
  2268. hr = MISCTEST_101(argc, argv) ;
  2269. if (S_OK != hr)
  2270. {
  2271. if (FALSE != g_fFirstFailureExits)
  2272. {
  2273. return hr ;
  2274. }
  2275. else
  2276. {
  2277. cFailures++ ;
  2278. }
  2279. }
  2280. hr = MISCTEST_102(argc, argv) ;
  2281. if (S_OK != hr)
  2282. {
  2283. if (FALSE != g_fFirstFailureExits)
  2284. {
  2285. return hr ;
  2286. }
  2287. else
  2288. {
  2289. cFailures++ ;
  2290. }
  2291. }
  2292. hr = MISCTEST_103(argc, argv) ;
  2293. if (S_OK != hr)
  2294. {
  2295. if (FALSE != g_fFirstFailureExits)
  2296. {
  2297. return hr ;
  2298. }
  2299. else
  2300. {
  2301. cFailures++ ;
  2302. }
  2303. }
  2304. hr = MISCTEST_104(argc, argv) ;
  2305. if (S_OK != hr)
  2306. {
  2307. if (FALSE != g_fFirstFailureExits)
  2308. {
  2309. return hr ;
  2310. }
  2311. else
  2312. {
  2313. cFailures++ ;
  2314. }
  2315. }
  2316. hr = MISCTEST_105(argc, argv) ;
  2317. if (S_OK != hr)
  2318. {
  2319. if (FALSE != g_fFirstFailureExits)
  2320. {
  2321. return hr ;
  2322. }
  2323. else
  2324. {
  2325. cFailures++ ;
  2326. }
  2327. }
  2328. // If the last test passed, but a previous test
  2329. // failed, return a failure code for the whole
  2330. // operation
  2331. if ( (S_OK == hr) && (0 != cFailures) )
  2332. {
  2333. hr = E_FAIL ;
  2334. }
  2335. return hr ;
  2336. }
  2337. //+-------------------------------------------------------------------
  2338. // Function: RunAllILKBTests
  2339. //
  2340. // Synopsis: Runs all "ILKB" tests. For information on these tests,
  2341. // see %ctolestg%\docs\stgbase\testplan.doc
  2342. //
  2343. // Arguments: [argc]
  2344. // [argv]
  2345. //
  2346. // Returns: HRESULT
  2347. //
  2348. // History: 5-Aug-1996 NarindK Created
  2349. //--------------------------------------------------------------------
  2350. HRESULT RunAllILKBTests(int argc, char *argv[])
  2351. {
  2352. HRESULT hr = S_OK ;
  2353. INT cFailures = 0 ;
  2354. hr = ILKBTEST_100(argc, argv) ;
  2355. if (S_OK != hr)
  2356. {
  2357. if (FALSE != g_fFirstFailureExits)
  2358. {
  2359. return hr ;
  2360. }
  2361. else
  2362. {
  2363. cFailures++ ;
  2364. }
  2365. }
  2366. hr = ILKBTEST_101(argc, argv) ;
  2367. if (S_OK != hr)
  2368. {
  2369. if (FALSE != g_fFirstFailureExits)
  2370. {
  2371. return hr ;
  2372. }
  2373. else
  2374. {
  2375. cFailures++ ;
  2376. }
  2377. }
  2378. hr = ILKBTEST_102(argc, argv) ;
  2379. if (S_OK != hr)
  2380. {
  2381. if (FALSE != g_fFirstFailureExits)
  2382. {
  2383. return hr ;
  2384. }
  2385. else
  2386. {
  2387. cFailures++ ;
  2388. }
  2389. }
  2390. /* OLE BUG : 52216
  2391. hr = ILKBTEST_103(argc, argv) ;
  2392. if (S_OK != hr)
  2393. {
  2394. if (FALSE != g_fFirstFailureExits)
  2395. {
  2396. return hr ;
  2397. }
  2398. else
  2399. {
  2400. cFailures++ ;
  2401. }
  2402. }
  2403. */
  2404. /* OLE Bug 52279
  2405. hr = ILKBTEST_104(argc, argv) ;
  2406. if (S_OK != hr)
  2407. {
  2408. if (FALSE != g_fFirstFailureExits)
  2409. {
  2410. return hr ;
  2411. }
  2412. else
  2413. {
  2414. cFailures++ ;
  2415. }
  2416. }
  2417. */
  2418. /* OLE Bug
  2419. hr = ILKBTEST_105(argc, argv) ;
  2420. if (S_OK != hr)
  2421. {
  2422. if (FALSE != g_fFirstFailureExits)
  2423. {
  2424. return hr ;
  2425. }
  2426. else
  2427. {
  2428. cFailures++ ;
  2429. }
  2430. }
  2431. */
  2432. /* OLE Bug
  2433. hr = ILKBTEST_106(argc, argv) ;
  2434. if (S_OK != hr)
  2435. {
  2436. if (FALSE != g_fFirstFailureExits)
  2437. {
  2438. return hr ;
  2439. }
  2440. else
  2441. {
  2442. cFailures++ ;
  2443. }
  2444. }
  2445. */
  2446. hr = ILKBTEST_107(argc, argv) ;
  2447. if (S_OK != hr)
  2448. {
  2449. if (FALSE != g_fFirstFailureExits)
  2450. {
  2451. return hr ;
  2452. }
  2453. else
  2454. {
  2455. cFailures++ ;
  2456. }
  2457. }
  2458. /* OLE Bug
  2459. hr = ILKBTEST_108(argc, argv) ;
  2460. if (S_OK != hr)
  2461. {
  2462. if (FALSE != g_fFirstFailureExits)
  2463. {
  2464. return hr ;
  2465. }
  2466. else
  2467. {
  2468. cFailures++ ;
  2469. }
  2470. }
  2471. */
  2472. // If the last test passed, but a previous test
  2473. // failed, return a failure code for the whole
  2474. // operation
  2475. if ( (S_OK == hr) && (0 != cFailures) )
  2476. {
  2477. hr = E_FAIL ;
  2478. }
  2479. return hr ;
  2480. }
  2481. //+-------------------------------------------------------------------
  2482. // Function: RunAllFlatTests
  2483. //
  2484. // Synopsis: Runs all "FLAT" tests.
  2485. //
  2486. // Arguments: [argc]
  2487. // [argv]
  2488. //
  2489. // Returns: HRESULT
  2490. //
  2491. // History: 22-Jan-1998 BogdanT created
  2492. //--------------------------------------------------------------------
  2493. HRESULT RunAllFlatTests(int argc, char *argv[])
  2494. {
  2495. HRESULT hr = S_OK ;
  2496. INT cFailures = 0 ;
  2497. hr = FLATTEST_100(argc, argv) ;
  2498. if (S_OK != hr)
  2499. {
  2500. if (FALSE != g_fFirstFailureExits)
  2501. {
  2502. return hr ;
  2503. }
  2504. else
  2505. {
  2506. cFailures++ ;
  2507. }
  2508. }
  2509. hr = FLATTEST_101(argc, argv) ;
  2510. if (S_OK != hr)
  2511. {
  2512. if (FALSE != g_fFirstFailureExits)
  2513. {
  2514. return hr ;
  2515. }
  2516. else
  2517. {
  2518. cFailures++ ;
  2519. }
  2520. }
  2521. // If the last test passed, but a previous test
  2522. // failed, return a failure code for the whole
  2523. // operation
  2524. if ( (S_OK == hr) && (0 != cFailures) )
  2525. {
  2526. hr = E_FAIL ;
  2527. }
  2528. return hr ;
  2529. }
  2530. //+-------------------------------------------------------------------
  2531. // Function: RunSingleCOMTest
  2532. //
  2533. // Synopsis: Runs single "COMTEST" test. For information on these testa,
  2534. // see %ctolestg%\docs\stgbase\testplan.doc
  2535. //
  2536. // Arguments: [lTestNum]
  2537. // [argc]
  2538. // [argv]
  2539. //
  2540. // Returns: HRESULT
  2541. //
  2542. // History: 28-May-1996 NarindK Created
  2543. //--------------------------------------------------------------------
  2544. HRESULT RunSingleCOMTest(LONG lTestNum, int argc, char *argv[])
  2545. {
  2546. HRESULT hr = E_FAIL ;
  2547. int i = 0;
  2548. switch (lTestNum)
  2549. {
  2550. case ( 100 ) :
  2551. {
  2552. hr = COMTEST_100(argc, argv) ;
  2553. break ;
  2554. }
  2555. case ( 101 ) :
  2556. {
  2557. hr = COMTEST_101(argc, argv) ;
  2558. break ;
  2559. }
  2560. case ( 102 ) :
  2561. {
  2562. hr = COMTEST_102(argc, argv) ;
  2563. break ;
  2564. }
  2565. case ( 103 ) :
  2566. {
  2567. hr = COMTEST_103(argc, argv) ;
  2568. break ;
  2569. }
  2570. case ( 104 ) :
  2571. {
  2572. hr = COMTEST_104(argc, argv) ;
  2573. break ;
  2574. }
  2575. case ( 105 ) :
  2576. {
  2577. hr = COMTEST_105(argc, argv) ;
  2578. break ;
  2579. }
  2580. case ( 106 ) :
  2581. {
  2582. hr = COMTEST_106(argc, argv) ;
  2583. break ;
  2584. }
  2585. default:
  2586. {
  2587. //
  2588. // Invalid test
  2589. //
  2590. DH_LOG((LOG_INFO,
  2591. TEXT("Invalid COMTEST test number: %ld"),
  2592. lTestNum) ) ;
  2593. }
  2594. }
  2595. return hr ;
  2596. }
  2597. //+-------------------------------------------------------------------
  2598. // Function: RunSingleDFTest
  2599. //
  2600. // Synopsis: Runs single "DFTEST" test. For information on these testa,
  2601. // see %ctolestg%\docs\stgbase\testplan.doc
  2602. //
  2603. // Arguments: [lTestNum]
  2604. // [argc]
  2605. // [argv]
  2606. //
  2607. // Returns: HRESULT
  2608. //
  2609. // History: 3-June-1996 NarindK Created
  2610. //--------------------------------------------------------------------
  2611. HRESULT RunSingleDFTest(LONG lTestNum, int argc, char *argv[])
  2612. {
  2613. HRESULT hr = E_FAIL ;
  2614. int i = 0;
  2615. ULONG ulSeed = 0;
  2616. switch (lTestNum)
  2617. {
  2618. case ( 100 ) :
  2619. {
  2620. hr = DFTEST_100(argc, argv) ;
  2621. break ;
  2622. }
  2623. case ( 101 ) :
  2624. {
  2625. hr = DFTEST_101(argc, argv) ;
  2626. break ;
  2627. }
  2628. case ( 102 ) :
  2629. {
  2630. hr = DFTEST_102(argc, argv) ;
  2631. break ;
  2632. }
  2633. case ( 103 ) :
  2634. {
  2635. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  2636. hr = DFTEST_103(ulSeed) ;
  2637. break ;
  2638. }
  2639. case ( 104 ) :
  2640. {
  2641. hr = DFTEST_104(argc, argv) ;
  2642. break ;
  2643. }
  2644. case ( 105 ) :
  2645. {
  2646. hr = DFTEST_105(argc, argv) ;
  2647. break ;
  2648. }
  2649. case ( 106 ) :
  2650. {
  2651. hr = DFTEST_106(argc, argv) ;
  2652. break ;
  2653. }
  2654. case ( 107 ) :
  2655. {
  2656. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  2657. hr = DFTEST_107(ulSeed) ;
  2658. break ;
  2659. }
  2660. case ( 108 ) :
  2661. {
  2662. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  2663. hr = DFTEST_108(ulSeed) ;
  2664. break ;
  2665. }
  2666. case ( 109 ) :
  2667. {
  2668. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  2669. hr = DFTEST_109(ulSeed) ;
  2670. break ;
  2671. }
  2672. default:
  2673. {
  2674. //
  2675. // Invalid test
  2676. //
  2677. DH_LOG((LOG_INFO,
  2678. TEXT("Invalid DFTEST test number: %ld"),
  2679. lTestNum) ) ;
  2680. }
  2681. }
  2682. return hr ;
  2683. }
  2684. //+-------------------------------------------------------------------
  2685. // Function: RunSingleAPITest
  2686. //
  2687. // Synopsis: Runs single "APITEST" test. For information on these testa,
  2688. // see %ctolestg%\docs\stgbase\testplan.doc
  2689. //
  2690. // Arguments: [lTestNum]
  2691. // [argc]
  2692. // [argv]
  2693. //
  2694. // Returns: HRESULT
  2695. //
  2696. // History: 18-June-1996 NarindK Created
  2697. //--------------------------------------------------------------------
  2698. HRESULT RunSingleAPITest(LONG lTestNum, int argc, char *argv[])
  2699. {
  2700. HRESULT hr = E_FAIL ;
  2701. int i = 0;
  2702. switch (lTestNum)
  2703. {
  2704. case ( 100 ) :
  2705. {
  2706. hr = APITEST_100(argc, argv) ;
  2707. break ;
  2708. }
  2709. case ( 101 ) :
  2710. {
  2711. hr = APITEST_101(argc, argv) ;
  2712. break ;
  2713. }
  2714. case ( 102 ) :
  2715. {
  2716. hr = APITEST_102(argc, argv) ;
  2717. break ;
  2718. }
  2719. case ( 103 ) :
  2720. {
  2721. hr = APITEST_103(argc, argv) ;
  2722. break ;
  2723. }
  2724. case ( 104 ) :
  2725. {
  2726. hr = APITEST_104(argc, argv) ;
  2727. break ;
  2728. }
  2729. case 200:
  2730. {
  2731. hr = APITEST_200(argc, argv) ;
  2732. break ;
  2733. }
  2734. case 201:
  2735. {
  2736. hr = APITEST_201(argc, argv) ;
  2737. break ;
  2738. }
  2739. case 202:
  2740. {
  2741. hr = APITEST_202(argc, argv) ;
  2742. break ;
  2743. }
  2744. case 203:
  2745. {
  2746. hr = APITEST_203(argc, argv) ;
  2747. break ;
  2748. }
  2749. case 204:
  2750. {
  2751. hr = APITEST_204(argc, argv) ;
  2752. break ;
  2753. }
  2754. default:
  2755. {
  2756. //
  2757. // Invalid test
  2758. //
  2759. DH_LOG((LOG_INFO,
  2760. TEXT("Invalid APITEST test number: %ld"),
  2761. lTestNum) ) ;
  2762. }
  2763. }
  2764. return hr ;
  2765. }
  2766. //+-------------------------------------------------------------------
  2767. // Function: RunSingleROOTTest
  2768. //
  2769. // Synopsis: Runs single "ROOTTEST" test. For information on these testa,
  2770. // see %ctolestg%\docs\stgbase\testplan.doc
  2771. //
  2772. // Arguments: [lTestNum]
  2773. // [argc]
  2774. // [argv]
  2775. //
  2776. // Returns: HRESULT
  2777. //
  2778. // History: 24-June-1996 NarindK Created
  2779. //--------------------------------------------------------------------
  2780. HRESULT RunSingleROOTTest(LONG lTestNum, int argc, char *argv[])
  2781. {
  2782. HRESULT hr = E_FAIL ;
  2783. int i = 0;
  2784. switch (lTestNum)
  2785. {
  2786. case ( 100 ) :
  2787. {
  2788. hr = ROOTTEST_100(argc, argv) ;
  2789. break ;
  2790. }
  2791. case ( 101 ) :
  2792. {
  2793. hr = ROOTTEST_101(argc, argv) ;
  2794. break ;
  2795. }
  2796. case ( 102 ) :
  2797. {
  2798. hr = ROOTTEST_102(argc, argv) ;
  2799. break ;
  2800. }
  2801. case ( 103 ) :
  2802. {
  2803. hr = ROOTTEST_103(argc, argv) ;
  2804. break ;
  2805. }
  2806. case ( 104 ) :
  2807. {
  2808. hr = ROOTTEST_104(argc, argv) ;
  2809. break ;
  2810. }
  2811. default:
  2812. {
  2813. //
  2814. // Invalid test
  2815. //
  2816. DH_LOG((LOG_INFO,
  2817. TEXT("Invalid ROOTTEST test number: %ld"),
  2818. lTestNum) ) ;
  2819. }
  2820. }
  2821. return hr ;
  2822. }
  2823. //+-------------------------------------------------------------------
  2824. // Function: RunSingleSTMTest
  2825. //
  2826. // Synopsis: Runs single "STMTEST" test. For information on these testa,
  2827. // see %ctolestg%\docs\stgbase\testplan.doc
  2828. //
  2829. // Arguments: [lTestNum]
  2830. // [argc]
  2831. // [argv]
  2832. //
  2833. // Returns: HRESULT
  2834. //
  2835. // History: 28-June-1996 NarindK Created
  2836. //--------------------------------------------------------------------
  2837. HRESULT RunSingleSTMTest(LONG lTestNum, int argc, char *argv[])
  2838. {
  2839. HRESULT hr = E_FAIL ;
  2840. int i = 0;
  2841. switch (lTestNum)
  2842. {
  2843. case ( 100 ) :
  2844. {
  2845. hr = STMTEST_100(argc, argv) ;
  2846. break ;
  2847. }
  2848. case ( 101 ) :
  2849. {
  2850. hr = STMTEST_101(argc, argv) ;
  2851. break ;
  2852. }
  2853. case ( 102 ) :
  2854. {
  2855. hr = STMTEST_102(argc, argv) ;
  2856. break ;
  2857. }
  2858. case ( 103 ) :
  2859. {
  2860. hr = STMTEST_103(argc, argv) ;
  2861. break ;
  2862. }
  2863. case ( 104 ) :
  2864. {
  2865. hr = STMTEST_104(argc, argv) ;
  2866. break ;
  2867. }
  2868. case ( 105 ) :
  2869. {
  2870. hr = STMTEST_105(argc, argv) ;
  2871. break ;
  2872. }
  2873. case ( 106 ) :
  2874. {
  2875. hr = STMTEST_106(argc, argv) ;
  2876. break ;
  2877. }
  2878. case ( 107 ) :
  2879. {
  2880. hr = STMTEST_107(argc, argv) ;
  2881. break ;
  2882. }
  2883. case ( 108 ) :
  2884. {
  2885. hr = STMTEST_108(argc, argv) ;
  2886. break ;
  2887. }
  2888. case ( 109 ) :
  2889. {
  2890. hr = STMTEST_109(argc, argv) ;
  2891. break ;
  2892. }
  2893. default:
  2894. {
  2895. //
  2896. // Invalid test
  2897. //
  2898. DH_LOG((LOG_INFO,
  2899. TEXT("Invalid STMTEST test number: %ld"),
  2900. lTestNum) ) ;
  2901. }
  2902. }
  2903. return hr ;
  2904. }
  2905. //+-------------------------------------------------------------------
  2906. // Function: RunSingleSTGTest
  2907. //
  2908. // Synopsis: Runs single "STGTEST" test. For information on these testa,
  2909. // see %ctolestg%\docs\stgbase\testplan.doc
  2910. //
  2911. // Arguments: [lTestNum]
  2912. // [argc]
  2913. // [argv]
  2914. //
  2915. // Returns: HRESULT
  2916. //
  2917. // History: 10-July-1996 NarindK Created
  2918. //--------------------------------------------------------------------
  2919. HRESULT RunSingleSTGTest(LONG lTestNum, int argc, char *argv[])
  2920. {
  2921. HRESULT hr = E_FAIL ;
  2922. int i = 0;
  2923. switch (lTestNum)
  2924. {
  2925. case ( 100 ) :
  2926. {
  2927. hr = STGTEST_100(argc, argv) ;
  2928. break ;
  2929. }
  2930. case ( 101 ) :
  2931. {
  2932. hr = STGTEST_101(argc, argv) ;
  2933. break ;
  2934. }
  2935. case ( 102 ) :
  2936. {
  2937. hr = STGTEST_102(argc, argv) ;
  2938. break ;
  2939. }
  2940. case ( 103 ) :
  2941. {
  2942. hr = STGTEST_103(argc, argv) ;
  2943. break ;
  2944. }
  2945. case ( 104 ) :
  2946. {
  2947. hr = STGTEST_104(argc, argv) ;
  2948. break ;
  2949. }
  2950. case ( 105 ) :
  2951. {
  2952. hr = STGTEST_105(argc, argv) ;
  2953. break ;
  2954. }
  2955. case ( 107 ) :
  2956. {
  2957. hr = STGTEST_107(argc, argv) ;
  2958. break ;
  2959. }
  2960. case ( 108 ) :
  2961. {
  2962. hr = STGTEST_108(argc, argv) ;
  2963. break ;
  2964. }
  2965. case ( 109 ) :
  2966. {
  2967. hr = STGTEST_109(argc, argv) ;
  2968. break ;
  2969. }
  2970. case ( 110 ) :
  2971. {
  2972. hr = STGTEST_110(argc, argv) ;
  2973. break ;
  2974. }
  2975. default:
  2976. {
  2977. //
  2978. // Invalid test
  2979. //
  2980. DH_LOG((LOG_INFO,
  2981. TEXT("Invalid STGTEST test number: %ld"),
  2982. lTestNum) ) ;
  2983. }
  2984. }
  2985. return hr ;
  2986. }
  2987. //+-------------------------------------------------------------------
  2988. // Function: RunSingleVCPYTest
  2989. //
  2990. // Synopsis: Runs single "VCPYTEST" test. For information on these testa,
  2991. // see %ctolestg%\docs\stgbase\testplan.doc
  2992. //
  2993. // Arguments: [lTestNum]
  2994. // [argc]
  2995. // [argv]
  2996. //
  2997. // Returns: HRESULT
  2998. //
  2999. // History: 15-July-1996 NarindK Created
  3000. //--------------------------------------------------------------------
  3001. HRESULT RunSingleVCPYTest(LONG lTestNum, int argc, char *argv[])
  3002. {
  3003. HRESULT hr = E_FAIL ;
  3004. int i = 0;
  3005. switch (lTestNum)
  3006. {
  3007. case ( 100 ) :
  3008. {
  3009. hr = VCPYTEST_100(argc, argv) ;
  3010. break ;
  3011. }
  3012. case ( 101 ) :
  3013. {
  3014. hr = VCPYTEST_101(argc, argv) ;
  3015. break ;
  3016. }
  3017. case ( 102 ) :
  3018. {
  3019. hr = VCPYTEST_102(argc, argv) ;
  3020. break ;
  3021. }
  3022. case ( 103 ) :
  3023. {
  3024. hr = VCPYTEST_103(argc, argv) ;
  3025. break ;
  3026. }
  3027. case ( 104 ) :
  3028. {
  3029. hr = VCPYTEST_104(argc, argv) ;
  3030. break ;
  3031. }
  3032. case ( 105 ) :
  3033. {
  3034. hr = VCPYTEST_105(argc, argv) ;
  3035. break ;
  3036. }
  3037. case ( 106 ) :
  3038. {
  3039. hr = VCPYTEST_106(argc, argv) ;
  3040. break ;
  3041. }
  3042. default:
  3043. {
  3044. //
  3045. // Invalid test
  3046. //
  3047. DH_LOG((LOG_INFO,
  3048. TEXT("Invalid VCPYTEST test number: %ld"),
  3049. lTestNum) ) ;
  3050. }
  3051. }
  3052. return hr ;
  3053. }
  3054. //+-------------------------------------------------------------------
  3055. // Function: RunSingleIVCPYTest
  3056. //
  3057. // Synopsis: Runs single "IVCPYTEST" test. For information on these testa,
  3058. // see %ctolestg%\docs\stgbase\testplan.doc
  3059. //
  3060. // Arguments: [lTestNum]
  3061. // [argc]
  3062. // [argv]
  3063. //
  3064. // Returns: HRESULT
  3065. //
  3066. // History: 21-July-1996 NarindK Created
  3067. //--------------------------------------------------------------------
  3068. HRESULT RunSingleIVCPYTest(LONG lTestNum, int argc, char *argv[])
  3069. {
  3070. HRESULT hr = E_FAIL ;
  3071. int i = 0;
  3072. switch (lTestNum)
  3073. {
  3074. case ( 100 ) :
  3075. {
  3076. hr = IVCPYTEST_100(argc, argv) ;
  3077. break ;
  3078. }
  3079. case ( 101 ) :
  3080. {
  3081. hr = IVCPYTEST_101(argc, argv) ;
  3082. break ;
  3083. }
  3084. default:
  3085. {
  3086. //
  3087. // Invalid test
  3088. //
  3089. DH_LOG((LOG_INFO,
  3090. TEXT("Invalid IVCPYTEST test number: %ld"),
  3091. lTestNum) ) ;
  3092. }
  3093. }
  3094. return hr ;
  3095. }
  3096. //+-------------------------------------------------------------------
  3097. // Function: RunSingleENUMTest
  3098. //
  3099. // Synopsis: Runs single "ENUMTEST" test. For information on these testa,
  3100. // see %ctolestg%\docs\stgbase\testplan.doc
  3101. //
  3102. // Arguments: [lTestNum]
  3103. // [argc]
  3104. // [argv]
  3105. //
  3106. // Returns: HRESULT
  3107. //
  3108. // History: 22-July-1996 NarindK Created
  3109. //--------------------------------------------------------------------
  3110. HRESULT RunSingleENUMTest(LONG lTestNum, int argc, char *argv[])
  3111. {
  3112. HRESULT hr = E_FAIL ;
  3113. int i = 0;
  3114. switch (lTestNum)
  3115. {
  3116. case ( 100 ) :
  3117. {
  3118. hr = ENUMTEST_100(argc, argv) ;
  3119. break ;
  3120. }
  3121. case ( 101 ) :
  3122. {
  3123. hr = ENUMTEST_101(argc, argv) ;
  3124. break ;
  3125. }
  3126. case ( 102 ) :
  3127. {
  3128. hr = ENUMTEST_102(argc, argv) ;
  3129. break ;
  3130. }
  3131. case ( 103 ) :
  3132. {
  3133. hr = ENUMTEST_103(argc, argv) ;
  3134. break ;
  3135. }
  3136. case ( 104 ) :
  3137. {
  3138. hr = ENUMTEST_104(argc, argv) ;
  3139. break ;
  3140. }
  3141. default:
  3142. {
  3143. //
  3144. // Invalid test
  3145. //
  3146. DH_LOG((LOG_INFO,
  3147. TEXT("Invalid ENUMTEST test number: %ld"),
  3148. lTestNum) ) ;
  3149. }
  3150. }
  3151. return hr ;
  3152. }
  3153. //+-------------------------------------------------------------------
  3154. // Function: RunSingleIROOTSTGTest
  3155. //
  3156. // Synopsis: Runs single "IROOTSTGTEST" test. For information on these testa,
  3157. // see %ctolestg%\docs\stgbase\testplan.doc
  3158. //
  3159. // Arguments: [lTestNum]
  3160. // [argc]
  3161. // [argv]
  3162. //
  3163. // Returns: HRESULT
  3164. //
  3165. // History: 25-July-1996 NarindK Created
  3166. //--------------------------------------------------------------------
  3167. HRESULT RunSingleIROOTSTGTest(LONG lTestNum, int argc, char *argv[])
  3168. {
  3169. HRESULT hr = E_FAIL ;
  3170. int i = 0;
  3171. switch (lTestNum)
  3172. {
  3173. case ( 100 ) :
  3174. {
  3175. hr = IROOTSTGTEST_100(argc, argv) ;
  3176. break ;
  3177. }
  3178. case ( 101 ) :
  3179. {
  3180. hr = IROOTSTGTEST_101(argc, argv) ;
  3181. break ;
  3182. }
  3183. case ( 102 ) :
  3184. {
  3185. hr = IROOTSTGTEST_102(argc, argv) ;
  3186. break ;
  3187. }
  3188. case ( 103 ) :
  3189. {
  3190. hr = IROOTSTGTEST_103(argc, argv) ;
  3191. break ;
  3192. }
  3193. default:
  3194. {
  3195. //
  3196. // Invalid test
  3197. //
  3198. DH_LOG((LOG_INFO,
  3199. TEXT("Invalid IROOTSTGTEST test number: %ld"),
  3200. lTestNum) ) ;
  3201. }
  3202. }
  3203. return hr ;
  3204. }
  3205. //+-------------------------------------------------------------------
  3206. // Function: RunSingleHGLOBALTest
  3207. //
  3208. // Synopsis: Runs single "HGLOBAL" test. For information on these tests,
  3209. // see %ctolestg%\docs\stgbase\testplan.doc
  3210. //
  3211. // Arguments: [lTestNum]
  3212. // [argc]
  3213. // [argv]
  3214. //
  3215. // Returns: HRESULT
  3216. //
  3217. // History: 31-July-1996 T-ScottG Modified
  3218. // 25-July-1996 NarindK Created
  3219. //--------------------------------------------------------------------
  3220. HRESULT RunSingleHGLOBALTest(LONG lTestNum, int argc, char *argv[])
  3221. {
  3222. HRESULT hr = S_OK ;
  3223. ULONG ulSeed = 0;
  3224. // Obtain Seed from CommandLine
  3225. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  3226. // Case test number
  3227. if (S_OK == hr)
  3228. {
  3229. switch (lTestNum)
  3230. {
  3231. case ( 100 ) :
  3232. {
  3233. hr = HGLOBALTEST_100( ulSeed ) ;
  3234. break ;
  3235. }
  3236. case ( 101 ) :
  3237. {
  3238. hr = HGLOBALTEST_101( ulSeed ) ;
  3239. break ;
  3240. }
  3241. case ( 110 ) :
  3242. {
  3243. hr = HGLOBALTEST_110( ulSeed ) ;
  3244. break ;
  3245. }
  3246. case ( 120 ) :
  3247. {
  3248. hr = HGLOBALTEST_120( ulSeed ) ;
  3249. break ;
  3250. }
  3251. case ( 121 ) :
  3252. {
  3253. hr = HGLOBALTEST_121( ulSeed ) ;
  3254. break ;
  3255. }
  3256. case ( 130 ) :
  3257. {
  3258. hr = HGLOBALTEST_130( ulSeed ) ;
  3259. break ;
  3260. }
  3261. case ( 140 ) :
  3262. {
  3263. hr = HGLOBALTEST_140( ulSeed ) ;
  3264. break ;
  3265. }
  3266. case ( 150 ) :
  3267. {
  3268. hr = HGLOBALTEST_150( ulSeed ) ;
  3269. break ;
  3270. }
  3271. default:
  3272. {
  3273. //
  3274. // Invalid test
  3275. //
  3276. DH_LOG((LOG_INFO,
  3277. TEXT("Invalid HGLOBALTEST test number: %ld"),
  3278. lTestNum) ) ;
  3279. }
  3280. }
  3281. }
  3282. return hr ;
  3283. }
  3284. //+-------------------------------------------------------------------
  3285. // Function: RunSingleSNBTest
  3286. //
  3287. // Synopsis: Runs single "SNBTEST" test. For information on these
  3288. // tests, see %ctolestg%\docs\stgbase\testplan.doc
  3289. //
  3290. // Arguments: [lTestNum]
  3291. // [argc]
  3292. // [argv]
  3293. //
  3294. // Returns: HRESULT
  3295. //
  3296. // History: 26-July-1996 Jiminli Created
  3297. //--------------------------------------------------------------------
  3298. HRESULT RunSingleSNBTest(LONG lTestNum, int argc, char *argv[])
  3299. {
  3300. HRESULT hr = E_FAIL ;
  3301. int i = 0;
  3302. switch (lTestNum)
  3303. {
  3304. case ( 100 ) :
  3305. {
  3306. hr = SNBTEST_100(argc, argv) ;
  3307. break ;
  3308. }
  3309. case ( 101 ) :
  3310. {
  3311. hr = SNBTEST_101(argc, argv) ;
  3312. break ;
  3313. }
  3314. case ( 102 ) :
  3315. {
  3316. hr = SNBTEST_102(argc, argv) ;
  3317. break ;
  3318. }
  3319. case ( 103 ) :
  3320. {
  3321. hr = SNBTEST_103(argc, argv) ;
  3322. break ;
  3323. }
  3324. default:
  3325. {
  3326. //
  3327. // Invalid test
  3328. //
  3329. DH_LOG((LOG_INFO,
  3330. TEXT("Invalid SNBTEST test number: %ld"),
  3331. lTestNum) ) ;
  3332. }
  3333. }
  3334. return hr ;
  3335. }
  3336. //+-------------------------------------------------------------------
  3337. // Function: RunSingleMISCTest
  3338. //
  3339. // Synopsis: Runs single "MISCTEST" test. For information on these
  3340. // tests, see %ctolestg%\docs\stgbase\testplan.doc
  3341. //
  3342. // Arguments: [lTestNum]
  3343. // [argc]
  3344. // [argv]
  3345. //
  3346. // Returns: HRESULT
  3347. //
  3348. // History: 5-Aug-1996 Jiminli Created
  3349. //--------------------------------------------------------------------
  3350. HRESULT RunSingleMISCTest(LONG lTestNum, int argc, char *argv[])
  3351. {
  3352. HRESULT hr = E_FAIL ;
  3353. int i = 0;
  3354. switch (lTestNum)
  3355. {
  3356. case ( 100 ) :
  3357. {
  3358. hr = MISCTEST_100(argc, argv) ;
  3359. break ;
  3360. }
  3361. case ( 101 ) :
  3362. {
  3363. hr = MISCTEST_101(argc, argv) ;
  3364. break ;
  3365. }
  3366. case ( 102 ) :
  3367. {
  3368. hr = MISCTEST_102(argc, argv) ;
  3369. break ;
  3370. }
  3371. case ( 103 ) :
  3372. {
  3373. hr = MISCTEST_103(argc, argv) ;
  3374. break ;
  3375. }
  3376. case ( 104 ) :
  3377. {
  3378. hr = MISCTEST_104(argc, argv) ;
  3379. break ;
  3380. }
  3381. case ( 105 ) :
  3382. {
  3383. hr = MISCTEST_105(argc, argv) ;
  3384. break ;
  3385. }
  3386. default:
  3387. {
  3388. //
  3389. // Invalid test
  3390. //
  3391. DH_LOG((LOG_INFO,
  3392. TEXT("Invalid MISCTEST test number: %ld"),
  3393. lTestNum) ) ;
  3394. }
  3395. }
  3396. return hr ;
  3397. }
  3398. //+-------------------------------------------------------------------
  3399. // Function: RunSingleILKBTest
  3400. //
  3401. // Synopsis: Runs single "ILKBTEST" test. For information on these
  3402. // tests, see %ctolestg%\docs\stgbase\testplan.doc
  3403. //
  3404. // Arguments: [lTestNum]
  3405. // [argc]
  3406. // [argv]
  3407. //
  3408. // Returns: HRESULT
  3409. //
  3410. // History: 31-July-1996 NarindK Created
  3411. //--------------------------------------------------------------------
  3412. HRESULT RunSingleILKBTest(LONG lTestNum, int argc, char *argv[])
  3413. {
  3414. HRESULT hr = E_FAIL ;
  3415. int i = 0;
  3416. ULONG ulSeed = 0;
  3417. switch (lTestNum)
  3418. {
  3419. case ( 100 ) :
  3420. {
  3421. hr = ILKBTEST_100(argc, argv) ;
  3422. break ;
  3423. }
  3424. case ( 101 ) :
  3425. {
  3426. hr = ILKBTEST_101(argc, argv) ;
  3427. break ;
  3428. }
  3429. case ( 102 ) :
  3430. {
  3431. hr = ILKBTEST_102(argc, argv) ;
  3432. break ;
  3433. }
  3434. case ( 103 ) :
  3435. {
  3436. hr = ILKBTEST_103(argc, argv) ;
  3437. break ;
  3438. }
  3439. case ( 104 ) :
  3440. {
  3441. hr = ILKBTEST_104(argc, argv) ;
  3442. break ;
  3443. }
  3444. case ( 105 ) :
  3445. {
  3446. hr = ILKBTEST_105(argc, argv) ;
  3447. break ;
  3448. }
  3449. case ( 106 ) :
  3450. {
  3451. hr = ILKBTEST_106(argc, argv) ;
  3452. break ;
  3453. }
  3454. case ( 107 ) :
  3455. {
  3456. hr = ILKBTEST_107(argc, argv) ;
  3457. break ;
  3458. }
  3459. case ( 108 ) :
  3460. {
  3461. // Obtain Seed from CommandLine
  3462. ulSeed = GetSeedFromCmdLineArgs(argc, argv);
  3463. hr = ILKBTEST_108(ulSeed) ;
  3464. break ;
  3465. }
  3466. default:
  3467. {
  3468. //
  3469. // Invalid test
  3470. //
  3471. DH_LOG((LOG_INFO,
  3472. TEXT("Invalid ILKBTEST test number: %ld"),
  3473. lTestNum) ) ;
  3474. }
  3475. }
  3476. return hr ;
  3477. }
  3478. //+-------------------------------------------------------------------
  3479. // Function: RunSingleFlatTest
  3480. //
  3481. // Synopsis: Runs single "FLATTEST" test.
  3482. //
  3483. // Arguments: [lTestNum]
  3484. // [argc]
  3485. // [argv]
  3486. //
  3487. // Returns: HRESULT
  3488. //
  3489. // History: 22-Jan-1998 BogdanT created
  3490. //--------------------------------------------------------------------
  3491. HRESULT RunSingleFlatTest(LONG lTestNum, int argc, char *argv[])
  3492. {
  3493. HRESULT hr = E_FAIL ;
  3494. int i = 0;
  3495. ULONG ulSeed = 0;
  3496. switch (lTestNum)
  3497. {
  3498. case ( 100 ) :
  3499. {
  3500. hr = FLATTEST_100(argc, argv) ;
  3501. break ;
  3502. }
  3503. case ( 101 ) :
  3504. {
  3505. hr = FLATTEST_101(argc, argv) ;
  3506. break ;
  3507. }
  3508. default:
  3509. {
  3510. //
  3511. // Invalid test
  3512. //
  3513. DH_LOG((LOG_INFO,
  3514. TEXT("Invalid FLATTEST test number: %ld"),
  3515. lTestNum) ) ;
  3516. }
  3517. }
  3518. return hr ;
  3519. }