[ImageJ-devel] JUnit tests, was Re: when to close cursors

Johannes Schindelin Johannes.Schindelin at gmx.de
Wed Apr 14 18:37:39 CDT 2010


On Thu, 15 Apr 2010, Stephan Saalfeld wrote:

> Cursor.hasNext() == false does not mean that the cursor is out of image 
> bounds and, depending on the container may still point to some data. 
> Image keeping track of its cursors, it is good to close them for freeing 
> this data.  Currently, this is important in cell containers only.
> I think that the recent design changes regarding data access make this
> tracking of cursors obsolete and so Cursor.close() too.  A good hint is
> that Image.removeCursor() is just never called.  But I am very tired and
> have to check this.

Well, for the moment, I just played it safe. Please check out the 
junit-tests branch (based on master~2, so it will need adjusting once the 
huge changes of containerlevel come in).

I know that I have to add a few comments, but I just spent almost 2 hours 
to hunt down a bug that I introduced in Fiji's javac 3 weeks ago, so I am 
thoroughly tired.

The current version of the tests is here:


The idea is to have a few helper methods in TestBase which can

- construct images algorithmically
- compare images to some calculated values
- compare "signatures", i.e. first and second order moments of intensity 
  and coordinates.

Obviously, I want to avoid large test images in the repository, and I want 
to make it very simple to add tests, because we need them.


More information about the ImageJ-devel mailing list