You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've used CppUTest for a couple of years now. I'm mostly very pleased with it. It's been useful for regression testing, and finding memory leaks (although I do use Valgrind as well).
I've just been documenting the process I went through installing my build environment, etc. I am running Linux. I have not built CppUTest from the repo, but instead have installed the versions available with apt. Although I could do the former, I am putting together some "howto" instructions for my colleagues who aren't very familiar with some of the build processes.
Unfortunately, the versions installed using apt are different for the two flavours of Linux I am using. In both cases I believe I am using the latest versions available with apt.
As you can see, the versions on the two versions of Linux are different. This matters because, for one set of tests, I switch off the memory leak checker, in the teardown() function:
void teardown()
{
...
...
// This next line will fail if you are using an older version of CppUTest:
MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads();
// If so, use the next line instead:
// MemoryLeakWarningPlugin::turnOnNewDeleteOverloads();
}
As indicated in the code comments, the version running on Linux Mint needs to use the function MemoryLeakWarningPlugin::turnOnNewDeleteOverloads(), and the (newer) version on Ubuntu needs to use MemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads().
Rather than requiring the user to change the code as required, it would be nice if I could use a #ifdef directive to select the correct function based on the version of CppUTest running. Ideally the version in which this code change was made.
is it possible to do this? if so, where is the version number stored?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone
I've used CppUTest for a couple of years now. I'm mostly very pleased with it. It's been useful for regression testing, and finding memory leaks (although I do use Valgrind as well).
I've just been documenting the process I went through installing my build environment, etc. I am running Linux. I have not built CppUTest from the repo, but instead have installed the versions available with
apt
. Although I could do the former, I am putting together some "howto" instructions for my colleagues who aren't very familiar with some of the build processes.Unfortunately, the versions installed using
apt
are different for the two flavours of Linux I am using. In both cases I believe I am using the latest versions available withapt
.On Linux Mint:
On Ubuntu:
As you can see, the versions on the two versions of Linux are different. This matters because, for one set of tests, I switch off the memory leak checker, in the
teardown()
function:As indicated in the code comments, the version running on Linux Mint needs to use the function
MemoryLeakWarningPlugin::turnOnNewDeleteOverloads()
, and the (newer) version on Ubuntu needs to useMemoryLeakWarningPlugin::turnOnDefaultNotThreadSafeNewDeleteOverloads()
.Rather than requiring the user to change the code as required, it would be nice if I could use a
#ifdef
directive to select the correct function based on the version of CppUTest running. Ideally the version in which this code change was made.is it possible to do this? if so, where is the version number stored?
Thank you
Matthew
Beta Was this translation helpful? Give feedback.
All reactions