3

Is it possible to test if memory leaks occur when running a Unit Test? I want to check if my memory management is handled correctly.

Thanks

Mats Stijlaart
  • 5,058
  • 7
  • 42
  • 58

1 Answers1

2

You can try running your unit tests under Instruments with the Leak Detection Instrument.

However, this will only work for Application (bundle) tests, if you're using OCUnit. If you happen to use something else, please let us know.

Johannes Rudolph
  • 35,298
  • 14
  • 114
  • 172
  • Thanks. My goal is to run it under OCUnit. I knew the Leak Detection Instrument was an option. But I think it is not optimal. I will problably make something on my own. If it works, ill let your know. – Mats Stijlaart Jul 04 '11 at 12:01
  • @MatsStijlaart Were you ever able to find a solution to check for leaks in unit tests? – JRG-Developer Apr 20 '16 at 15:28
  • Nope. Long time ago. Not focusing on Objective-C anymore, so I can't help you any further. – Mats Stijlaart Apr 20 '16 at 18:13