Hi Wayne,<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">I am willing to try to figure out why the tests are failing. I thought I
would start with the virtual stack tests so I converted
VirtualStackTest.java to an ImageJ plugin (attached), but I can't get it
to run because I can't find the files "gray8-2x3-sub1.tif" and
"gray8-2x3-sub2.tif" on the imagejdev website and I don't know how to
generate them.<br></blockquote><br>The data files are included in the ImageJ2 SVN checkout, in the folder:<br> ij1-tests/src/test/resources/data<br><br>You can also download them from this URL:<br> <a href="http://dev.imagejdev.org/svn/imagej/trunk/ij1-tests/src/test/resources/data/">http://dev.imagejdev.org/svn/imagej/trunk/ij1-tests/src/test/resources/data/</a><br>
<br>Regards,<br>Curtis<br><br><br><div class="gmail_quote">On Sat, Oct 8, 2011 at 2:28 PM, Rasband, Wayne (NIH/NIMH) [E] <span dir="ltr"><<a href="mailto:rasbandw@mail.nih.gov">rasbandw@mail.nih.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Curtis,<br>
<br>
I am willing to try to figure out why the tests are failing. I thought I would start with the virtual stack tests so I converted VirtualStackTest.java to an ImageJ plugin (attached), but I can't get it to run because I can't find the files "gray8-2x3-sub1.tif" and "gray8-2x3-sub2.tif" on the imagejdev website and I don't know how to generate them.<br>
<br>
-wayne<br>
<br>
<br>
<br>
import ij.*;<br>
import ij.process.*;<br>
import ij.plugin.*;<br>
import static org.junit.Assert.assertArrayEquals;<br>
import static org.junit.Assert.assertEquals;<br>
import static org.junit.Assert.assertNotNull;<br>
import static org.junit.Assert.assertNull;<br>
import static org.junit.Assert.assertTrue;<br>
import static org.junit.Assert.fail;<br>
<br>
public class Unit_Tests implements PlugIn {<br>
<br>
public void run(String arg) {<br>
testGetProcessor();<br>
}<br>
<br>
public void testGetProcessor() {<br>
String DATA_DIR = "src/test/resources/data/";<br>
// setup vstack<br>
VirtualStack vs =new VirtualStack(2,3,null,DATA_DIR);<br>
vs.addSlice("gray8-2x3-sub1.tif");<br>
vs.addSlice("gray8-2x3-sub2.tif");<br>
// test that it works<br>
ImageProcessor proc;<br>
// try valid entries and test returned data<br>
proc =vs.getProcessor(1);<br>
assertEquals(2,proc.getWidth());<br>
assertEquals(3,proc.getHeight());<br>
assertArrayEquals(new byte[]{0,40,0,40,120,-96},(byte[])proc.getPixels());<br>
proc =vs.getProcessor(2);<br>
assertEquals(2,proc.getWidth());<br>
assertEquals(3,proc.getHeight());<br>
assertArrayEquals(new byte[]{0,40,0,40,120,-96},(byte[])proc.getPixels());<br>
<div><div></div><div class="h5"> }<br>
<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Oct 7, 2011, at 3:05 PM, Curtis Rueden wrote:<br>
<br>
> Hi Wayne et. al,<br>
><br>
> For quite some time now, we have had unit tests (written by Barry) for testing the behavior of IJ1. Unfortunately, they were originally written to compile against a patched version of IJ1 and we neglected to update them to work with IJ1 "out of the box."<br>
><br>
> I have had a ticket about this situation (<a href="http://dev.imagejdev.org/trac/imagej/ticket/598" target="_blank">http://dev.imagejdev.org/trac/imagej/ticket/598</a>) for the past few months, but have only just now finally fixed the tests to work against various versions of IJ1 from 1.44 onwards.<br>
><br>
> I ran them against all development versions of 1.45 (a through q) and saved the result as a blog post:<br>
> <a href="http://imagejdev.org/2011/10/07/unit-tests-imagej-1x" target="_blank">http://imagejdev.org/2011/10/07/unit-tests-imagej-1x</a><br>
><br>
> It looks like from 1.45a through 1.45q, a total of 7 code changes were introduced that result in test failures. These could be the result of bugfixes, or they could be new regressions. I wanted to let you know in case you were interested in pursuing these bugs, since I know how much you value backwards compatibility.<br>
><br>
> Instructions on running the tests yourself can be found here:<br>
> <a href="http://imagejdev.org/source-code#Running_ImageJ_1.x_unit_tests" target="_blank">http://imagejdev.org/source-code#Running_ImageJ_1.x_unit_tests</a><br>
><br>
> My plan is to hook up the tests to Hudson (<a href="http://dev.imagejdev.org:8080/" target="_blank">http://dev.imagejdev.org:8080/</a>) and have it send an email whenever a new version of IJ1 is released with failing tests.<br>
><br>
> What do you think?<br>
><br>
> Regards,<br>
> Curtis<br>
><br>
<br>
</div></div></blockquote></div><br>