Skip to content

fix: substitute UT_ASSERTs with asserts from GTEST part 4 #704

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

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

EuphoricThinking
Copy link
Contributor

@EuphoricThinking EuphoricThinking commented Sep 2, 2024

The PR is a part of a major fix, which will be provided in multiple files.

Ref. #569

canQuery*(...) are changed to void. 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. The flags are checked then in the fixture. The solution is inspired by GTEST docs..

The condition using ::memspaceGetTest::IsSkipped() in memspaceProviderTest is replaced due to its ineffectiveness: it has used the method from superclass for itself, before skipping any tests.

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.

Description

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used

@EuphoricThinking EuphoricThinking requested a review from a team as a code owner September 2, 2024 17:40
@EuphoricThinking EuphoricThinking marked this pull request as draft September 2, 2024 18:05
@EuphoricThinking EuphoricThinking force-pushed the assertspr8 branch 6 times, most recently from 67331e3 to af13501 Compare September 18, 2024 15:17
@EuphoricThinking EuphoricThinking marked this pull request as ready for review September 19, 2024 15:38
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
@bratpiorka bratpiorka requested a review from PatKamin October 7, 2024 09:23
@bratpiorka bratpiorka merged commit 371a6f5 into oneapi-src:main Oct 7, 2024
72 checks passed
@EuphoricThinking EuphoricThinking deleted the assertspr8 branch January 3, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants