Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326967

Summary: Need an Assert_query() API to allow non-commital check of Assert expression.
Product: [Technology] RTSC Reporter: Alan DeMars <ademars>
Component: RuntimeAssignee: Sasha Slijepcevic <sascha>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: d-russo, dfriedland
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Alan DeMars CLA 2010-10-04 15:48:19 EDT
Build Identifier: 3.20.05.69

There are situations where it would be convenient to know if an Assert_isTrue() will fail but perform some work prior to following the normal Assert() exit code.

An Assert_query() API would allow OPTIMIZED testing of the Assert expression. Assert_query() would be similarly boil-away-able as Assert_isTrue() in case Asserts are not enabled...

Bool Assert_query(expr, AssertID);

Example use case:

if (Assert_query((BIOS_getThreadType() != BIOS_ThreadTypeTask)), GateMutex_A_badContext) {
    BIOS_setThreadType(BIOS_ThreadType_Main);
    Assert_isTrue(FALSE, GateMutex_A_badContext);   
}

Reproducible: Always