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.

125 lines
2.6 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993.
  5. //
  6. // File: bm_props.cxx
  7. //
  8. // Contents: Ole properties test
  9. //
  10. // Classes: COlePropertyTest
  11. //
  12. // History: 22-July-93 t-martig Created
  13. //
  14. //--------------------------------------------------------------------------
  15. #include <headers.cxx>
  16. #pragma hdrstop
  17. #include <bm_props.hxx>
  18. #include <oletest.hxx>
  19. DEFINE_OLEGUID(CLSID_TestProp, 0x20730722, 1, 8); // CT Test GUID
  20. TCHAR *COlePropertyTest::Name ()
  21. {
  22. return TEXT("Properties");
  23. }
  24. SCODE COlePropertyTest::Setup (CTestInput *pInput)
  25. {
  26. CTestBase::Setup(pInput);
  27. SCODE sc = InitOLE();
  28. if (FAILED(sc))
  29. {
  30. Log (TEXT("Setup - OleInitialize failed."), sc);
  31. return sc;
  32. }
  33. m_ulIterations = 0;
  34. return S_OK;
  35. }
  36. SCODE COlePropertyTest::Cleanup ()
  37. {
  38. UninitOLE();
  39. return S_OK;
  40. }
  41. SCODE COlePropertyTest::Run ()
  42. {
  43. /**** BUGBUG: these tests currently do nothing
  44. CStopWatch sw;
  45. IStorage *pIS;
  46. IDispatch *pID;
  47. COleTestClass unk;
  48. VARIANTARG avararg[2];
  49. DISPPARAMS dispparams = {avararg, NULL, 2, 0};
  50. VARIANT varResult;
  51. EXCEPINFO excepinfo;
  52. UINT ierr;
  53. // Create storage
  54. if (FAILED(StgCreateDocfile (TEXT("C:\\DUMP.BM"), STGM_CREATE |
  55. STGM_DELETEONRELEASE, 0, &pIS)))
  56. return E_FAIL;
  57. sw.Reset ();
  58. if (FAILED(CoCreatePropSetStg (pIS, CLSID_TestProp, &unk, STGM_READWRITE |
  59. STGM_SHARE_EXCLUSIVE, NULL, (IUnknown**)&pID)))
  60. {
  61. pIS->Release ();
  62. return E_FAIL;
  63. }
  64. ulCreate = sw.Read ();
  65. pID->QueryInterface (IID_IDispatch, (void**)&pID);
  66. VariantInit(avararg + 1);
  67. avararg[1].vt = VT_LPWSTR;
  68. avararg[1].pwszVal = L"CairOLE";
  69. VariantInit(avararg + 0);
  70. avararg[0].vt = VT_LPWSTR;
  71. avararg[0].pwszVal = L"TooSlow";
  72. sw.Reset ();
  73. if (FAILED(pID->Invoke(DISPID_ADDPROP, CLSID_TestProp, 0,
  74. DISPATCH_METHOD, &dispparams, &varResult, &excepinfo, &ierr)))
  75. {
  76. pIS->Release ();
  77. return E_FAIL;
  78. }
  79. ulAdd = sw.Read ();
  80. pIS->Release ();
  81. ****/
  82. return S_OK;
  83. }
  84. SCODE COlePropertyTest::Report (CTestOutput &output)
  85. {
  86. output.WriteSectionHeader (Name(), TEXT("Properties"), *m_pInput);
  87. /**** BUGBUG: disable
  88. output.WriteResult (TEXT("Create property set"), ulCreate);
  89. output.WriteResult (TEXT("Add property"), ulAdd);
  90. output.WriteResult (TEXT("Set property"), ulSet);
  91. output.WriteResult (TEXT("Get property"), ulGet);
  92. output.WriteResult (TEXT("Delete property"), ulDelete);
  93. ****/
  94. return S_OK;
  95. }