Skip to content

gapi: fix InferWithReshape test crash when data is not found#22831

Merged
opencv-pushbot merged 1 commit intoopencv:4.xfrom
mshabunin:fix-gapi-test-crash
Nov 21, 2022
Merged

gapi: fix InferWithReshape test crash when data is not found#22831
opencv-pushbot merged 1 commit intoopencv:4.xfrom
mshabunin:fix-gapi-test-crash

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

  • Moved test fixture initialization from constructor to the InferWithReshape::SetUp method to avoid crash in case when exception is thrown (e.g. can not find test data).
  • Call parent class SetUp method in InferWithReshapeNV12::SetUp

Example of crash (aarch64/qemu, build with OpenVINO support):

[----------] 6 tests from InferWithReshape
[ RUN      ] InferWithReshape.TestInfer
unknown file: Failure
C++ exception with description "OpenCV(4.6.0-dev) /opencv/modules/ts/src/ts.cpp:1064: error: (-2:Unspecified error) OpenCV tests: Can't find required data file: intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml in function 'findData'
" thrown in the test fixture's constructor.
89748 Segmentation fault      (core dumped)

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 20, 2022

relates #18240
/cc @mpashchenkov @TolyaTalamanov

Copy link
Copy Markdown
Contributor

@mpashchenkov mpashchenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx.

@TolyaTalamanov TolyaTalamanov self-requested a review November 21, 2022 07:18
Copy link
Copy Markdown
Contributor

@TolyaTalamanov TolyaTalamanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

@opencv-pushbot opencv-pushbot merged commit c102720 into opencv:4.x Nov 21, 2022
@alalek alalek mentioned this pull request Jan 8, 2023
@mshabunin mshabunin deleted the fix-gapi-test-crash branch July 10, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants