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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 TestH4Vparams {
@Rule
public TestName testname = new TestName();
@Before
public void showTestName()
{
System.out.print(testname.getMethodName());
}
@After
public void nextTestName()
{
System.out.println();
}
// @Test(expected = HDFException.class)
// public void testVQueryrefIllegalVKey() throws Throwable {
// HDFLibrary.VQueryref(-1);
// }
// @Test(expected = HDFException.class)
// public void testVQuerytagIllegalVKey() throws Throwable {
// HDFLibrary.VQuerytag(-1);
// }
// @Test(expected = HDFException.class)
// public void testVstartIllegalId() throws Throwable {
// HDFLibrary.Vstart(-1);
// }
@Test(expected = NullPointerException.class)
public void testVattachNullAccess() throws Throwable
{
HDFLibrary.Vattach(0, 0, null);
}
@Test(expected = HDFException.class)
public void testVattachIllegalId() throws Throwable
{
String str = "";
HDFLibrary.Vattach(-1, 0, str);
}
// @Test(expected = HDFException.class)
// public void testVdetachIllegalId() throws Throwable {
// HDFLibrary.Vdetach(-1);
// }
// @Test(expected = HDFException.class)
// public void testVendIllegalId() throws Throwable {
// HDFLibrary.Vend(-1);
// }
// @Test(expected = HDFException.class)
// public void testVgetidIllegalId() throws Throwable {
// HDFLibrary.Vgetid(-1, 0);
// }
@Test(expected = NullPointerException.class)
public void testVgetclassNullClassName() throws Throwable
{
HDFLibrary.Vgetclass(0, null);
}
@Test(expected = IllegalArgumentException.class)
public void testVgetclassIllegalArgument() throws Throwable
{
HDFLibrary.Vgetclass(0, new String[0]);
}
@Test(expected = HDFException.class)
public void testVgetclassIllegalId() throws Throwable
{
HDFLibrary.Vgetclass(-1, new String[1]);
}
@Test(expected = NullPointerException.class)
public void testVgetnameNullName() throws Throwable
{
HDFLibrary.Vgetname(0, null);
}
@Test(expected = IllegalArgumentException.class)
public void testVgetnameIllegalArgument() throws Throwable
{
HDFLibrary.Vgetname(0, new String[0]);
}
@Test(expected = HDFException.class)
public void testVgetnameIllegalId() throws Throwable
{
HDFLibrary.Vgetname(-1, new String[1]);
}
@Test(expected = HDFException.class)
public void testVisvgIllegalId() throws Throwable
{
HDFLibrary.Visvg(-1, 0);
}
@Test(expected = HDFException.class)
public void testVisvsIllegalId() throws Throwable
{
HDFLibrary.Visvs(-1, 0);
}
@Test(expected = NullPointerException.class)
public void testVgettagrefsNullTags() throws Throwable
{
int arraySize = 10;
HDFLibrary.Vgettagrefs(0, null, new int[arraySize], arraySize);
}
@Test(expected = NullPointerException.class)
public void testVgettagrefsNullRefs() throws Throwable
{
int arraySize = 10;
HDFLibrary.Vgettagrefs(0, new int[arraySize], null, arraySize);
}
@Test(expected = IllegalArgumentException.class)
public void testVgettagrefsIllegalTagsArgument() throws Throwable
{
int arraySize = 10;
HDFLibrary.Vgettagrefs(0, new int[1], new int[arraySize], arraySize);
}
@Test(expected = IllegalArgumentException.class)
public void testVgettagrefsIllegalRefsArgument() throws Throwable
{
int arraySize = 10;
HDFLibrary.Vgettagrefs(0, new int[arraySize], new int[1], arraySize);
}
@Test(expected = HDFException.class)
public void testVgettagrefsIllegalId() throws Throwable
{
int arraySize = 10;
HDFLibrary.Vgettagrefs(-1, new int[arraySize], new int[arraySize], arraySize);
}
@Test(expected = NullPointerException.class)
public void testVgettagrefNullTagRef() throws Throwable
{
HDFLibrary.Vgettagref(0, 0, null);
}
@Test(expected = IllegalArgumentException.class)
public void testVgettagrefIllegalTagRefArgument() throws Throwable
{
HDFLibrary.Vgettagref(0, 0, new int[1]);
}
@Test(expected = HDFException.class)
public void testVgettagrefIllegalId() throws Throwable
{
HDFLibrary.Vgettagref(-1, 0, new int[2]);
}
// @Test(expected = HDFException.class)
// public void testVntagrefsIllegalId() throws Throwable {
// HDFLibrary.Vntagrefs(-1);
// }
// @Test(expected = HDFException.class)
// public void testVinqtagrefIllegalId() throws Throwable {
// HDFLibrary.Vinqtagref(-1, 0, 0);
// }
@Test(expected = NullPointerException.class)
public void testVloneNullRefArray() throws Throwable
{
HDFLibrary.Vlone(0, null, 0);
}
@Test(expected = IllegalArgumentException.class)
public void testVloneIllegalSizeRefArray() throws Throwable
{
int arraySize = 10;
HDFLibrary.Vlone(0, new int[arraySize - 1], arraySize);
}
// @Test(expected = HDFException.class)
// public void testVloneIllegalId() throws Throwable {
// HDFLibrary.Vlone(-1, new int[10], 10);
// }
// @Test(expected = HDFException.class)
// public void testVaddtagrefIllegalId() throws Throwable {
// HDFLibrary.Vaddtagref(-1, 0, 0);
// }
// @Test(expected = HDFException.class)
// public void testVdeletetagrefIllegalId() throws Throwable {
// HDFLibrary.Vdeletetagref(-1, 0, 0);
// }
@Test(expected = NullPointerException.class)
public void testVfindNullVGroupName() throws Throwable
{
HDFLibrary.Vfind(0, null);
}
// @Test(expected = HDFException.class)
// public void testVfindIllegalId() throws Throwable {
// String str = "";
// HDFLibrary.Vfind(-1, str);
// }
@Test(expected = NullPointerException.class)
public void testVfindclassNullClassName() throws Throwable
{
HDFLibrary.Vfindclass(0, null);
}
// @Test(expected = HDFException.class)
// public void testVfindclassIllegalId() throws Throwable {
// String str = "";
// HDFLibrary.Vfindclass(-1, str);
// }
@Test(expected = NullPointerException.class)
public void testVflocateNullClassName() throws Throwable
{
HDFLibrary.Vflocate(0, null);
}
@Test(expected = HDFException.class)
public void testVflocateIllegalKey() throws Throwable
{
String str = "";
HDFLibrary.Vflocate(-1, str);
}
// @Test(expected = HDFException.class)
// public void testVgetnextIllegalKey() throws Throwable {
// HDFLibrary.Vgetnext(-1, 0);
// }
@Test(expected = NullPointerException.class)
public void testVinquireNullNEntries() throws Throwable
{
HDFLibrary.Vinquire(0, null, new String[1]);
}
@Test(expected = NullPointerException.class)
public void testVinquireNullVGroupName() throws Throwable
{
HDFLibrary.Vinquire(0, new int[1], null);
}
@Test(expected = IllegalArgumentException.class)
public void testVinquireIllegalNEntriesArgument() throws Throwable
{
HDFLibrary.Vinquire(0, new int[0], new String[1]);
}
@Test(expected = IllegalArgumentException.class)
public void testVinquireIllegalVGroupNameArgument() throws Throwable
{
HDFLibrary.Vinquire(0, new int[1], new String[0]);
}
@Test(expected = HDFException.class)
public void testVinquireIllegalId() throws Throwable
{
HDFLibrary.Vinquire(-1, new int[1], new String[1]);
}
// @Test(expected = HDFException.class)
// public void testVinsertIllegalVGroupId() throws Throwable {
// HDFLibrary.Vinsert(-1, 0);
// }
// @Test(expected = HDFException.class)
// public void testVinsertIllegalVId() throws Throwable {
// HDFLibrary.Vinsert(0, -1);
// }
// @Test(expected = HDFException.class)
// public void testVnrefsIllegalKey() throws Throwable {
// HDFLibrary.Vnrefs(-1, 0);
// }
@Test(expected = NullPointerException.class)
public void testVsetclassNullClassName() throws Throwable
{
HDFLibrary.Vsetclass(0, null);
}
@Test(expected = HDFException.class)
public void testVsetclassIllegalId() throws Throwable
{
String str = "";
HDFLibrary.Vsetclass(-1, str);
}
@Test(expected = NullPointerException.class)
public void testVsetnameNullName() throws Throwable
{
HDFLibrary.Vsetname(0, null);
}
@Test(expected = HDFException.class)
public void testVsetnameIllegalId() throws Throwable
{
String str = "";
HDFLibrary.Vsetname(-1, str);
}
@Test(expected = NullPointerException.class)
public void testVattrinfoNullName() throws Throwable
{
HDFLibrary.Vattrinfo(0, 0, null, new int[5]);
}
@Test(expected = NullPointerException.class)
public void testVattrinfoNullArgv() throws Throwable
{
HDFLibrary.Vattrinfo(0, 0, new String[1], null);
}
@Test(expected = IllegalArgumentException.class)
public void testVattrinfoIllegalNameArgument() throws Throwable
{
HDFLibrary.Vattrinfo(0, 0, new String[0], new int[5]);
}
@Test(expected = IllegalArgumentException.class)
public void testVattrinfoIllegalArgvArgument() throws Throwable
{
HDFLibrary.Vattrinfo(0, 0, new String[1], new int[1]);
}
@Test(expected = HDFException.class)
public void testVattrinfoIllegalId() throws Throwable
{
HDFLibrary.Vattrinfo(-1, 0, new String[1], new int[5]);
}
@Test(expected = NullPointerException.class)
public void testVfindattrNullName() throws Throwable
{
HDFLibrary.Vfindattr(0, null);
}
@Test(expected = HDFException.class)
public void testVfindattrIllegalId() throws Throwable
{
String str = "";
HDFLibrary.Vfindattr(-1, str);
}
@Test(expected = NullPointerException.class)
public void testVgetattrNullData() throws Throwable
{
byte[] byteArray = null;
HDFLibrary.Vgetattr(0, 0, byteArray);
}
@Test(expected = HDFException.class)
public void testVgetattrIllegalId() throws Throwable
{
byte[] byteArray = new byte[10];
HDFLibrary.Vgetattr(-1, 0, byteArray);
}
// @Test(expected = HDFException.class)
// public void testVgetversionIllegalId() throws Throwable {
// HDFLibrary.Vgetversion(-1);
// }
@Test(expected = HDFException.class)
public void testVnattrsIllegalId() throws Throwable
{
HDFLibrary.Vnattrs(-1);
}
@Test(expected = NullPointerException.class)
public void testVsetattrNullName() throws Throwable
{
String values = "";
HDFLibrary.Vsetattr(0, null, 0, 0, values);
}
@Test(expected = NullPointerException.class)
public void testVsetattrNullName2() throws Throwable
{
HDFLibrary.Vsetattr(0, null, 0, 0, new byte[10]);
}
@Test(expected = NullPointerException.class)
public void testVsetattrNullValuesString() throws Throwable
{
String str = "";
String values = null;
HDFLibrary.Vsetattr(0, str, 0, 0, values);
}
@Test(expected = NullPointerException.class)
public void testVsetattrNullDataByteArray() throws Throwable
{
String str = "";
byte[] data = null;
HDFLibrary.Vsetattr(0, str, 0, 0, data);
}
@Test(expected = HDFException.class)
public void testVsetattrIllegalId() throws Throwable
{
String str = "";
String values = "";
HDFLibrary.Vsetattr(-1, str, 0, 0, values);
}
@Test(expected = HDFException.class)
public void testVsetattrIllegalId2() throws Throwable
{
String str = "";
HDFLibrary.Vsetattr(-1, str, 0, 0, new byte[10]);
}
}
|