From 355b6f52b3eae229c2e7b79b912533276262e546 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Thu, 26 Apr 2018 11:17:27 +0200 Subject: [PATCH] nimble/host: Fix tests build --- nimble/host/src/ble_hs_hci.c | 5 ++--- nimble/host/test/src/ble_gatt_disc_c_test.c | 8 ++++---- nimble/host/test/src/ble_gatt_disc_d_test.c | 4 ++-- nimble/host/test/src/ble_gatt_disc_s_test.c | 10 +++++----- nimble/host/test/src/ble_gatt_find_s_test.c | 2 +- nimble/host/test/src/ble_gatt_read_test.c | 4 ++-- nimble/host/test/src/ble_gatt_write_test.c | 8 ++++---- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/nimble/host/src/ble_hs_hci.c b/nimble/host/src/ble_hs_hci.c index bbd6c7970..abce71c51 100644 --- a/nimble/host/src/ble_hs_hci.c +++ b/nimble/host/src/ble_hs_hci.c @@ -243,7 +243,6 @@ ble_hs_hci_process_ack(uint16_t expected_opcode, static int ble_hs_hci_wait_for_ack(void) { - uint32_t cmd_tmo; int rc; #if MYNEWT_VAL(BLE_HS_PHONY_HCI_ACKS) @@ -256,8 +255,8 @@ ble_hs_hci_wait_for_ack(void) rc = ble_hs_hci_phony_ack_cb(ble_hs_hci_ack, 260); } #else - cmd_tmo = os_time_ms_to_ticks32(BLE_HCI_CMD_TIMEOUT_MS); - rc = os_sem_pend(&ble_hs_hci_sem, cmd_tmo); + rc = os_sem_pend(&ble_hs_hci_sem, + os_time_ms_to_ticks32(BLE_HCI_CMD_TIMEOUT_MS)); switch (rc) { case 0: BLE_HS_DBG_ASSERT(ble_hs_hci_ack != NULL); diff --git a/nimble/host/test/src/ble_gatt_disc_c_test.c b/nimble/host/test/src/ble_gatt_disc_c_test.c index 787e49565..c285ef524 100644 --- a/nimble/host/test/src/ble_gatt_disc_c_test.c +++ b/nimble/host/test/src/ble_gatt_disc_c_test.c @@ -583,7 +583,7 @@ TEST_CASE(ble_gatt_disc_c_test_oom_all) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -604,7 +604,7 @@ TEST_CASE(ble_gatt_disc_c_test_oom_all) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify that procedure completes when mbufs are available. */ rc = os_mbuf_free_chain(oms); @@ -670,7 +670,7 @@ TEST_CASE(ble_gatt_disc_c_test_oom_uuid) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -690,7 +690,7 @@ TEST_CASE(ble_gatt_disc_c_test_oom_uuid) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify that procedure completes when mbufs are available. */ rc = os_mbuf_free_chain(oms); diff --git a/nimble/host/test/src/ble_gatt_disc_d_test.c b/nimble/host/test/src/ble_gatt_disc_d_test.c index 58a8c3731..263c9e4a7 100644 --- a/nimble/host/test/src/ble_gatt_disc_d_test.c +++ b/nimble/host/test/src/ble_gatt_disc_d_test.c @@ -400,7 +400,7 @@ TEST_CASE(ble_gatt_disc_d_test_oom_all) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -420,7 +420,7 @@ TEST_CASE(ble_gatt_disc_d_test_oom_all) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure succeeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); diff --git a/nimble/host/test/src/ble_gatt_disc_s_test.c b/nimble/host/test/src/ble_gatt_disc_s_test.c index 60cf71d6a..6714ce6ba 100644 --- a/nimble/host/test/src/ble_gatt_disc_s_test.c +++ b/nimble/host/test/src/ble_gatt_disc_s_test.c @@ -434,7 +434,7 @@ TEST_CASE(ble_gatt_disc_s_test_oom_all) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -454,7 +454,7 @@ TEST_CASE(ble_gatt_disc_s_test_oom_all) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); rc = os_mbuf_free_chain(oms); TEST_ASSERT_FATAL(rc == 0); @@ -511,7 +511,7 @@ TEST_CASE(ble_gatt_disc_s_test_oom_uuid) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -531,7 +531,7 @@ TEST_CASE(ble_gatt_disc_s_test_oom_uuid) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify that procedure completes when mbufs are available. */ rc = os_mbuf_free_chain(oms); @@ -592,7 +592,7 @@ TEST_CASE(ble_gatt_disc_s_test_oom_timeout) * second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); os_time_advance(ticks_until); } diff --git a/nimble/host/test/src/ble_gatt_find_s_test.c b/nimble/host/test/src/ble_gatt_find_s_test.c index 5cd2c220a..3d478ef18 100644 --- a/nimble/host/test/src/ble_gatt_find_s_test.c +++ b/nimble/host/test/src/ble_gatt_find_s_test.c @@ -387,7 +387,7 @@ TEST_CASE(ble_gatt_find_s_test_oom) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure succeeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); diff --git a/nimble/host/test/src/ble_gatt_read_test.c b/nimble/host/test/src/ble_gatt_read_test.c index 59caaa980..c1281bfec 100644 --- a/nimble/host/test/src/ble_gatt_read_test.c +++ b/nimble/host/test/src/ble_gatt_read_test.c @@ -855,7 +855,7 @@ TEST_CASE(ble_gatt_read_test_long_oom) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -878,7 +878,7 @@ TEST_CASE(ble_gatt_read_test_long_oom) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify that procedure completes when mbufs are available. */ rc = os_mbuf_free_chain(oms); diff --git a/nimble/host/test/src/ble_gatt_write_test.c b/nimble/host/test/src/ble_gatt_write_test.c index 072da1ed4..ff9adc667 100644 --- a/nimble/host/test/src/ble_gatt_write_test.c +++ b/nimble/host/test/src/ble_gatt_write_test.c @@ -655,7 +655,7 @@ TEST_CASE(ble_gatt_write_test_long_oom) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -681,7 +681,7 @@ TEST_CASE(ble_gatt_write_test_long_oom) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify that procedure completes when mbufs are available. */ rc = os_mbuf_free_chain(oms); @@ -749,7 +749,7 @@ TEST_CASE(ble_gatt_write_test_reliable_oom) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify the procedure proceeds after mbufs become available. */ rc = os_mbuf_free_chain(oms); @@ -775,7 +775,7 @@ TEST_CASE(ble_gatt_write_test_reliable_oom) /* Verify that we will resume the stalled GATT procedure in one second. */ ticks_until = ble_gattc_timer(); - TEST_ASSERT(ticks_until == BLE_GATT_RESUME_RATE_TICKS); + TEST_ASSERT(ticks_until == os_time_ms_to_ticks32(MYNEWT_VAL(BLE_GATT_RESUME_RATE))); /* Verify that procedure completes when mbufs are available. */ rc = os_mbuf_free_chain(oms);