Merge pull request #8611 from AnttiKauppila/ut_fix

Unittest fixes
pull/8633/head
Anna Bridge 2018-11-02 16:17:59 +00:00 committed by GitHub
commit 5a8a598773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -190,6 +190,7 @@ TEST_F(Test_LoRaPHYCN470, rx_config)
TEST_F(Test_LoRaPHYCN470, tx_config) TEST_F(Test_LoRaPHYCN470, tx_config)
{ {
tx_config_params_t p; tx_config_params_t p;
memset(&p, 0, sizeof(p));
int8_t tx = 0; int8_t tx = 0;
lorawan_time_t time = 0; lorawan_time_t time = 0;
p.tx_power = 9; p.tx_power = 9;

View File

@ -63,18 +63,21 @@ void my_callback()
TEST_F(Test_LoRaWANTimer, init) TEST_F(Test_LoRaWANTimer, init)
{ {
timer_event_t ev; timer_event_t ev;
memset(&ev, 0, sizeof(ev));
object->init(ev, my_callback); object->init(ev, my_callback);
} }
TEST_F(Test_LoRaWANTimer, start) TEST_F(Test_LoRaWANTimer, start)
{ {
timer_event_t ev; timer_event_t ev;
memset(&ev, 0, sizeof(ev));
object->start(ev, 10); object->start(ev, 10);
} }
TEST_F(Test_LoRaWANTimer, stop) TEST_F(Test_LoRaWANTimer, stop)
{ {
timer_event_t ev; timer_event_t ev;
memset(&ev, 0, sizeof(ev));
ev.timer_id = 4; ev.timer_id = 4;
object->stop(ev); object->stop(ev);
EXPECT_TRUE(ev.timer_id == 0); EXPECT_TRUE(ev.timer_id == 0);