Source code of Windows XP (NT5)
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.

155 lines
3.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: letests.cpp
  7. //
  8. // Contents: upper layer tests
  9. //
  10. // Classes:
  11. //
  12. // Functions: LETest1
  13. //
  14. // History: dd-mmm-yy Author Comment
  15. // 06-Feb-94 alexgo author
  16. //
  17. //--------------------------------------------------------------------------
  18. #include "oletest.h"
  19. #include "letest.h"
  20. // Test1 information
  21. SLETestInfo letiInsertObjectTest1 = { "simpdnd", WM_TEST1 };
  22. SLETestInfo letiInplaceTest1 = { "simpcntr", WM_TEST1 };
  23. SLETestInfo letiOle1Test1 = { "simpdnd", WM_TEST2 };
  24. // Test2 information
  25. SLETestInfo letiInsertObjectTest2 = { "spdnd16", WM_TEST1 };
  26. SLETestInfo letiOle1Test2 = { "spdnd16", WM_TEST2 };
  27. //+-------------------------------------------------------------------------
  28. //
  29. // Function: LETestCallback
  30. //
  31. // Synopsis: generic callback function for running L&E tests.
  32. //
  33. // Effects:
  34. //
  35. // Arguments: pvArg -- the test message to send to the app
  36. //
  37. // Requires:
  38. //
  39. // Returns: void
  40. //
  41. // Signals:
  42. //
  43. // Modifies:
  44. //
  45. // Algorithm: Create the process and wait for it to finish. The exit
  46. // status is then returned.
  47. //
  48. // History: dd-mmm-yy Author Comment
  49. // 06-Feb-94 alexgo author
  50. // Notes:
  51. //
  52. //--------------------------------------------------------------------------
  53. void LETestCallback( void *pvArg )
  54. {
  55. //the test app (simpdnd) should have just sent us a WM_TESTREG message.
  56. assert(vApp.m_message == WM_TESTREG);
  57. vApp.m_rgTesthwnd[0] = (HWND)vApp.m_wparam;
  58. //now tell the app to start the requested test
  59. OutputString( "Tell LETest to Start\r\n");
  60. PostMessage(vApp.m_rgTesthwnd[0], (UINT)pvArg, 0, 0);
  61. return;
  62. }
  63. //+-------------------------------------------------------------------------
  64. //
  65. // Function: LETest1
  66. //
  67. // Synopsis: Runs the app specified in the argument
  68. //
  69. // Effects:
  70. //
  71. // Arguments: pvArg -- unused
  72. //
  73. // Requires:
  74. //
  75. // Returns: void
  76. //
  77. // Signals:
  78. //
  79. // Modifies:
  80. //
  81. // Algorithm: Create the process and wait for it to finish. The exit
  82. // status is then returned.
  83. //
  84. // History: dd-mmm-yy Author Comment
  85. // 06-Feb-94 alexgo author
  86. // Notes:
  87. //
  88. //--------------------------------------------------------------------------
  89. void LETest1( void *pvArg )
  90. {
  91. SLETestInfo *pleti = (SLETestInfo *) pvArg;
  92. #ifdef WIN32
  93. PROCESS_INFORMATION procinfo;
  94. static STARTUPINFO startinfo; //to make it all zero
  95. char szBuf[128];
  96. //initialize the command line
  97. sprintf(szBuf, "%s%s -driver %lu",
  98. vApp.m_pszDebuggerOption,
  99. pleti->pszPgm,
  100. vApp.m_hwndMain);
  101. startinfo.cb = sizeof(startinfo);
  102. if( CreateProcess(NULL, szBuf, NULL, NULL, NULL, NULL, NULL,
  103. NULL, &startinfo, &procinfo) )
  104. {
  105. //simpdnd launched, stuff a callback function in the stack
  106. vApp.m_TaskStack.Push(LETestCallback,
  107. (void *)((ULONG)pleti->dwMsgId));
  108. }
  109. else
  110. {
  111. vApp.m_wparam = TEST_FAILURE;
  112. vApp.m_lparam = (LPARAM)GetLastError();
  113. vApp.m_message = WM_TESTEND;
  114. HandleTestEnd();
  115. }
  116. return;
  117. #else
  118. // 16bit Version!!
  119. vApp.m_wparam = TEST_SUCCESS;
  120. vApp.m_lparam = 0;
  121. vApp.m_message = WM_TESTEND;
  122. HandleTestEnd();
  123. return;
  124. #endif // WIN32
  125. }