diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 68d5ea633c..db21a99a10 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -311,13 +311,15 @@ if(LINUX) ipc_os_prov_consumer SRCS ipc_os_prov_consumer.c - common/ipc_common.c) + common/ipc_common.c + common/ipc_os_prov_common.c) build_umf_test( NAME ipc_os_prov_producer SRCS ipc_os_prov_producer.c - common/ipc_common.c) + common/ipc_common.c + common/ipc_os_prov_common.c) add_umf_ipc_test(TEST ipc_os_prov_anon_fd) add_umf_ipc_test(TEST ipc_os_prov_shm) else() diff --git a/test/common/ipc_common.c b/test/common/ipc_common.c index 919783daf3..7e08e79f0e 100644 --- a/test/common/ipc_common.c +++ b/test/common/ipc_common.c @@ -473,8 +473,3 @@ int run_producer(int port, umf_memory_provider_ops_t *provider_ops, return ret; } - -void memcopy(void *dst, const void *src, size_t size, void *context) { - (void)context; - memcpy(dst, src, size); -} diff --git a/test/common/ipc_common.h b/test/common/ipc_common.h index 6493e7d926..f51a90b46c 100644 --- a/test/common/ipc_common.h +++ b/test/common/ipc_common.h @@ -8,8 +8,6 @@ #ifndef IPC_COMMON_H #define IPC_COMMON_H -#include - #include // pointer to the function that returns void and accept two int values @@ -26,6 +24,4 @@ int run_consumer(int port, umf_memory_provider_ops_t *provider_ops, void *provider_params, memcopy_callback_t memcopy_callback, void *memcopy_ctx); -void memcopy(void *dst, const void *src, size_t size, void *context); - #endif // IPC_COMMON_H diff --git a/test/common/ipc_os_prov_common.c b/test/common/ipc_os_prov_common.c new file mode 100644 index 0000000000..0adda44e53 --- /dev/null +++ b/test/common/ipc_os_prov_common.c @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +#include + +#include "ipc_os_prov_common.h" + +void memcopy(void *dst, const void *src, size_t size, void *context) { + (void)context; + memcpy(dst, src, size); +} diff --git a/test/common/ipc_os_prov_common.h b/test/common/ipc_os_prov_common.h new file mode 100644 index 0000000000..adcb27e0a5 --- /dev/null +++ b/test/common/ipc_os_prov_common.h @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2024 Intel Corporation + * + * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +#ifndef IPC_OS_PROV_COMMON_H +#define IPC_OS_PROV_COMMON_H + +#include + +void memcopy(void *dst, const void *src, size_t size, void *context); + +#endif // IPC_OS_PROV_COMMON_H diff --git a/test/ipc_os_prov_consumer.c b/test/ipc_os_prov_consumer.c index 1e39476685..7df1e7049f 100644 --- a/test/ipc_os_prov_consumer.c +++ b/test/ipc_os_prov_consumer.c @@ -11,6 +11,7 @@ #include #include "ipc_common.h" +#include "ipc_os_prov_common.h" int main(int argc, char *argv[]) { if (argc < 2) { diff --git a/test/ipc_os_prov_producer.c b/test/ipc_os_prov_producer.c index 98ef5320e0..a9a2ab56c7 100644 --- a/test/ipc_os_prov_producer.c +++ b/test/ipc_os_prov_producer.c @@ -11,6 +11,7 @@ #include #include "ipc_common.h" +#include "ipc_os_prov_common.h" int main(int argc, char *argv[]) { if (argc < 2) {