CWTTLogger::EndTestEx

The EndTestEx method traces the end of a test case and enables you to specify a GUID-based test ID and a test hierarchy.

HRESULT EndTestEx (
  DWORD dwResult,
  LPWSTR  pwszTUID,
  LPWSTR  pwszTestName,
  LPWSTR  pwszParentTUID,
  LPWSTR  pwszParentTestName,
  LONG  hDevice
);

Parameters

dwResult

[in] The test case result. This parameter must be one of the following values:

  • WTT_TESTCASE_RESULT_PASS
    This value does not guarantee that the logger will log the test case as passed. If traces are logged that indicate an error, a warning, or so on, the logger automatically overrides this value.
  • WTT_TESTCASE_RESULT_WARN
    This value does not guarantee that the logger will log the test case as warned. If traces are logged that indicate an error or so on, the logger automatically overrides this value.
  • WTT_TESTCASE_RESULT_FAIL
    This value does not guarantee that the logger will log the test case as failed. If traces are logged that indicate a bug or if no error trace is logged, the logger automatically overrides this value.
  • WTT_TESTCASE_RESULT_BLOCKED
    This value guarantees that the logger will log the test case as blocked.
  • WTT_TESTCASE_RESULT_SKIPPED
    This value guarantees that the logger will log the test case as skipped.

pwszTUID

[in] The globally unique identifier (GUID) for the test case.

pwszTestName

[in] The name of the test case.

pwszParentTUID

[in] The GUID for the parent test case.

pwszParentTestName

[in] The name of the parent test case.

hDevice

[in] A handle to the device tracing topology. You can combine multiple handles by using the bitwise OR operator (for example, hDevice1 OR hDevice2).

Return Value

EndTestEx returns one of the following values:

  • S_OK
    The operation was successful.
  • S_FALSE
    The operation was successful but the last device has been detached, which has triggered a rollup.
  • HRESULT
    The operation failed. You should use the FAILED macro to check HRESULT values.

Example

The following code example demonstrates how to use the EndTestEx method.

Log.StartTestEx ( 
   L"b55de776-ea89-4dbe-9abd-df2041040cd7",  // GUID of the test case
   L"This is a sample test,"                 // Optional test case name,
   WTTLOG_TESTCASE_TYPE_NOPARENT,            // This test case is an independent test case
   NULL,                                     // GUID of the parent test case
   NULL,                                     // Optional name of the parent test case
   hDevice
);

Log.EndTestEx (
   WTT_TESTCASE_RESULT_PASS,                 // Test case result
   L"b55de776-ea89-4dbe-9abd-df2041040cd7",  // GUID of the test case
   L"This is a sample test",                 // Optional test case name,
   NULL,                                     // GUID of the parent test case
   NULL,                                     // Optional name of the parent test case
   hDevice
);

Requirements

Headers: Wttlogger.h

Library: WTTLog.dll

See Also

CWTTLogger Class (C++), CWTTLogger::EndTest, CWTTLogger::StartTestEx

Send feedback on this topic
Built on December 10, 2009