FYI: DotMemoryUnit IDisposable seems to work only if the compiler inlines the functions

I followed your instructions at https://www.jetbrains.com/help/dotmemory-unit/2.1/Working_with_Unsupported_Unit_Testing_Frameworks.html and for debug reasons I added some output in the constructor and the "Dispose" method.

With the extended methods, tests that should fail because of memory assertions have passed. It seems that the behavior depends on whether the compiler inlines the functions or not.

I thought that someone else might stumble upon the same problem and therefore I wanted to share it here. Maybe you would like to add a short information on the linked instruction page.

For clarification I uploaded some source code that shows the behavior: http://pastebin.com/xsJexD7h

0
1 comment
Official comment

Hello Lukas,

Unfortunately it's really an issue which occurs by some reasons related to the test method detection. We're planning to find a way to avoid such issues, so be pleasured to follow this issue:
https://youtrack.jetbrains.com/issue/DMU-116

Thank you for your comment and code example.

Please sign in to leave a comment.