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
Everything compiles and a smoke test inside of Tests runs and a memory leak is caught. The test.cpp file includes the following header file, named LeakDetector.h:
#pragma once
#ifdef DEBUG_NEW
# undef DEBUG_NEW
#endif
#ifdef new
# undef new
#endif
#ifndef CPPUTEST_USE_MEM_LEAK_DETECTION
# defineCPPUTEST_USE_MEM_LEAK_DETECTION1
#endif
#include"CppUTest/MemoryLeakDetectorNewMacros.h"
#include"CppUTest/MemoryLeakDetectorMallocMacros.h"
#ifdef new
# undef new
#endif
#definenewnew(__FILE__, (size_t)__LINE__)
However, a known and verified memory leak within the Shared/Deltas project isn't being detected, likely because the definition of new isn't being applied to the separate compilation units.
Does anyone have any experience enabling leak detection in CppUTest across different compilation units? Is there a tutorial or example setup showing how to configure a Solution to check for memory leaks across all included projects (without modifying the projects)?
I've tried using properties sheets to inherit includes, but haven't managed to make it work.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A Visual Studio 2022 Solution, named
Tests, references a number of projects under aShareddirectory:Everything compiles and a smoke test inside of
Testsruns and a memory leak is caught. Thetest.cppfile includes the following header file, namedLeakDetector.h:However, a known and verified memory leak within the
Shared/Deltasproject isn't being detected, likely because the definition ofnewisn't being applied to the separate compilation units.Does anyone have any experience enabling leak detection in CppUTest across different compilation units? Is there a tutorial or example setup showing how to configure a Solution to check for memory leaks across all included projects (without modifying the projects)?
I've tried using properties sheets to inherit includes, but haven't managed to make it work.
Beta Was this translation helpful? Give feedback.
All reactions