diff --git a/hal/src/test/java/edu/wpi/first/hal/JNITest.java b/hal/src/test/java/edu/wpi/first/hal/JNITest.java new file mode 100644 index 0000000000..49e201d326 --- /dev/null +++ b/hal/src/test/java/edu/wpi/first/hal/JNITest.java @@ -0,0 +1,15 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package edu.wpi.first.hal; + +import org.junit.jupiter.api.Test; + +public class JNITest { + @Test + void jniLinkTest() { + // Test to verify that the JNI test link works correctly. + HAL.initialize(500, 0); + } +} diff --git a/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp b/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp index d82a7db797..ca5b6a6466 100644 --- a/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp +++ b/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp @@ -25,7 +25,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { return JNI_ERR; } - serviceDataCls = JClass{env, "edu/wpi/first/util/ServiceData"}; + serviceDataCls = JClass{env, "edu/wpi/first/net/ServiceData"}; if (!serviceDataCls) { return JNI_ERR; } diff --git a/wpinet/src/test/java/edu/wpi/first/net/WPINetJNITest.java b/wpinet/src/test/java/edu/wpi/first/net/WPINetJNITest.java index 1199e7c03b..dfa6d4d952 100644 --- a/wpinet/src/test/java/edu/wpi/first/net/WPINetJNITest.java +++ b/wpinet/src/test/java/edu/wpi/first/net/WPINetJNITest.java @@ -4,4 +4,12 @@ package edu.wpi.first.net; -public class WPINetJNITest {} +import java.io.IOException; +import org.junit.jupiter.api.Test; + +public class WPINetJNITest { + @Test + void jniLinkTest() throws IOException { + WPINetJNI.forceLoad(); + } +}