Share via


WTTLogAssert

The WTTLogAssert function checks the specified condition and, if the condition is false, fails the test case unless a trace is logged or you specifically declare the test case to be skipped.

HRESULT WTTLogAssert ( 
  LONG  hDevice,
  BOOL  fCondition,
  LPWSTR  pwszFile,
  UINT  uiLine,
  LPWSTR  pwszUserMsg
);

Parameters

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).

fCondition

[in] A Boolean value that specifies whether the function should prevent the test case from failing if the bug trace is not logged. If this parameter is true, the function prevents the test case from failing if the bug trace is not logged. If this parameter is false, the function 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.

pwszUserMsg

[in] The text message of the assertion.

Return Value

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.

Requirements

Headers: Wttlogger.h

Library: WTTLog.dll

See Also

WTTLog Functions (C), WTTLogTrace

Send feedback on this topic
Built on December 10, 2009