Crash on deallocating non-allocated memory

316 views
Skip to first unread message

Terry Yin

unread,
Aug 20, 2012, 9:11:06 PM8/20/12
to cppu...@googlegroups.com
Hi,

Can I ask the cpputest executable to crash when deallocating non-allocated memory?
I find the current information it gives quite useless:
"Deallocating non-allocated memory

   allocated at file: <unknown> line: 0 size: 0 type: unknown

   deallocated at file: <unknown> line: 0 type: delete"

--
-terry
-------------------------
Blog: http://terryyin.blogbus.com/
twitter: http://twitter.com/terryyin

Bas Vodde

unread,
Aug 20, 2012, 9:16:02 PM8/20/12
to cppu...@googlegroups.com

Hola,

Not at this moment. I'm afraid we only keep a counter for allocations. It wouldn't very hard to add probably.

Easiest for now is to add a breakpoint on the error message printing :(

Bas

James Grenning

unread,
Aug 26, 2012, 2:39:35 PM8/26/12
to cppu...@googlegroups.com
I think that error could be better.  Something like:

"deallocating memory not allocated using cpputest leak detection"

Bas Vodde

unread,
Aug 26, 2012, 10:26:03 PM8/26/12
to cppu...@googlegroups.com

Feel free to change it :)

Bas
Reply all
Reply to author
Forward
0 new messages