Share via


CWTTLogger::Assert method

The Assert method checks the specified condition and, if the condition is false, fails the test case unless a trace is logged or the user specifically declares the test case to be skipped.

Syntax

HRESULT Assert(
  BOOL fCondition,
  LPWSTR pwszFile,
  UINT uiLine,
  LPWSTR pwszAssertMsg,
  LONG hDevice
);

Parameters

  • fCondition
    [in] A Boolean value that specifies whether the method should prevent the test case from failing if the bug trace is not logged. If this parameter is true, Assert prevents the test case from failing if the bug trace is not logged. If this parameter is false, Assert fails the test case unless the bug trace is logged.

  • pwszFile
    [in] The name of the source file where the assert happened.

  • uiLine
    [in] The line number within the source file where the assert happened.

  • pwszAssertMsg
    [in] The text message of the assertion.

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

Return value

Assert returns one of the following values:

Return code Description
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.

 

Requirements

Header

Wttlogger.h

Library

Library:WTTLog.dll

See also

CWTTLogger Class (C++)

CWTTLogger::Trace

 

 

Build date: 9/14/2012