File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
subsys/net/lib/azure_iot_hub/src
tests/subsys/net/lib/azure_iot_hub/iot_hub/src Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1098,6 +1098,7 @@ int azure_iot_hub_method_respond(struct azure_iot_hub_result *result)
10981098 }
10991099
11001100 struct mqtt_publish_param param = {
1101+ .message_id = mqtt_helper_msg_id_get (),
11011102 .message .payload .data = result -> payload .ptr ,
11021103 .message .payload .len = result -> payload .size ,
11031104 .message .topic .topic .utf8 = topic ,
Original file line number Diff line number Diff line change @@ -600,13 +600,15 @@ void test_azure_iot_hub_method_respond(void)
600600 iot_hub_state = STATE_CONNECTED ;
601601
602602 __cmock_mqtt_helper_publish_Stub (mqtt_helper_publish_method_respond_stub );
603+ __cmock_mqtt_helper_msg_id_get_ExpectAndReturn (1 );
603604
604605 TEST_ASSERT_EQUAL (0 , azure_iot_hub_method_respond (& result ));
605606}
606607
607608void test_azure_iot_hub_method_respond_not_connected (void )
608609{
609610 struct azure_iot_hub_result result_dummy ;
611+ __cmock_mqtt_helper_msg_id_get_ExpectAndReturn (1 );
610612
611613 TEST_ASSERT_EQUAL (- ENOTCONN , azure_iot_hub_method_respond (& result_dummy ));
612614}
@@ -626,6 +628,7 @@ void test_azure_iot_hub_method_respond_too_long_request_id(void)
626628 };
627629
628630 iot_hub_state = STATE_CONNECTED ;
631+ __cmock_mqtt_helper_msg_id_get_ExpectAndReturn (1 );
629632
630633 TEST_ASSERT_EQUAL (- EFAULT , azure_iot_hub_method_respond (& result ));
631634}
@@ -652,6 +655,7 @@ void test_azure_iot_hub_method_respond_mqtt_fail(void)
652655 iot_hub_state = STATE_CONNECTED ;
653656
654657 __cmock_mqtt_helper_publish_Stub (mqtt_helper_publish_fail_stub );
658+ __cmock_mqtt_helper_msg_id_get_ExpectAndReturn (1 );
655659
656660 TEST_ASSERT_EQUAL (- ENXIO , azure_iot_hub_method_respond (& result ));
657661}
You can’t perform that action at this time.
0 commit comments