You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2017/11/29 02:39:38 UTC

[GitHub] mkiiskila closed pull request #684: net/nimble/host unittest; change null initialization to memset.

mkiiskila closed pull request #684: net/nimble/host unittest; change null initialization to memset.
URL: https://github.com/apache/mynewt-core/pull/684
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/net/nimble/host/test/src/ble_hs_hci_test.c b/net/nimble/host/test/src/ble_hs_hci_test.c
index 48be4b303..3bcadd0d9 100644
--- a/net/nimble/host/test/src/ble_hs_hci_test.c
+++ b/net/nimble/host/test/src/ble_hs_hci_test.c
@@ -85,13 +85,14 @@ TEST_CASE(ble_hs_hci_test_rssi)
 
 TEST_CASE(ble_hs_hci_acl_one_conn)
 {
-    struct ble_hs_test_util_hci_num_completed_pkts_entry ncpe[2] = { 0 };
+    struct ble_hs_test_util_hci_num_completed_pkts_entry ncpe[2];
     struct hci_disconn_complete evt;
     uint8_t peer_addr[6] = { 1, 2, 3, 4, 5, 6 };
     uint8_t data[256];
     int rc;
     int i;
 
+    memset(ncpe, 0, sizeof(ncpe));
     for (i = 0; i < sizeof data; i++) {
         data[i] = i;
     }
@@ -168,7 +169,7 @@ TEST_CASE(ble_hs_hci_acl_one_conn)
 
 TEST_CASE(ble_hs_hci_acl_two_conn)
 {
-    struct ble_hs_test_util_hci_num_completed_pkts_entry ncpe[2] = { 0 };
+    struct ble_hs_test_util_hci_num_completed_pkts_entry ncpe[2];
     const struct ble_hs_conn *conn1;
     const struct ble_hs_conn *conn2;
     uint8_t peer_addr1[6] = { 1, 2, 3, 4, 5, 6 };
@@ -177,6 +178,7 @@ TEST_CASE(ble_hs_hci_acl_two_conn)
     int rc;
     int i;
 
+    memset(ncpe, 0, sizeof(ncpe));
     for (i = 0; i < sizeof data; i++) {
         data[i] = i;
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services