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 ddcffbc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions contrib/platform/test/com/sun/jna/platform/unix/LibCTest.java
Expand Up @@ -24,6 +24,10 @@
package com.sun.jna.platform.unix;

import com.sun.jna.Native;
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 +42,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 ddcffbc

Please sign in to comment.