Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in Usage of Assertion Methods in Tests #569

Closed
lplewa opened this issue Jun 26, 2024 · 1 comment
Closed

Inconsistency in Usage of Assertion Methods in Tests #569

lplewa opened this issue Jun 26, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@lplewa
Copy link
Contributor

lplewa commented Jun 26, 2024

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 lplewa added the bug Something isn't working label Jun 26, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 13, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 14, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 21, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 23, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 23, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 29, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Aug 30, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 2, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 2, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 12, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 12, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 12, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 18, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 18, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 18, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 18, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 18, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 19, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 30, 2024
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Sep 30, 2024
If possible, change non-void functions to void by passing pointers
Otherwise, introduce error-indicating return values
Fix segfault in umfMemoryProviderDestroy(...)

Ref. oneapi-src#569
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Oct 1, 2024
If possible, change non-void functions to void by passing pointers
Otherwise, introduce error-indicating return values

Ref. oneapi-src#569
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Oct 4, 2024
canQuery*(...) are changed to void,
since EXPECT_* and ADD_FAILURE() interefere with GTEST_SKIP()
when used in a non-void helper function -
tests are run in spite of labelling as skipped by the fixture.
The success, failure or the need to skip the tests
are determined in the function body using GTEST asserts,
which set the appropriate flags for the current test.
Then the flags are checked in the fixture.

Ref. oneapi-src#569
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Oct 14, 2024
If possible, change non-void functions to void by passing pointers
Otherwise, introduce error-indicating return values

Ref. oneapi-src#569
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Oct 14, 2024
    If possible, change non-void functions to void by passing pointers
    Otherwise, introduce error-indicating return values

    Ref. oneapi-src#569
EuphoricThinking added a commit to EuphoricThinking/unified-memory-framework that referenced this issue Oct 21, 2024
@bratpiorka
Copy link
Contributor

closing as we merged the last part of fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants