Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests

  • Loading branch information...
commit e53ded2a33e94acea13aa6c03a88b2f9f9f1d7d7 1 parent d3cf65f
@pke authored
View
7 com.sun.jna.examples.win32.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
28 com.sun.jna.examples.win32.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.sun.jna.examples.win32.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
12 com.sun.jna.examples.win32.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Tue Feb 23 21:43:36 CET 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
View
4 com.sun.jna.examples.win32.tests/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Tue Feb 23 21:42:18 CET 2010
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
View
9 com.sun.jna.examples.win32.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Unit Tests
+Bundle-SymbolicName: com.sun.jna.examples.win32.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Philipp Kursawe
+Fragment-Host: com.sun.jna.examples.win32;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit;bundle-version="4.8.1"
View
4 com.sun.jna.examples.win32.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
View
18 com.sun.jna.examples.win32.tests/src/com/sun/jna/examples/win32/tests/W32APITests.java
@@ -0,0 +1,18 @@
+package com.sun.jna.examples.win32.tests;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.sun.jna.examples.win32.Kernel32;
+import com.sun.jna.examples.win32.W32API;
+import com.sun.jna.examples.win32.W32API.HANDLE;
+
+public class W32APITests {
+
+ @Test
+ public void handleShouldBeInvalid() {
+ HANDLE handle = Kernel32.INSTANCE.CreateFile(null, 0, 0, null, 0, 0, null);
+ assertEquals(W32API.INVALID_HANDLE_VALUE, handle);
+ }
+}
View
2  com.sun.jna.examples.win32/src/com/sun/jna/examples/win32/W32API.java
@@ -136,7 +136,7 @@ public boolean failed() {
}
/** Constant value representing an invalid HANDLE. */
- HANDLE INVALID_HANDLE_VALUE = new HANDLE(Pointer.createConstant(0xffffffff));
+ HANDLE INVALID_HANDLE_VALUE = new HANDLE(Pointer.createConstant(0xffffffffL));
/** Special HWND value. */
HWND HWND_BROADCAST = new HWND(Pointer.createConstant(0xFFFF));
View
13 file.monitor.target/Example.target
@@ -5,12 +5,19 @@
<locations>
<location path="${eclipse_home}" type="Profile">
<includeBundles>
-<plugin id="org.eclipse.equinox.util"/>
-<plugin id="org.eclipse.equinox.ds"/>
+<plugin id="org.eclipse.jdt.junit"/>
+<plugin id="org.eclipse.jdt.junit.core"/>
+<plugin id="org.eclipse.jdt.junit4.runtime"/>
<plugin id="com.sun.jna"/>
-<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.services"/>
+<plugin id="org.eclipse.pde.junit.runtime"/>
+<plugin id="org.eclipse.equinox.ds"/>
+<plugin id="org.hamcrest.core"/>
<plugin id="org.eclipse.equinox.event"/>
+<plugin id="org.eclipse.equinox.util"/>
+<plugin id="org.junit" version="4.8.1.v4_8_1_v20100114-1600"/>
+<plugin id="org.eclipse.jdt.junit.runtime"/>
+<plugin id="org.eclipse.osgi"/>
</includeBundles>
</location>
<location path="${project_loc}" type="Directory"/>
Please sign in to comment.
Something went wrong with that request. Please try again.