1
/* Copyright (c) 2009 Timothy Wall, All Rights Reserved
3
* This library is free software; you can redistribute it and/or
4
* modify it under the terms of the GNU Lesser General Public
5
* License as published by the Free Software Foundation; either
6
* version 2.1 of the License, or (at your option) any later version.
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
15
import com.sun.jna.ptr.ByteByReference;
16
import com.sun.jna.ptr.DoubleByReference;
17
import com.sun.jna.ptr.FloatByReference;
18
import com.sun.jna.ptr.IntByReference;
19
import com.sun.jna.ptr.LongByReference;
20
import com.sun.jna.ptr.NativeLongByReference;
21
import com.sun.jna.ptr.PointerByReference;
22
import com.sun.jna.ptr.ShortByReference;
24
/** Exercise a range of native methods.
26
* @author twall@users.sf.net
28
public class DirectByReferenceArgumentsTest extends ByReferenceArgumentsTest {
30
public static class DirectTestLibrary implements TestLibrary {
32
public native void incrementInt8ByReference(ByteByReference b);
33
public native void incrementInt16ByReference(ShortByReference s);
34
public native void incrementInt32ByReference(IntByReference i);
35
public native void incrementNativeLongByReference(NativeLongByReference i);
36
public native void incrementInt64ByReference(LongByReference l);
37
public native void complementFloatByReference(FloatByReference f);
38
public native void complementDoubleByReference(DoubleByReference d);
39
public native void setPointerByReferenceNull(PointerByReference p);
42
Native.register("testlib");
46
protected void setUp() {
47
lib = new DirectTestLibrary();
50
public static void main(java.lang.String[] argList) {
51
junit.textui.TestRunner.run(DirectByReferenceArgumentsTest.class);