JNI for test coverage #3965
This commit is contained in:
parent
7a0cb64b95
commit
b005a049e2
|
@ -12,6 +12,8 @@ public class EngineLogic {
|
||||||
|
|
||||||
public native void setConfiguration(byte[] content, int offset, int size);
|
public native void setConfiguration(byte[] content, int offset, int size);
|
||||||
|
|
||||||
|
public native void setEngineType(int engineType);
|
||||||
|
|
||||||
public native void invokePeriodicCallback();
|
public native void invokePeriodicCallback();
|
||||||
|
|
||||||
public native byte[] getOutputs();
|
public native byte[] getOutputs();
|
||||||
|
|
|
@ -39,6 +39,14 @@ JNIEXPORT jbyteArray JNICALL Java_com_rusefi_native_1_EngineLogic_getConfigurati
|
||||||
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setConfiguration
|
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setConfiguration
|
||||||
(JNIEnv *, jobject, jbyteArray, jint, jint);
|
(JNIEnv *, jobject, jbyteArray, jint, jint);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: com_rusefi_native__EngineLogic
|
||||||
|
* Method: setEngineType
|
||||||
|
* Signature: (I)V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setEngineType
|
||||||
|
(JNIEnv *, jobject, jint);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: com_rusefi_native__EngineLogic
|
* Class: com_rusefi_native__EngineLogic
|
||||||
* Method: invokePeriodicCallback
|
* Method: invokePeriodicCallback
|
||||||
|
|
|
@ -30,7 +30,14 @@ JNIEXPORT jstring JNICALL Java_com_rusefi_native_1_EngineLogic_getVersion(JNIEnv
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jbyteArray JNICALL Java_com_rusefi_native_1_EngineLogic_getConfiguration(JNIEnv *env, jobject instance) {
|
JNIEXPORT jbyteArray JNICALL Java_com_rusefi_native_1_EngineLogic_getConfiguration(JNIEnv *env, jobject instance) {
|
||||||
return nullptr;
|
jbyteArray retVal = env->NewByteArray(sizeof(engine_configuration_s));
|
||||||
|
jbyte *buf = env->GetByteArrayElements(retVal, NULL);
|
||||||
|
EngineTestHelper* eth = getEth();
|
||||||
|
|
||||||
|
memcpy(buf, (const void*)ð->persistentConfig.engineConfiguration, sizeof(engine_configuration_s));
|
||||||
|
env->ReleaseByteArrayElements(retVal, buf, 0);
|
||||||
|
|
||||||
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setConfiguration(JNIEnv *env, jobject instance,
|
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setConfiguration(JNIEnv *env, jobject instance,
|
||||||
|
@ -53,6 +60,12 @@ JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setSensor
|
||||||
env->ReleaseStringUTFChars(sensorName, sensorNameNative);
|
env->ReleaseStringUTFChars(sensorName, sensorNameNative);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_setEngineType
|
||||||
|
(JNIEnv *, jobject, jint engineType) {
|
||||||
|
EngineTestHelper* eth = getEth();
|
||||||
|
resetConfigurationExt((engine_type_e)engineType);
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_invokePeriodicCallback
|
JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_invokePeriodicCallback
|
||||||
(JNIEnv *, jobject) {
|
(JNIEnv *, jobject) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue