~ubuntu-branches/ubuntu/wily/libjna-java/wily-proposed

« back to all changes in this revision

Viewing changes to test/com/sun/jna/DirectByReferenceArgumentsTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-11-02 14:14:51 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091102141451-j5hdwzzq5zwxrp4n
* New upstream release.
* Fixed debian/repack-source.sh to correctly use mktemp.
* Make libjna-java Depends on *-headless packages.
* Moved package under pkg-java control.
* Added debian/README.source to describe quilt.
* Added myself as Uploader.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2009 Timothy Wall, All Rights Reserved
 
2
 *
 
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.
 
7
 * <p/>
 
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.  
 
12
 */
 
13
package com.sun.jna;
 
14
 
 
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;
 
23
 
 
24
/** Exercise a range of native methods.
 
25
 *
 
26
 * @author twall@users.sf.net
 
27
 */
 
28
public class DirectByReferenceArgumentsTest extends ByReferenceArgumentsTest {
 
29
 
 
30
    public static class DirectTestLibrary implements TestLibrary {
 
31
 
 
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);
 
40
 
 
41
        static {
 
42
            Native.register("testlib");
 
43
        }
 
44
    }
 
45
 
 
46
    protected void setUp() {
 
47
        lib = new DirectTestLibrary();
 
48
    }
 
49
    
 
50
    public static void main(java.lang.String[] argList) {
 
51
        junit.textui.TestRunner.run(DirectByReferenceArgumentsTest.class);
 
52
    }
 
53
    
 
54
}