Closed eduvfalc closed 4 months ago
How did you resolve this?
I believe I am facing a similar issue.
I am instantiating a
class MyTest : public testing::TestWithParam<size_t>
with
INSTANTIATE_TEST_SUITE_P(Prefix, MyTest, testing::Values(1U));
and get
double free or corruption (out)
without having any tests run
I noticed that it was happening with a single test data pair I was using as input to the test, but I believe this should be reopened for better clarification.
Turns out I have been building my own libraries with -D_GLIBCXX_DEBUG
and building googletest without this define flag.
Compiling and linking my own libraries and googletest without -D_GLIBCXX_DEBUG
seems to have solved the issue for me.
Describe the issue
I have parameterized some tests for a particular test fixture. The input parameters are
pairs
ofint
s. Every first test of the parameterized test suite executes successfully but flagsdouble free or corruption (out)
. I find it odd that it happens in the first test only, regardless of the input values. All the other tests do not show the same issue.Steps to reproduce the problem
Test fixture class:
Note:
DSPUtils<Complex, std::vector>
andstd::make_shared<DSPUtils<Complex, std::vector>>
are custom template classes defined in here.Value-parameterized test:
Value-parameterized test suite instantiation:
What version of GoogleTest are you using?
v1.14.0 (latest).
What operating system and version are you using?
Linux Ubuntu 22.04 Jammy
What compiler and version are you using?
gcc/g++ 10.5.0
What build system are you using?
CMake 3.22.1
Additional context
No response