ASSERT

Evaluates the given condition in a debug build. If the resulting evaluation is false, then ASSERT calls DbgAssert to handle the assertion failure. DbgAssert can return to its caller later, if the user so desires.

ASSERT(
cond);

Parameters

  • cond
    Boolean expression that defines the condition to evaluate.

Remarks

If you use the ASSERT macro, DbgAssert might display a message box. If this is not acceptable in your environment, you can use KASSERT (kernel assert) instead.

Here are two examples of ASSERT calls:

ASSERT( First != NULL);
ASSERT( StartTime <= EndTime);

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.