Search in sources :

Example 1 with TiffWriterMock

use of loci.formats.utests.tiff.TiffWriterMock in project bioformats by openmicroscopy.

the class TiffWriterTest method testSetBigTiffAutomatic.

@Test
public void testSetBigTiffAutomatic() throws IOException, FormatException {
    // Test that no exception is thrown when bigTiff is set automatically due to size
    metadata.setPixelsSizeT(new PositiveInteger(1000), 0);
    writer.setMetadataRetrieve(metadata);
    ((TiffWriterMock) writer).createOutputBuffer(true);
    long length = 4294967296L;
    ((TiffWriterMock) writer).setBufferLength(length);
    writer.setId("test.tiff");
    writer.saveBytes(0, buf, ifd);
}
Also used : PositiveInteger(ome.xml.model.primitives.PositiveInteger) TiffWriterMock(loci.formats.utests.tiff.TiffWriterMock) Test(org.testng.annotations.Test)

Example 2 with TiffWriterMock

use of loci.formats.utests.tiff.TiffWriterMock in project bioformats by openmicroscopy.

the class TiffWriterTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    ifd = new IFD();
    writer = new TiffWriterMock();
    metadata = WriterUtilities.createMetadata();
    for (int i = 0; i < 1024 * 1024; i++) {
        buf[i] = (byte) (i % 255);
    }
}
Also used : IFD(loci.formats.tiff.IFD) TiffWriterMock(loci.formats.utests.tiff.TiffWriterMock) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

TiffWriterMock (loci.formats.utests.tiff.TiffWriterMock)2 IFD (loci.formats.tiff.IFD)1 PositiveInteger (ome.xml.model.primitives.PositiveInteger)1 BeforeMethod (org.testng.annotations.BeforeMethod)1 Test (org.testng.annotations.Test)1