Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwiddis committed May 25, 2020
1 parent b94718a commit 1ab1c11
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions contrib/platform/test/com/sun/jna/platform/unix/LibCTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
package com.sun.jna.platform.unix;

import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.platform.unix.LibCAPI.off_t;
import com.sun.jna.platform.unix.LibCAPI.size_t;
import com.sun.jna.platform.unix.LibCAPI.ssize_t;

import java.sql.Date;
import java.util.Map;

Expand All @@ -38,6 +43,19 @@ public LibCTest() {
super();
}

@Test
public void testSizeTypes() {
long VALUE = 20;
size_t st = new size_t(VALUE);
assertEquals("Wrong size_t value", VALUE, st.longValue());
ssize_t sst = new ssize_t(VALUE);
assertEquals("Wrong ssize_t value", VALUE, sst.longValue());
off_t ot = new off_t(VALUE);
assertEquals("Wrong off_t value", VALUE, ot.longValue());
ot = new off_t(VALUE, true);
assertEquals("Wrong 64 bit off_t value", VALUE, ot.longValue());
}

@Test
public void testGetenv() {
Map<String, String> env = System.getenv();
Expand Down

0 comments on commit 1ab1c11

Please sign in to comment.