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.

601 lines
15 KiB

  1. // testdata.cpp
  2. #include "stdafx.h"
  3. #define ____InsideTestData____
  4. #include "testdata.h"
  5. #include "tstst.h"
  6. #include "resource.h"
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CTSDiagnosis
  9. enum ETSTestSuite
  10. {
  11. eFirstSuite = 0,
  12. eAllTestsSuite = 0,
  13. eGeneralInformation = 1,
  14. eCantConnect = 2,
  15. eCantPrint = 3,
  16. eCantCopyPaste = 4,
  17. eCantFileRedirect = 5,
  18. eCantLptRedirect = 6,
  19. eCantComRedirect = 7,
  20. eCantAudioRedirect = 8,
  21. eLastSuite = eCantAudioRedirect,
  22. eSuiteCount = eLastSuite + 1
  23. };
  24. const DWORD ALL_TEST_SUITE_MASK = (0x1 << eAllTestsSuite);
  25. const DWORD GENERAL_SUITE_MASK = (0x1 << eGeneralInformation);
  26. const DWORD CANT_CONNECT_SUITE_MASK = (0x1 << eCantConnect);
  27. const DWORD CANT_PRINT_SUITE_MASK = (0x1 << eCantPrint);
  28. const DWORD CANT_COPYPASTE_SUITE_MASK = (0x1 << eCantCopyPaste);
  29. const DWORD CANT_FILE_REDIRECT_SUITE_MASK = (0x1 << eCantFileRedirect);
  30. const DWORD CANT_LPT_REDIRECT_SUITE_MASK = (0x1 << eCantLptRedirect);
  31. const DWORD CANT_COM_REDIRECT_SUITE_MASK = (0x1 << eCantComRedirect);
  32. const DWORD CANT_AUDIO_REDIRECT_SUITE_MASK = (0x1 << eCantAudioRedirect);
  33. #define RemoteTABText "" \
  34. "<HTML>\n" \
  35. "<BODY>\n" \
  36. "<OBJECT id=TSDiag classid=clsid:50B5F461-FDC2-40D4-B2C5-1C2EE0CDA190></OBJECT>\n" \
  37. "Remote connections are disabled for this computer. To enable them, use <A href=javascript:ExecuteIt('control.exe%20sysdm.cpl,,5');>Remote Tab</A>\n" \
  38. "</BODY>\n" \
  39. "<SCRIPT LANGUAGE=javascript>\n" \
  40. "function ExecuteIt(str)\n" \
  41. "{\n" \
  42. "var tsdiagObject = new ActiveXObject(\"TSDiag.TSDiagnosis\");\n" \
  43. "tsdiagObject.ExecuteIt(str);\n" \
  44. "}\n" \
  45. "</SCRIPT>\n" \
  46. "</HTML>\n"
  47. #define GroupPolicyText "" \
  48. "<HTML>\n" \
  49. "<BODY>\n" \
  50. "<OBJECT id=TSDiag classid=clsid:50B5F461-FDC2-40D4-B2C5-1C2EE0CDA190></OBJECT>\n" \
  51. "Remote connections are disabled for this computer through Group Policy. you need to contact the administrator to set the right group policy. you can view current group policy configuration using <A href=javascript:ExecuteIt('gpedit.msc');>gpedit.msc</A>\n" \
  52. "</BODY>\n" \
  53. "<SCRIPT LANGUAGE=javascript>\n" \
  54. "function ExecuteIt(str)\n" \
  55. "{\n" \
  56. "var tsdiagObject = new ActiveXObject(\"TSDiag.TSDiagnosis\");\n" \
  57. "tsdiagObject.ExecuteIt(str);\n" \
  58. "}\n" \
  59. "</SCRIPT>\n" \
  60. "</HTML>\n"
  61. #define ServiceStartTypeProblemsText "" \
  62. "<HTML>\n" \
  63. "<BODY>\n" \
  64. "<OBJECT id=TSDiag classid=clsid:50B5F461-FDC2-40D4-B2C5-1C2EE0CDA190></OBJECT>\n" \
  65. "Terminal Server service Start Type is wrong on this computer. In order to work properly start Type for Terminal server must be Manual Start. If this test fails, to correct this problem open <A href=javascript:ExecuteIt('services.msc');>Services snapin</A> and change Terminal Services Service Start Type to manual start.\n" \
  66. "</BODY>\n" \
  67. "<SCRIPT LANGUAGE=javascript>\n" \
  68. "function ExecuteIt(str)\n" \
  69. "{\n" \
  70. "var tsdiagObject = new ActiveXObject(\"TSDiag.TSDiagnosis\");\n" \
  71. "tsdiagObject.ExecuteIt(str);\n" \
  72. "}\n" \
  73. "</SCRIPT>\n" \
  74. "</HTML>\n"
  75. #define ServiceContextTypeProblemsText "" \
  76. "<HTML>\n" \
  77. "<BODY>\n" \
  78. "<OBJECT id=TSDiag classid=clsid:50B5F461-FDC2-40D4-B2C5-1C2EE0CDA190></OBJECT>\n" \
  79. "Terminal Server service must be in the system context to work properly. If this test fails, use the <A href=javascript:ExecuteIt('services.msc');>Services snapin</A> to change the Terminal Server service to use System Account." \
  80. "</BODY>\n" \
  81. "<SCRIPT LANGUAGE=javascript>\n" \
  82. "function ExecuteIt(str)\n" \
  83. "{\n" \
  84. "var tsdiagObject = new ActiveXObject(\"TSDiag.TSDiagnosis\");\n" \
  85. "tsdiagObject.ExecuteIt(str);\n" \
  86. "}\n" \
  87. "</SCRIPT>\n" \
  88. "</HTML>\n"
  89. TVerificationTest theTests[] =
  90. {
  91. {IDS_MACHINENAME,
  92. NULL,
  93. GetCompName,
  94. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  95. IDS_MACHINENAME_FAILED,
  96. 0},
  97. {IDS_DOMAINNAME,
  98. NULL,
  99. GetDomName,
  100. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  101. IDS_DOMAINNAME_FAILED,
  102. 0
  103. },
  104. {IDS_IP_ADDRESS,
  105. NULL,
  106. GetIPAddress,
  107. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  108. IDS_IP_ADDRESS_FAILED,
  109. 0},
  110. {IDS_PRODUCTTYPE,
  111. IsItLocalMachine,
  112. GetProductType,
  113. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  114. IDS_PRODUCTTYPE_FAILED,
  115. 0},
  116. {IDS_PRODUCTSUITE,
  117. IsItLocalMachine,
  118. GetProductSuite,
  119. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  120. IDS_PRODUCTSUITE_FAILED,
  121. 0},
  122. {IDS_TSVERSION,
  123. NULL,
  124. GetTSVersion,
  125. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  126. IDS_TSVERSION_FAILED,
  127. 0},
  128. {IDS_ISSERVER,
  129. IsIt50TS,
  130. IsItServer,
  131. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  132. IDS_ISSERVER_FAILED,
  133. 0},
  134. {IDS_CLIENT_VERSION,
  135. AreWeInsideSession,
  136. GetClientVersion,
  137. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  138. IDS_CLIENT_VERSION_FAILED,
  139. 0},
  140. {IDS_SESSION_USERNAME,
  141. AreWeInsideSession,
  142. GetUserName,
  143. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  144. IDS_SESSION_USERNAME_FAILED,
  145. 0},
  146. {IDS_IS_TSOCLOG_PRESENT,
  147. IsUserRemoteAdmin,
  148. IsTSOClogPresent,
  149. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  150. IDS_IS_TSOCLOG_PRESENT_FAILED,
  151. 0},
  152. {IDS_DID_SETUP_FINISH,
  153. IsTSOClogPresent,
  154. DidTsOCgetCompleteInstallationMessage,
  155. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  156. IDS_DID_SETUP_FINISH_FAILED,
  157. 0},
  158. {IDS_CLUSTERING_INSTALLED,
  159. IsIt50TS,
  160. IsClusteringInstalled,
  161. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  162. IDS_CLUSTERING_INSTALLED_FAILED,
  163. 0},
  164. {IDS_IS_TSPRODUCT,
  165. IsItServer,
  166. DoesProductSuiteContainTS,
  167. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  168. IDS_IS_TSPRODUCT_FAILED,
  169. 0},
  170. {IDS_DID_OCM_INSTALL_TS,
  171. IsIt50TS,
  172. DidOCMInstallTSEnable,
  173. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  174. IDS_DID_OCM_INSTALL_TS_FAILED,
  175. 0},
  176. {IDS_IS_TS_ENABLED,
  177. NULL,
  178. TSEnabled,
  179. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  180. IDS_IS_TS_ENABLED_FAILED,
  181. 0},
  182. {IDS_IS_KERNEL_TSENABLED,
  183. IsItLocalServer,
  184. IsKernelTSEnable,
  185. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  186. IDS_IS_KERNEL_TSENABLED_FAILED,
  187. 0},
  188. {IDS_IS_TSREGISTRY_OK,
  189. NULL,
  190. IsTerminalServerRegistryOk,
  191. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  192. IDS_IS_TSREGISTRY_OK_FAILED,
  193. 0},
  194. {IDS_WINSTATIONS_OK,
  195. NULL,
  196. GetWinstationList,
  197. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK | GENERAL_SUITE_MASK,
  198. IDS_WINSTATIONS_OK_FAILED,
  199. 0},
  200. {IDS_IS_TERMSRV_RUNNING,
  201. NULL,
  202. IsTerminalServiceRunning,
  203. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  204. IDS_IS_TERMSRV_RUNNING_FAILED,
  205. 0},
  206. {IDS_IS_TS_STARTBIT_OK,
  207. IsUserRemoteAdmin,
  208. IsTerminalServiceStartBitSet,
  209. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  210. IDS_IS_TS_STARTBIT_OK_FAILED,
  211. 0},
  212. {IDS_IS_TS_IN_SYSTEM_CONTEXT,
  213. IsUserRemoteAdmin,
  214. IsTermSrvInSystemContext,
  215. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  216. IDS_IS_TS_IN_SYSTEM_CONTEXT_FAILED,
  217. 0},
  218. {IDS_IS_LISTNER_PRESENT,
  219. IsTerminalServiceRunning,
  220. IsListenerSessionPresent,
  221. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  222. IDS_IS_LISTNER_PRESENT_FAILED,
  223. 0},
  224. {IDS_REMOTELOGON_ENABLED,
  225. NULL,
  226. AreRemoteLogonEnabled,
  227. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  228. IDS_REMOTELOGON_ENABLED_FAILED,
  229. 0},
  230. {IDS_REMOTE_CONNECTION_GP,
  231. IsIt51TS,
  232. IsGroupPolicyOk,
  233. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  234. IDS_REMOTE_CONNECTION_GP_FAILED,
  235. 0},
  236. {IDS_REMOTE_CONNECTION_LOCAL,
  237. IsIt51TS,
  238. AreConnectionsAllowed,
  239. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  240. IDS_REMOTE_CONNECTION_LOCAL_FAILED,
  241. 0},
  242. {IDS_RDPDR_INSTALLED,
  243. IsItLocalMachine,
  244. IsRdpDrInstalledProperly,
  245. ALL_TEST_SUITE_MASK | CANT_PRINT_SUITE_MASK,
  246. IDS_RDPDR_INSTALLED_FAILED,
  247. 0},
  248. {IDS_RDPNP_INSTALLED,
  249. IsIt51TS,
  250. IsRDPNPinNetProviders,
  251. ALL_TEST_SUITE_MASK | CANT_FILE_REDIRECT_SUITE_MASK,
  252. IDS_RDPNP_INSTALLED_FAILED,
  253. 0},
  254. {IDS_MULTIPAL_CONNECTION_ALLOWED,
  255. IsIt51TS,
  256. IsMultiConnectionAllowed,
  257. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK,
  258. IDS_MULTIPAL_CONNECTION_ALLOWED_FAILED,
  259. 0},
  260. {IDS_LOGON_UI,
  261. IsIt51TS,
  262. LogonType,
  263. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK,
  264. IDS_LOGON_UI_FAILED,
  265. 0},
  266. /*
  267. {"Are Video keys setup right?................",
  268. NULL,
  269. CheckVideoKeys,
  270. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK,
  271. "Just another setup test." },
  272. */
  273. {IDS_TS_MODE,
  274. NULL,
  275. GetTSMode,
  276. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK,
  277. IDS_TS_MODE_FAILED,
  278. 0},
  279. {IDS_IS_MODE_REGISTRYOK,
  280. NULL,
  281. VerifyModeRegistry,
  282. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK,
  283. IDS_IS_MODE_REGISTRYOK_FAILED,
  284. 0},
  285. {IDS_PERM_MODE,
  286. NULL,
  287. GetModePermissions,
  288. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK,
  289. IDS_PERM_MODE_FAILED,
  290. 0},
  291. {IDS_STACK_BINARIES_SIGNED,
  292. IsItLocalMachine,
  293. Check_StackBinSigatures,
  294. ALL_TEST_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  295. IDS_STACK_BINARIES_SIGNED_FAILED,
  296. 0},
  297. {IDS_ENCRYPTION_LEVEL,
  298. IsUserRemoteAdmin,
  299. GetCypherStrenthOnRdpwd,
  300. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  301. IDS_ENCRYPTION_LEVEL_FAILED,
  302. 0},
  303. {IDS_IS_BETA_SYSTEM,
  304. IsItLocalMachine,
  305. IsBetaSystem,
  306. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  307. IDS_IS_BETA_SYSTEM_FAILED,
  308. 0},
  309. {IDS_GRACE_PERIOD_OK,
  310. IsItLocalMachine,
  311. HasLicenceGracePeriodExpired,
  312. ALL_TEST_SUITE_MASK | GENERAL_SUITE_MASK | CANT_CONNECT_SUITE_MASK,
  313. IDS_GRACE_PERIOD_OK_FAILED,
  314. 0},
  315. {IDS_CLIENT_SUPPORT_AUDIO,
  316. AreWeInsideSession,
  317. DoesClientSupportAudioRedirection,
  318. ALL_TEST_SUITE_MASK | CANT_AUDIO_REDIRECT_SUITE_MASK,
  319. IDS_CLIENT_SUPPORT_AUDIO_FAILED,
  320. 0},
  321. {IDS_CLIENT_SUPPORT_PRINTER,
  322. AreWeInsideSession,
  323. DoesClientSupportPrinterRedirection,
  324. ALL_TEST_SUITE_MASK | CANT_PRINT_SUITE_MASK,
  325. IDS_CLIENT_SUPPORT_PRINTER_FAILED,
  326. 0},
  327. {IDS_CLIENT_SUPPORT_FILE,
  328. AreWeInsideSession,
  329. DoesClientSupportFileRedirection ,
  330. ALL_TEST_SUITE_MASK | CANT_FILE_REDIRECT_SUITE_MASK,
  331. IDS_CLIENT_SUPPORT_FILE_FAILED,
  332. 0},
  333. {IDS_CLIENT_SUPPORT_CLIPBOARD,
  334. AreWeInsideSession,
  335. DoesClientSupportClipboardRedirection,
  336. ALL_TEST_SUITE_MASK | CANT_COPYPASTE_SUITE_MASK,
  337. IDS_CLIENT_SUPPORT_CLIPBOARD_FAILED,
  338. 0},
  339. {IDS_TERMSRV_CONFIG_PRINTER,
  340. AreWeInsideSession,
  341. CanRedirectPrinter,
  342. ALL_TEST_SUITE_MASK | CANT_PRINT_SUITE_MASK,
  343. IDS_TERMSRV_CONFIG_PRINTER_FAILED,
  344. 0},
  345. {IDS_TERMSRV_CONFIG_AUDIO,
  346. AreWeInsideSession,
  347. CanRedirectAudio,
  348. ALL_TEST_SUITE_MASK | CANT_AUDIO_REDIRECT_SUITE_MASK,
  349. IDS_TERMSRV_CONFIG_AUDIO_FAILED,
  350. 0},
  351. {IDS_TERMSRV_CLIENT_AUDIO_ENABLED,
  352. IsAudioEnabled,
  353. CanClientPlayAudio,
  354. ALL_TEST_SUITE_MASK | CANT_AUDIO_REDIRECT_SUITE_MASK,
  355. IDS_TERMSRV_CLIENT_AUDIO_ENABLED_FAILED,
  356. 0},
  357. {IDS_TERMSRV_CLIENT_AUDIO_SETTINGS,
  358. IsItRemoteConsole,
  359. NotConsoleAudio,
  360. ALL_TEST_SUITE_MASK | CANT_AUDIO_REDIRECT_SUITE_MASK,
  361. IDS_TERMSRV_CLIENT_AUDIO_SETTINGS_FAILED,
  362. 0},
  363. {IDS_TERMSRV_CONFIG_COM,
  364. AreWeInsideSession,
  365. CanRedirectCom,
  366. ALL_TEST_SUITE_MASK | CANT_COM_REDIRECT_SUITE_MASK,
  367. IDS_TERMSRV_CONFIG_COM_FAILED,
  368. 0},
  369. {IDS_TERMSRV_CONFIG_CLIPBOARD,
  370. AreWeInsideSession,
  371. CanRedirectClipboard,
  372. ALL_TEST_SUITE_MASK | CANT_COPYPASTE_SUITE_MASK,
  373. IDS_TERMSRV_CONFIG_CLIPBOARD_FAILED,
  374. 0},
  375. {IDS_TERMSRV_CONFIG_FILE,
  376. AreWeInsideSession,
  377. CanRedirectDrives,
  378. ALL_TEST_SUITE_MASK | CANT_FILE_REDIRECT_SUITE_MASK,
  379. IDS_TERMSRV_CONFIG_FILE_FAILED,
  380. 0},
  381. {IDS_TERMSRV_CONFIG_LPT,
  382. AreWeInsideSession,
  383. CanRedirectLPT,
  384. ALL_TEST_SUITE_MASK | CANT_LPT_REDIRECT_SUITE_MASK,
  385. IDS_TERMSRV_CONFIG_LPT_FAILED,
  386. 0},
  387. };
  388. TTestSuite m_pSuites[eSuiteCount] =
  389. {
  390. {_T("All Tests"), CanRunAllTests, WhyCantRunAllTests, 0, NULL},
  391. {_T("General Information"), CanRunGeneralInfo, WhyCantRunGeneralInfo, 0, NULL},
  392. {_T("Cant Connect"), CanRunCantConnect, WhyCantRunCantConnect, 0, NULL},
  393. {_T("Cant Print"), CanRunCantPrint, WhyCantRunCantPrint, 0, NULL},
  394. {_T("eCantCopyPaste"), CanRunCantCopyPaste, WhyCantRunCantCopyPaste, 0, NULL},
  395. {_T("eCantFileRedirect"), CanRunFileRedirect, WhyCantRunFileRedirect, 0, NULL},
  396. {_T("eCantLptRedirect"), CanRunLptRedirect, WhyCantRunLptRedirect, 0, NULL},
  397. {_T("eCantComRedirect"), CanRunComRedirect, WhyCantRunComRedirect, 0, NULL},
  398. {_T("eCantAudioRedirect"), CanRunAudioRedirect, WhyCantRunAudioRedirect, 0, NULL}
  399. };
  400. CTSTestData::CTSTestData()
  401. {
  402. // generate the test database for suites.
  403. m_lpMachineName = NULL;
  404. for (DWORD dwSuite = 0; dwSuite < eSuiteCount; dwSuite++)
  405. {
  406. // get the test count for this suite.
  407. DWORD dwThisSuiteMask = 0x1 << dwSuite;
  408. m_pSuites[dwSuite].dwTestCount = 0;
  409. for (DWORD dwTest = 0; dwTest < sizeof(theTests) / sizeof(theTests[0]); dwTest++)
  410. {
  411. // if this test is for the given suite.
  412. if (theTests[dwTest].SuiteMask & dwThisSuiteMask)
  413. {
  414. m_pSuites[dwSuite].dwTestCount++;
  415. }
  416. }
  417. if (m_pSuites[dwSuite].dwTestCount > 0)
  418. {
  419. m_pSuites[dwSuite].aiTests = new int[m_pSuites[dwSuite].dwTestCount];
  420. }
  421. //
  422. // now fill up the test array with test indexes.
  423. //
  424. for (DWORD dwTest = 0, dwTestIndex = 0; dwTest < sizeof(theTests) / sizeof(theTests[0]); dwTest++)
  425. {
  426. // if this test is for the given suite.
  427. if (theTests[dwTest].SuiteMask & dwThisSuiteMask)
  428. {
  429. ASSERT(dwTestIndex < m_pSuites[dwSuite].dwTestCount);
  430. m_pSuites[dwSuite].aiTests[dwTestIndex] = dwTest;
  431. dwTestIndex++;
  432. }
  433. }
  434. }
  435. }
  436. CTSTestData::~CTSTestData()
  437. {
  438. for (DWORD dwSuite = 0; dwSuite < eSuiteCount; dwSuite++)
  439. {
  440. if (m_pSuites[dwSuite].aiTests)
  441. delete [] m_pSuites[dwSuite].aiTests;
  442. }
  443. if (m_lpMachineName)
  444. delete [] m_lpMachineName;
  445. }
  446. DWORD CTSTestData::GetSuiteCount () const
  447. {
  448. return eSuiteCount;
  449. }
  450. LPCTSTR CTSTestData::GetSuiteName (DWORD dwSuite) const
  451. {
  452. return m_pSuites[dwSuite].szSuiteName;
  453. }
  454. DWORD CTSTestData::GetTestCount (DWORD dwSuite) const
  455. {
  456. ASSERT(m_pSuites);
  457. ASSERT( dwSuite < GetSuiteCount() );
  458. return m_pSuites[dwSuite].dwTestCount;
  459. }
  460. PTVerificationTest CTSTestData::GetTest (DWORD dwSuite, DWORD dwTestNumber) const
  461. {
  462. ASSERT(m_pSuites);
  463. ASSERT( dwSuite < GetSuiteCount() );
  464. ASSERT( dwTestNumber < GetTestCount(dwSuite) );
  465. return &(theTests[m_pSuites[dwSuite].aiTests[dwTestNumber]]);
  466. }
  467. LPTSTR CTSTestData::m_lpMachineName = NULL;
  468. BOOL CTSTestData::SetMachineName (LPCTSTR lpMachineName)
  469. {
  470. if (m_lpMachineName)
  471. {
  472. delete [] m_lpMachineName;
  473. m_lpMachineName = NULL;
  474. }
  475. if (lpMachineName && _tcslen(lpMachineName) > 1)
  476. {
  477. m_lpMachineName = new TCHAR[_tcslen(lpMachineName) + 1 + 2];
  478. if (!m_lpMachineName)
  479. {
  480. return FALSE;
  481. }
  482. _tcscpy(m_lpMachineName, _T("\\\\"));
  483. _tcscat(m_lpMachineName, lpMachineName);
  484. }
  485. return TRUE;
  486. }
  487. LPCTSTR CTSTestData::GetMachineNamePath ()
  488. {
  489. return m_lpMachineName;
  490. }
  491. LPCTSTR CTSTestData::GetMachineName ()
  492. {
  493. if (m_lpMachineName)
  494. return m_lpMachineName + 2;
  495. else
  496. return NULL;
  497. }
  498. bool CTSTestData::CanExecuteSuite (DWORD dwSuite) const
  499. {
  500. ASSERT(m_pSuites);
  501. ASSERT( dwSuite < GetSuiteCount() );
  502. return (*m_pSuites[dwSuite].pfnCanRunSuite)();
  503. }
  504. LPCTSTR CTSTestData::GetSuiteErrorText (DWORD dwSuite) const
  505. {
  506. ASSERT(m_pSuites);
  507. ASSERT( dwSuite < GetSuiteCount() );
  508. ASSERT(!CanExecuteSuite(dwSuite));
  509. return (*m_pSuites[dwSuite].pfnSuiteErrorReason)();
  510. }