GoogleTest is allocating memory during test running - can this be somehow disabled or redirected? #4497
Unanswered
ibogosavljevic
asked this question in
Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We work in Automotive and allocating memory is not allowed except during program initialization. So we want to test it with our current integration tests that are written using Google Test.
We override malloc/free and new/delete to track allocation and throw exception in case these functions are called outside of initialization phase. The problem is Google Test allocates memory and causes our test to fail even when everything is running fine.
I guess a reasonable expectation is that Google Test allocate some memory, and this is fine. So we check memory allocations only in our code. But, the problem is mocking. When we use EXPECT_CALL, our code calls the mock and GTest allocates some memory during mocking.
What are the workarounds for this? Is there any code GTest calls before starting mocking and after finishing mocking?
Beta Was this translation helpful? Give feedback.
All reactions