diff --git a/unit_tests/native/native_impl.cpp b/unit_tests/native/native_impl.cpp index 94b9c4dbfa..1dc59bb97d 100644 --- a/unit_tests/native/native_impl.cpp +++ b/unit_tests/native/native_impl.cpp @@ -11,13 +11,13 @@ #include -static std::unique_ptr eth; +static std::unique_ptr ethPtr; static EngineTestHelper* getEth() { - if (!eth) { - eth = std::make_unique(TEST_ENGINE); + if (!ethPtr) { + ethPtr = std::make_unique(TEST_ENGINE); } - return eth.get(); + return ethPtr.get(); } JNIEXPORT jstring JNICALL Java_com_rusefi_native_1_EngineLogic_getVersion(JNIEnv * env, jobject) { @@ -63,6 +63,7 @@ JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_invokePeriodicCallba JNIEXPORT jbyteArray JNICALL Java_com_rusefi_native_1_EngineLogic_getOutputs(JNIEnv * env, jobject instance) { jbyteArray retVal = env->NewByteArray(sizeof(TunerStudioOutputChannels)); jbyte *buf = env->GetByteArrayElements(retVal, NULL); + EngineTestHelper* eth = getEth(); memcpy(buf, (const void*)ð->engine.outputChannels, sizeof(TunerStudioOutputChannels)); env->ReleaseByteArrayElements(retVal, buf, 0);