You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm starting a embedded project wich uses ESP32 microcontroller using the Arduino Framework and some modules like a Sigfox Module. I want to test a function which send messages via Sigfox:
void sigfoxSendMsg(String buf_tx)
{
//Adding line break
buf_tx += "\n";
//******************************
//Enable Sigfox Module
digitalWrite(SIGFOX_ENABLE, HIGH);
delay(1000);
#ifndef TEST
//Channel reset to ensure correct frequency
Serial1.print("AT$RC\n");
//******************************
//Sending data on Sigfox
Serial1.print(buf_tx);
#else
Serial.print("AT$RC\n");
Serial.print(buf_tx);
#endif
#ifdef SIGFOX_DEBUG
#ifndef TEST
Serial.print(buf_tx);
#endif
#endif
delay(3000);
//disable sigfox module
digitalWrite(SIGFOX_ENABLE, LOW);
}
The result of the test show me how the function Serial.print() wasn't mocked:
Building...
Testing...
Program errored with 3221225477 code
How can i fix these errors? I believe that I'am mocking Serial.print() wrongly. Additionaly, there is a way to use Serial1.print() instead of Serial.print() with ArduinoFake? It would help me to other functions that I want to adapt to test also.
The text was updated successfully, but these errors were encountered:
I'm starting a embedded project wich uses ESP32 microcontroller using the Arduino Framework and some modules like a Sigfox Module. I want to test a function which send messages via Sigfox:
But when I test it with my test function:
The result of the test show me how the function Serial.print() wasn't mocked:
How can i fix these errors? I believe that I'am mocking Serial.print() wrongly. Additionaly, there is a way to use Serial1.print() instead of Serial.print() with ArduinoFake? It would help me to other functions that I want to adapt to test also.
The text was updated successfully, but these errors were encountered: