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.

100 lines
3.4 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993.
  5. //
  6. // File: bm_stg.hxx
  7. //
  8. // Contents: test class definition
  9. //
  10. // Classes: CStorageTest
  11. //
  12. // Functions:
  13. //
  14. // History: 03-June-94 t-vadims Created
  15. //
  16. //--------------------------------------------------------------------------
  17. #ifndef _BM_STG_HXX_
  18. #define _BM_STG_HXX_
  19. #include <bm_base.hxx>
  20. #define MAX_REPS 100 // max repetions on write/read
  21. #define MAX_READS 100 // maximum number of total diferent reads/writes
  22. // considering reps and diferent size
  23. class CStorageTest : public CTestBase
  24. {
  25. public:
  26. virtual TCHAR *Name ();
  27. virtual SCODE Setup (CTestInput *input);
  28. virtual SCODE Run ();
  29. virtual SCODE Report (CTestOutput &OutputFile);
  30. virtual SCODE Cleanup ();
  31. private:
  32. void InitTimings();
  33. ULONG m_ulIterations;
  34. // general storage API timings
  35. ULONG m_ulIsStorageFileYES[TEST_MAX_ITERATIONS];
  36. ULONG m_ulIsStorageFileNO[TEST_MAX_ITERATIONS];
  37. ULONG m_ulStgOpenStorageDRFAIL[TEST_MAX_ITERATIONS];
  38. // Storage file read/write timings
  39. ULONG m_ulStgCreateDocfile[TEST_MAX_ITERATIONS];
  40. ULONG m_ulCreateStream[TEST_MAX_ITERATIONS];
  41. ULONG m_ulSetSize[TEST_MAX_ITERATIONS];
  42. ULONG m_ulStreamWrite[MAX_READS][TEST_MAX_ITERATIONS];
  43. ULONG m_ulStreamWriteTotal[TEST_MAX_ITERATIONS];
  44. ULONG m_ulStreamRelease1[TEST_MAX_ITERATIONS];
  45. ULONG m_ulStorageCommit[TEST_MAX_ITERATIONS];
  46. ULONG m_ulStorageRelease1[TEST_MAX_ITERATIONS];
  47. ULONG m_ulStgOpenStorage[TEST_MAX_ITERATIONS];
  48. ULONG m_ulOpenStream[TEST_MAX_ITERATIONS];
  49. ULONG m_ulStreamRead[MAX_READS][TEST_MAX_ITERATIONS];
  50. ULONG m_ulStreamReadTotal[TEST_MAX_ITERATIONS];
  51. ULONG m_ulStreamSeek[MAX_READS][TEST_MAX_ITERATIONS];
  52. ULONG m_ulStreamSeekTotal[TEST_MAX_ITERATIONS];
  53. ULONG m_ulStreamRelease2[TEST_MAX_ITERATIONS];
  54. ULONG m_ulStorageRelease2[TEST_MAX_ITERATIONS];
  55. // timings for my special ole32.dll with internal timing
  56. ULONG m_ulActualWrite[MAX_READS][TEST_MAX_ITERATIONS];
  57. ULONG m_ulActualRead[MAX_READS][TEST_MAX_ITERATIONS];
  58. ULONG m_ulActualFlush1[TEST_MAX_ITERATIONS];
  59. ULONG m_ulActualFlush2[TEST_MAX_ITERATIONS];
  60. ULONG m_ulActualCommitW[TEST_MAX_ITERATIONS];
  61. ULONG m_ulTotal[2][TEST_MAX_ITERATIONS];
  62. BYTE *m_pbData; // data to be written to file
  63. OLECHAR m_pwszFile[MAX_PATH]; // file name for ole
  64. TCHAR m_pszFile[MAX_PATH]; // file name for WIN32
  65. TCHAR m_pszFileMode[15]; // file access mode (TRANSACTED/DIRECTED)
  66. TCHAR m_pszReadMode[15]; // read mode (RANDOM/SEQUENTIAL)
  67. ULONG m_flStgCreateFlags; // file creation flags for StgCreateDocfile
  68. // (STGM_TRANSACTED or STGM_DIRECT)
  69. ULONG m_iStartSize; // start size of data to be written
  70. ULONG m_iEndSize; // end size of data
  71. ULONG m_ulTotalSize; // total size of the file
  72. ULONG m_iRepeatFactor; // Number of writes for each size.
  73. ULONG m_ulNumSizes; // number of diferent write sizes
  74. BOOL m_bSequentialRead; // flage for Sequential and Random read
  75. BOOL m_bDoSetSize;
  76. LPMALLOC m_piMalloc; // point to task malloc interface
  77. };
  78. #endif