Skip to content

Commit dd73f61

Browse files
committed
Add test for not implemented devdax provider
1 parent 87e096e commit dd73f61

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ else()
343343
NAME provider_file_memory_not_impl
344344
SRCS provider_file_memory_not_impl.cpp
345345
LIBS ${UMF_UTILS_FOR_TEST})
346+
add_umf_test(
347+
NAME provider_devdax_memory_not_impl
348+
SRCS provider_devdax_memory_not_impl.cpp
349+
LIBS ${UMF_UTILS_FOR_TEST})
346350
endif()
347351

348352
if(UMF_BUILD_GPU_TESTS AND UMF_BUILD_LEVEL_ZERO_PROVIDER)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (C) 2024 Intel Corporation
2+
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
#include "base.hpp"
6+
7+
#include <umf/providers/provider_devdax_memory.h>
8+
9+
using umf_test::test;
10+
11+
TEST_F(test, devdax_provider_not_implemented) {
12+
umf_devdax_memory_provider_params_handle_t params = nullptr;
13+
umf_result_t umf_result =
14+
umfDevDaxMemoryProviderParamsCreate(&params, "path", 4096);
15+
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);
16+
EXPECT_EQ(params, nullptr);
17+
18+
umf_result = umfDevDaxMemoryProviderParamsDestroy(nullptr);
19+
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);
20+
21+
umf_result =
22+
umfDevDaxMemoryProviderParamsSetDeviceDax(nullptr, "path", 4096);
23+
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);
24+
25+
umf_result = umfDevDaxMemoryProviderParamsSetProtection(nullptr, 0);
26+
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);
27+
28+
umf_memory_provider_ops_t *ops = umfDevDaxMemoryProviderOps();
29+
EXPECT_EQ(ops, nullptr);
30+
}

0 commit comments

Comments
 (0)