GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
TestStructGen02.java
Go to the documentation of this file.
1package com.jogamp.gluegen.test.junit.structgen;
2
3import com.jogamp.common.os.Platform;
4import com.jogamp.junit.util.SingletonJunitCase;
5
6import org.junit.Assert;
7import org.junit.BeforeClass;
8import org.junit.Test;
9import org.junit.FixMethodOrder;
10import org.junit.runners.MethodSorters;
11
12@FixMethodOrder(MethodSorters.NAME_ASCENDING)
13public class TestStructGen02 extends SingletonJunitCase {
14
15 @BeforeClass
16 public static void init() {
17 // Enforce dependency,
18 // i.e. CStruct annotation processor to generate the types 'RenderingConfig' etc.
21 }
22
23 @Test
24 public void test01() {
25 final Pixel pixel = Pixel.create();
26 final Col4f color = pixel.getColor();
27 color.setR(1f);
28 color.setG(2f);
29 color.setB(3f);
30 color.setA(4f);
31 final Vec3f pos = pixel.getPos();
32 pos.setX(0.5f);
33 pos.setY(0.6f);
34 pos.setZ(0.7f);
35
36 final Pixel pixel2 = Pixel.create(pixel.getBuffer());
37 final Col4f color2 = pixel2.getColor();
38 Assert.assertEquals(color.getR(), color2.getR(), 0.0001f);
39 Assert.assertEquals(color.getG(), color2.getG(), 0.0001f);
40 Assert.assertEquals(color.getB(), color2.getB(), 0.0001f);
41 Assert.assertEquals(color.getA(), color2.getA(), 0.0001f);
42 final Vec3f pos2 = pixel2.getPos();
43 Assert.assertEquals(pos.getX(), pos2.getX(), 0.0001f);
44 Assert.assertEquals(pos.getY(), pos2.getY(), 0.0001f);
45 Assert.assertEquals(pos.getZ(), pos2.getZ(), 0.0001f);
46 }
47
48 public static void main(final String args[]) {
49 final String tstname = TestStructGen02.class.getName();
50 org.junit.runner.JUnitCore.main(tstname);
51 }
52
53}
Utility class for querying platform specific properties.
Definition: Platform.java:58
static void initSingleton()
kick off static initialization of platform property information and native gluegen_rt lib loading
Definition: Platform.java:359
Class simply triggering CStruct annotation processor to generate the types 'RenderingConfig' etc.