IWTTLog::Assert

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.

HRESULT Assert (
  VARIANT_BOOL  fCondition,       
  BSTR  bstrFile,         
  UINT  uiLine,           
  BSTR  bstrAssertMsg,    
  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.

bstrFile

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

uiLine

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

bstrAssertMsg

[in] The text message of the assertion.

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

Assert 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

IDL: Log.IDL

Library: WTTLogCM.dll

See Also

IWTTLog Interface (COM), IWTTLog::Trace

Send feedback on this topic
Built on December 10, 2009