unified-memory-framework icon indicating copy to clipboard operation
unified-memory-framework copied to clipboard

Inconsistency in Usage of Assertion Methods in Tests

Open lplewa opened this issue 1 year ago • 0 comments

Current Situation

Our test suite currently uses two different assertion frameworks:

  1. Google Test (GTEST) Assertions: These assertions use ASSERT and EXPECT macros.
  2. UT_ASSERTs: These assertions call abort() on failure, which undesirably terminates the execution of any subsequent tests within the same file.
  3. Some test constructors utilize only EXPECT macro, and after initialization fails, it continue test execution, causing it fail in different place.

Problems Identified

  • Test Execution Interruption: The use of UT_ASSERT can prematurely end test execution upon failure, preventing full test suite runs.
  • Incompatibility in Test Initialization: Google Test's ASSERT macros are not suitable for use in initialization routines (like in helper functions or within test class constructors) because they employ return statements that is supposed to exit test "main function"

Proposed Solution

  1. Standardize on GTEST Assertions: Transition all assertions to GTest.

lplewa avatar Jun 26 '24 12:06 lplewa