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
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 TestH4DFparams {
@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 testDF24getdimsNullFilename() throws Throwable
{
HDFLibrary.DF24getdims(null, new int[] {0, 0, 0});
}
@Test(expected = NullPointerException.class)
public void testDF24getdimsNullArguments() throws Throwable
{
String str = "";
HDFLibrary.DF24getdims(str, null);
}
@Test(expected = IllegalArgumentException.class)
public void testDF24getdimsIllegalArgument() throws Throwable
{
String str = "";
HDFLibrary.DF24getdims(str, new int[] {0, 0});
}
@Test(expected = NullPointerException.class)
public void testDF24getimageNullFilename() throws Throwable
{
HDFLibrary.DF24getimage(null, new byte[] {(byte)0x0}, 0, 0);
}
@Test(expected = NullPointerException.class)
public void testDF24getimageNullImageData() throws Throwable
{
String str = "";
HDFLibrary.DF24getimage(str, null, 0, 0);
}
@Test(expected = NullPointerException.class)
public void testDF24readrefNullFilename() throws Throwable
{
HDFLibrary.DF24readref(null, 0);
}
@Test(expected = HDFException.class)
public void testDF24readrefIllegalRef() throws Throwable
{
String str = "";
HDFLibrary.DF24readref(str, -1);
}
@Test(expected = NullPointerException.class)
public void testDF24nimagesNullFilename() throws Throwable
{
HDFLibrary.DF24nimages(null);
}
@Test(expected = NullPointerException.class)
public void testDF24addimageNullFilename() throws Throwable
{
HDFLibrary.DF24addimage(null, new byte[] {(byte)0x0}, 0, 0);
}
@Test(expected = NullPointerException.class)
public void testDF24addimageNullImage() throws Throwable
{
String str = "";
HDFLibrary.DF24addimage(str, null, 0, 0);
}
@Test(expected = NullPointerException.class)
public void testDF24putimageNullFilename() throws Throwable
{
byte[] img = {0};
HDFLibrary.DF24putimage(null, img, 0, 0);
}
@Test(expected = NullPointerException.class)
public void testDF24putimageNullImage() throws Throwable
{
String str = "";
byte[] img = null;
HDFLibrary.DF24putimage(str, img, 0, 0);
}
@Test(expected = IllegalArgumentException.class)
public void testDF24putimageIllegalArgument() throws Throwable
{
String str = "";
HDFLibrary.DF24putimage(str, new byte[] {}, 0, 0);
}
@Test(expected = NullPointerException.class)
public void testDF24setcompressNullCompInfo() throws Throwable
{
HDFLibrary.DF24setcompress(0, null);
}
@Test(expected = HDFException.class)
public void testDF24setilIllegalIl() throws Throwable
{
HDFLibrary.DF24setil(-1);
}
}
|