1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF Products. The full HDF copyright *
* notice, including terms governing use, modification, and redistribution, *
* is contained in the file, COPYING. COPYING can be found at the root of *
* the source code distribution tree. You can also access it online at *
* https://www.hdfgroup.org/licenses. If you do not have access to the *
* file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import hdf.hdflib.HDFChunkInfo;
import hdf.hdflib.HDFConstants;
import hdf.hdflib.HDFException;
import hdf.hdflib.HDFLibrary;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
public class TestH4DFRparams {
@Rule
public TestName testname = new TestName();
@Before
public void showTestName()
{
System.out.print(testname.getMethodName());
}
@After
public void nextTestName()
{
System.out.println();
}
@Test(expected = NullPointerException.class)
public void testDFR8getdimsNullFilename() throws Throwable
{
HDFLibrary.DFR8getdims(null, new int[] {0, 0}, new boolean[] {true});
}
@Test(expected = NullPointerException.class)
public void testDFR8getdimsNullDimensions() throws Throwable
{
String str = "";
HDFLibrary.DFR8getdims(str, null, new boolean[] {true});
}
@Test(expected = NullPointerException.class)
public void testDFR8getdimsNullPalette() throws Throwable
{
String str = "";
HDFLibrary.DFR8getdims(str, new int[] {0, 0}, null);
}
@Test(expected = IllegalArgumentException.class)
public void testDFR8getdimsIllegalArgument() throws Throwable
{
String str = "";
HDFLibrary.DFR8getdims(str, new int[] {0}, new boolean[] {true});
}
@Test(expected = NullPointerException.class)
public void testDFR8getimageNullFilename() throws Throwable
{
HDFLibrary.DFR8getimage(null, new byte[] {(byte)0x0}, 0, 0, new byte[] {(byte)0x0});
}
@Test(expected = NullPointerException.class)
public void testDFR8getimageNullImageData() throws Throwable
{
String str = "";
HDFLibrary.DFR8getimage(str, null, 0, 0, new byte[] {(byte)0x0});
}
@Test(expected = NullPointerException.class)
public void testDFR8readrefNullFilename() throws Throwable
{
HDFLibrary.DFR8readref(null, 0);
}
@Test(expected = HDFException.class)
public void testDFR8readrefIllegalRef() throws Throwable
{
String str = "";
HDFLibrary.DFR8readref(str, -1);
}
@Test(expected = NullPointerException.class)
public void testDFR8nimagesNullFilename() throws Throwable
{
HDFLibrary.DFR8nimages(null);
}
@Test(expected = NullPointerException.class)
public void testDFR8addimageNullFilename() throws Throwable
{
HDFLibrary.DFR8addimage(null, new byte[] {(byte)0x0}, 0, 0, (short)0);
}
@Test(expected = NullPointerException.class)
public void testDFR8addimageNullImage() throws Throwable
{
String str = "";
HDFLibrary.DFR8addimage(str, null, 0, 0, (short)0);
}
@Test(expected = NullPointerException.class)
public void testDFR8putimageNullFilename() throws Throwable
{
HDFLibrary.DFR8putimage(null, new byte[] {(byte)0x0}, 0, 0, (short)0);
}
@Test(expected = NullPointerException.class)
public void testDFR8putimageNullImage() throws Throwable
{
String str = "";
HDFLibrary.DFR8putimage(str, null, 0, 0, (short)0);
}
@Test(expected = NullPointerException.class)
public void testDFR8setcompressNullCompInfo() throws Throwable
{
HDFLibrary.DFR8setcompress(0, null);
}
@Test(expected = NullPointerException.class)
public void testDFR8getpalrefNullPalRef() throws Throwable
{
HDFLibrary.DFR8getpalref(null);
}
@Test(expected = IllegalArgumentException.class)
public void testDFR8getpalrefIllegalArgument() throws Throwable
{
HDFLibrary.DFR8getpalref(new short[] {});
}
@Test(expected = NullPointerException.class)
public void testDFR8writerefNullFilename() throws Throwable
{
HDFLibrary.DFR8writeref(null, (short)0);
}
}
|