GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
Test1p1JavaEmitter.java
Go to the documentation of this file.
1/**
2 * Copyright 2010 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.gluegen.test.junit.generation;
30
31import java.io.IOException;
32
33import com.jogamp.gluegen.test.junit.generation.impl.Bindingtest1p1Impl;
34
35import org.junit.BeforeClass;
36import org.junit.Test;
37
38
39/**
40 * @author Michael Bien
41 * @author Sven Gothel
42 */
43import org.junit.FixMethodOrder;
44import org.junit.runners.MethodSorters;
45
46@FixMethodOrder(MethodSorters.NAME_ASCENDING)
47public class Test1p1JavaEmitter extends BaseClass {
48
49 /**
50 * Verifies loading of the new library.
51 */
52 @BeforeClass
53 public static void chapter__TestLoadLibrary() throws Exception {
55 }
56
57 /**
58 * Verifies the existence and creation of the generated class.
59 */
60 @Test
61 public void chapter00TestClassExist() throws Exception {
62 testClassExist("test1p1");
63 }
64
65 /**
66 * Verifies if all generated method signatures are completed,
67 * ie a compilation only coverage test without functional tests.
68 */
69 public void chapter__TestCoverageSignature() throws Exception {
70 chapter__TestCoverageSignature(new Bindingtest1p1Impl());
71 }
72
73 /**
74 * Verifies if all generated static constant values are completed,
75 * and whether their value is as expected!
76 * <p>
77 * Covers all enumerates and defines.
78 * </p>
79 */
80 @Test
81 public void chapter01TestStaticConstants() throws Exception {
82 chapter01TestStaticConstants(new Bindingtest1p1Impl());
83 }
84
85 /**
86 * Verifies if all methods / signatures are properly generated,
87 * can be invoked and functions.
88 * This is a compilation (coverage) and runtime time (semantic) test.
89 * This covers indirect primitive arrays and direct NIO buffers.
90 */
91 @Test
93 chapter03TestCoverageFunctionalityNIOAndPrimitiveArray(new Bindingtest1p1Impl(), true);
94 }
95
96 /**
97 * Verifies if all methods / signatures are properly generated,
98 * can be invoked and functions.
99 * This is a compilation (coverage) and runtime time (semantic) test.
100 * This covers indirect primitive arrays and indirect NIO buffers (nio using arrays).
101 */
102 @Test
104 chapter03TestCoverageFunctionalityNIOAndPrimitiveArray(new Bindingtest1p1Impl(), false);
105 }
106
107 /**
108 * This covers direct / indirect pointer buffers
109 */
110 @Test
111 public void chapter04TestPointerBuffer() throws Exception {
112 chapter04TestPointerBuffer(new Bindingtest1p1Impl());
113 }
114
115 /**
116 * This covers indirect primitive arrays and indirect NIO buffers.
117 */
118 @Test
119 public void chapter05TestSomeFunctionsAllIndirect() throws Exception {
120 chapter05TestSomeFunctionsAllIndirect(new Bindingtest1p1Impl());
121 }
122
123 /**
124 * This covers compounds (structs) data alignment
125 */
126 @Test
127 public void chapter09TestCompoundAlignment() throws Exception {
128 chapter09TestCompoundAlignment(new Bindingtest1p1Impl());
129 }
130
131 /**
132 * This covers compounds (structs) call-by-reference
133 */
134 @Test
135 public void chapter10TestCompoundCallByReference() throws Exception {
136 chapter10TestCompoundCallByReference(new Bindingtest1p1Impl());
137 }
138
139 /**
140 * This covers compounds (structs) call-by-value
141 */
142 @Test
143 public void chapter11TestCompoundCallByValue() throws Exception {
144 chapter11TestCompoundCallByValue(new Bindingtest1p1Impl());
145 }
146
147 /**
148 * Test compound access read-write
149 */
150 @Test
151 public void chapter12TestTKField() throws Exception {
152 chapter12TestTKField(new Bindingtest1p1Impl());
153 }
154
155 /**
156 * Test compound access read-only
157 */
158 @Test
159 public void chapter13TestTKFieldImmutable() throws Exception {
160 chapter13TestTKFieldImmutable(new Bindingtest1p1Impl());
161 }
162
163 @Test
164 public void chapter14TestTKMixed() throws Exception {
165 chapter14TestTKMixed(new Bindingtest1p1Impl());
166 }
167
168 /**
169 * Test Custom JNI Code invocation
170 */
171 @Test
172 public void chapter15TestCustomJNICode() throws Exception {
173 chapter15TestCustomJNICode(new Bindingtest1p1Impl());
174 }
175
176 @Test
177 public void chapter16TestPascalString() throws Exception {
178 chapter16TestPascalString(new Bindingtest1p1Impl());
179 }
180
181 public static void main(final String args[]) throws IOException {
182 final String tstname = Test1p1JavaEmitter.class.getName();
183 org.junit.runner.JUnitCore.main(tstname);
184 }
185
186}
static void chapter__TestLoadLibrary()
Verifies loading of the new library.
void chapter00TestClassExist()
Verifies the existence and creation of the generated class.
void chapter__TestCoverageSignature()
Verifies if all generated method signatures are completed, ie a compilation only coverage test withou...
void chapter04TestPointerBuffer()
This covers direct / indirect pointer buffers.
void chapter11TestCompoundCallByValue()
This covers compounds (structs) call-by-value.
void chapter09TestCompoundAlignment()
This covers compounds (structs) data alignment.
void chapter10TestCompoundCallByReference()
This covers compounds (structs) call-by-reference.
void chapter05TestSomeFunctionsAllIndirect()
This covers indirect primitive arrays and indirect NIO buffers.
void chapter03bTestCoverageFunctionalityIndirectNIOAndPrimitiveArray()
Verifies if all methods / signatures are properly generated, can be invoked and functions.
void chapter01TestStaticConstants()
Verifies if all generated static constant values are completed, and whether their value is as expecte...
void chapter03aTestCoverageFunctionalityDirectNIOAndPrimitiveArray()
Verifies if all methods / signatures are properly generated, can be invoked and functions.
void chapter13TestTKFieldImmutable()
Test compound access read-only.
void chapter15TestCustomJNICode()
Test Custom JNI Code invocation.