File: TestH4DFPparams.java

package info (click to toggle)
libhdf4 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 29,892 kB
  • sloc: ansic: 128,688; sh: 14,969; fortran: 12,444; java: 5,864; xml: 1,305; makefile: 900; yacc: 678; pascal: 418; perl: 360; javascript: 203; lex: 163; csh: 41
file content (123 lines) | stat: -rw-r--r-- 3,575 bytes parent folder | download | duplicates (3)
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
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 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.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 TestH4DFPparams {
    @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 testDFPaddpalNull() throws Throwable
    {
        byte[] palette = {0};
        HDFLibrary.DFPaddpal(null, palette);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPaddpalNullPalette() throws Throwable
    {
        String str = "";
        HDFLibrary.DFPaddpal(str, null);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPgetpalNull() throws Throwable
    {
        byte[] palette = {0};
        HDFLibrary.DFPgetpal(null, palette);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPgetpalNullPalette() throws Throwable
    {
        String str = "";
        HDFLibrary.DFPgetpal(str, null);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPnpalsNull() throws Throwable
    {
        HDFLibrary.DFPnpals(null);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPputpalNull() throws Throwable
    {
        byte[] palette = {0};
        String arg     = "a";
        HDFLibrary.DFPputpal(null, palette, 0, arg);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPputpalArgNull() throws Throwable
    {
        byte[] palette = {0};
        String arg     = "a";
        HDFLibrary.DFPputpal(arg, palette, 0, null);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPputpalNullPalette() throws Throwable
    {
        String arg  = "a";
        String mode = "a";
        HDFLibrary.DFPputpal(arg, null, 0, mode);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPreadrefNull() throws Throwable
    {
        short ref = 0;
        HDFLibrary.DFPreadref(null, ref);
    }

    @Test(expected = NullPointerException.class)
    public void testDFPwriterefNull() throws Throwable
    {
        short ref = 0;
        HDFLibrary.DFPwriteref(null, ref);
    }
}