C++ - Is it possible to implement memory leak testing in a unit test?

前端 未结 4 840
感动是毒
感动是毒 2020-12-25 14:25

I\'m trying to implement unit testing for my code and I\'m having a hard time doing it.

Ideally I would like to test some classes not only for good functionality but

4条回答
  •  庸人自扰
    2020-12-25 15:11

    You might be able to detect memory leak on tests by providing your own implementation of new, delete, malloc and free functions, by adding memory tracking informations on allocation.

提交回复
热议问题