As a result of discussion with @DanBloomberg, the test that was commented out, can now be re-enabled.
The change for Pixa.replacePix() method only concerns the JavaDoc, but is very important. I would suggest to rewrite the test such:
public void testPixaReplacePix() {
Pixa pixa = Pixa.createPixa(0, 640, 480);
// Populate the Pixa.
addBlockToPixa(pixa, 0, 0, 640, 480, 8);
// Replace the existing Pix.
pixa.replacePix(0, new Pix(320, 240, 8), new Box(320, 240, 320, 240));
// Ensure the replacement was successful.
Pix returnedPix = pixa.getPix(0);
Box returnedBox = pixa.getBox(0);
assertEquals(320, returnedPix.getWidth());
assertEquals(240, returnedPix.getHeight());
assertEquals(8, returnedPix.getDepth());
assertEquals(320, returnedBox.getX());
assertEquals(240, returnedBox.getY());
assertEquals(320, returnedBox.getWidth());
assertEquals(240, returnedBox.getHeight());
returnedPix.recycle();
returnedBox.recycle();
pixa.recycle();
}
This should emphasize that the parameters of replacePix method actually become zombies, and should not be recycled or referenced anymore.
As a result of discussion with @DanBloomberg, the test that was commented out, can now be re-enabled. The change for
Pixa.replacePix()
method only concerns the JavaDoc, but is very important. I would suggest to rewrite the test such:This should emphasize that the parameters of
replacePix
method actually become zombies, and should not be recycled or referenced anymore.