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.

70 lines
1.6 KiB

  1. //
  2. // This file defines basic test structures
  3. // this should not contain any ts specific things.
  4. //
  5. #ifndef ___TST_H___
  6. #define ___TST_H___
  7. enum EResult
  8. {
  9. eFailed = 0,
  10. ePassed = 1,
  11. eUnknown= 2,
  12. eFailedToExecute = 4
  13. };
  14. typedef bool (PFN_SUITE_FUNC)();
  15. typedef TCHAR * (PFN_SuiteErrorReason)(void);
  16. typedef bool (PFN_BOOL)(void);
  17. typedef EResult (PFN_TEST_FUNC)(ostrstream &);
  18. typedef struct _TVerificationTest
  19. {
  20. UINT uiName;
  21. //char szTestName[256]; // descriptive name of the test
  22. PFN_BOOL *pfnNeedRunTest; // pointer to function that will be called to decide if the test need run, test is run if NULL.
  23. PFN_TEST_FUNC *pfnTestFunc;
  24. DWORD SuiteMask;
  25. UINT uiTestDetailsLocal;
  26. UINT uiTestDetailsRemote;
  27. char TestDetails[2048];
  28. } TVerificationTest, *PTVerificationTest;
  29. typedef struct _TTestSuite
  30. {
  31. LPCTSTR szSuiteName;
  32. PFN_SUITE_FUNC * pfnCanRunSuite;
  33. PFN_SuiteErrorReason * pfnSuiteErrorReason;
  34. DWORD dwTestCount;
  35. int * aiTests;
  36. } TTestSuite, *PTTestSuite;
  37. // to implement your test suites, derive from this class.
  38. class CTestData
  39. {
  40. public:
  41. CTestData() {};
  42. virtual ~CTestData() {};
  43. virtual DWORD GetSuiteCount () const = 0;
  44. virtual LPCTSTR GetSuiteName (DWORD dwSuite) const = 0 ;
  45. virtual DWORD GetTestCount (DWORD dwSuite) const = 0 ;
  46. virtual PTVerificationTest GetTest (DWORD dwSuite, DWORD iTestNumber) const = 0 ;
  47. };
  48. DWORD GetTotalTestCount ();
  49. PTVerificationTest GetTest (DWORD dwTestIndex);
  50. #endif // ___TST_H___