From: Simon Strandgaard Date: 2003-12-12T23:57:04+09:00 Subject: Re: How to unit test finalizers? On Fri, 12 Dec 2003 23:43:43 +0900, Paul Brannan wrote: > On Thu, Dec 11, 2003 at 12:43:52PM +0900, Yukihiro Matsumoto wrote: >> How about not relying on finalizers, i.e. separate finalizing process >> into a method, then call the method explicitly in the test? You don't >> have to test whether finalizers are called. That's my responsibility. > > While it is your responsibility to call the finalizers, it is our > responsibility to make sure that there are no references to the object > hanging around keeping the object from being finalized. I don't know of > any good, portable way to unit test that, though. Wouldn't it be possible to spawn a child process, where a instance outputs something when it gets finalized. Then the parent process could do a assert_equal(count_open, count_close) Is that realistic.. ? I have only played a little with finalizers. -- Simon Strandgaard