From 3db75f82ed8ab77228aa43193669f8aeec163e95 Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Wed, 13 Mar 2019 08:25:22 -0700 Subject: [PATCH] controller: Update unit tests to use new testutil The testutil API chnaged with this PR: https://github.com/apache/mynewt-core/pull/1678 This commit changes the controller unit tests to use the updated testutil API. --- nimble/controller/test/src/ble_ll_csa2_test.c | 14 +++------- nimble/controller/test/src/ble_ll_csa2_test.h | 27 +++++++++++++++++++ nimble/controller/test/src/ble_ll_test.c | 6 ++--- 3 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 nimble/controller/test/src/ble_ll_csa2_test.h diff --git a/nimble/controller/test/src/ble_ll_csa2_test.c b/nimble/controller/test/src/ble_ll_csa2_test.c index 891c23c1e..5261eb5be 100644 --- a/nimble/controller/test/src/ble_ll_csa2_test.c +++ b/nimble/controller/test/src/ble_ll_csa2_test.c @@ -22,8 +22,9 @@ #include "testutil/testutil.h" #include "controller/ble_ll_test.h" #include "controller/ble_ll_conn.h" +#include "ble_ll_csa2_test.h" -TEST_CASE(ble_ll_csa2_test_1) +TEST_CASE_SELF(ble_ll_csa2_test_1) { struct ble_ll_conn_sm conn; uint8_t rc; @@ -65,7 +66,7 @@ TEST_CASE(ble_ll_csa2_test_1) TEST_ASSERT(rc == 21); } -TEST_CASE(ble_ll_csa2_test_2) +TEST_CASE_SELF(ble_ll_csa2_test_2) { struct ble_ll_conn_sm conn; uint8_t rc; @@ -112,12 +113,3 @@ TEST_SUITE(ble_ll_csa2_test_suite) ble_ll_csa2_test_1(); ble_ll_csa2_test_2(); } - -int -ble_ll_csa2_test_all(void) -{ - ble_ll_csa2_test_1(); - ble_ll_csa2_test_2(); - - return tu_any_failed; -} diff --git a/nimble/controller/test/src/ble_ll_csa2_test.h b/nimble/controller/test/src/ble_ll_csa2_test.h new file mode 100644 index 000000000..5bcc142bb --- /dev/null +++ b/nimble/controller/test/src/ble_ll_csa2_test.h @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef H_BLE_LL_CSA2_TEST_ +#define H_BLE_LL_CSA2_TEST_ + +#include "testutil/testutil.h" + +TEST_SUITE_DECL(ble_ll_csa2_test_suite); + +#endif diff --git a/nimble/controller/test/src/ble_ll_test.c b/nimble/controller/test/src/ble_ll_test.c index 01a8b2e8a..ee089afe7 100644 --- a/nimble/controller/test/src/ble_ll_test.c +++ b/nimble/controller/test/src/ble_ll_test.c @@ -22,16 +22,14 @@ #include "controller/ble_ll_test.h" #include "os/os.h" #include "testutil/testutil.h" +#include "ble_ll_csa2_test.h" #if MYNEWT_VAL(SELFTEST) int main(int argc, char **argv) { - sysinit(); - - ble_ll_csa2_test_all(); - + ble_ll_csa2_test_suite(); return tu_any_failed; }