diff --git a/UNITTESTS/stubs/CMakeLists.txt b/UNITTESTS/stubs/CMakeLists.txt index 46dce34..ce1e5ec 100644 --- a/UNITTESTS/stubs/CMakeLists.txt +++ b/UNITTESTS/stubs/CMakeLists.txt @@ -46,7 +46,6 @@ target_include_directories(mbed-stubs-headers INTERFACE . - ${mbed-os_SOURCE_DIR}/connectivity/nanostack/coap-service/test/coap-service/unittest/stub ) add_subdirectory(connectivity) diff --git a/UNITTESTS/stubs/aes_stub.h b/UNITTESTS/stubs/aes_stub.h deleted file mode 100644 index c361b0a..0000000 --- a/UNITTESTS/stubs/aes_stub.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) , Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed 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. - */ - - -#include - -typedef struct { - int int_value; - uint8_t int_zero_counter; -} aes_stub_def; - -extern aes_stub_def aes_stub; diff --git a/UNITTESTS/stubs/cipher_stub.h b/UNITTESTS/stubs/cipher_stub.h deleted file mode 100644 index 9a16f04..0000000 --- a/UNITTESTS/stubs/cipher_stub.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) , Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed 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. - */ - -#include -#include "mbedtls/cipher.h" - -typedef struct { - mbedtls_cipher_info_t *info_value; - int int_value; - int *int_ptr; - uint8_t int_zero_counter; -} cipher_stub_def; - -extern cipher_stub_def cipher_stub; diff --git a/UNITTESTS/stubs/cmac_stub.h b/UNITTESTS/stubs/cmac_stub.h deleted file mode 100644 index 4134f9d..0000000 --- a/UNITTESTS/stubs/cmac_stub.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) , Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed 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. - */ - - -#include - -typedef struct { - int int_value; - uint8_t int_zero_counter; -} cmac_stub_def; - -extern cmac_stub_def cmac_stub; diff --git a/connectivity/mbedtls/tests/UNITTESTS/doubles/CMakeLists.txt b/connectivity/mbedtls/tests/UNITTESTS/doubles/CMakeLists.txt index c7a64c8..631d84f 100644 --- a/connectivity/mbedtls/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/connectivity/mbedtls/tests/UNITTESTS/doubles/CMakeLists.txt @@ -11,6 +11,12 @@ add_library(mbed-stubs-mbedtls) +target_include_directories(mbed-stubs-mbedtls + PUBLIC + . + ${mbed-os_SOURCE_DIR}/connectivity/nanostack/coap-service/test/coap-service/unittest/stub +) + target_sources(mbed-stubs-mbedtls PRIVATE aes_stub.c diff --git a/connectivity/mbedtls/tests/UNITTESTS/doubles/aes_stub.h b/connectivity/mbedtls/tests/UNITTESTS/doubles/aes_stub.h new file mode 100644 index 0000000..c361b0a --- /dev/null +++ b/connectivity/mbedtls/tests/UNITTESTS/doubles/aes_stub.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) , Arm Limited and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed 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. + */ + + +#include + +typedef struct { + int int_value; + uint8_t int_zero_counter; +} aes_stub_def; + +extern aes_stub_def aes_stub; diff --git a/connectivity/mbedtls/tests/UNITTESTS/doubles/cipher_stub.h b/connectivity/mbedtls/tests/UNITTESTS/doubles/cipher_stub.h new file mode 100644 index 0000000..9a16f04 --- /dev/null +++ b/connectivity/mbedtls/tests/UNITTESTS/doubles/cipher_stub.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) , Arm Limited and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed 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. + */ + +#include +#include "mbedtls/cipher.h" + +typedef struct { + mbedtls_cipher_info_t *info_value; + int int_value; + int *int_ptr; + uint8_t int_zero_counter; +} cipher_stub_def; + +extern cipher_stub_def cipher_stub; diff --git a/connectivity/mbedtls/tests/UNITTESTS/doubles/cmac_stub.h b/connectivity/mbedtls/tests/UNITTESTS/doubles/cmac_stub.h new file mode 100644 index 0000000..4134f9d --- /dev/null +++ b/connectivity/mbedtls/tests/UNITTESTS/doubles/cmac_stub.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) , Arm Limited and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed 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. + */ + + +#include + +typedef struct { + int int_value; + uint8_t int_zero_counter; +} cmac_stub_def; + +extern cmac_stub_def cmac_stub;