Skip to content

Commit

Permalink
Add test for not implemented devdax provider
Browse files Browse the repository at this point in the history
  • Loading branch information
vinser52 committed Nov 27, 2024
1 parent 87e096e commit dd73f61
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ else()
NAME provider_file_memory_not_impl
SRCS provider_file_memory_not_impl.cpp
LIBS ${UMF_UTILS_FOR_TEST})
add_umf_test(
NAME provider_devdax_memory_not_impl
SRCS provider_devdax_memory_not_impl.cpp
LIBS ${UMF_UTILS_FOR_TEST})
endif()

if(UMF_BUILD_GPU_TESTS AND UMF_BUILD_LEVEL_ZERO_PROVIDER)
Expand Down
30 changes: 30 additions & 0 deletions test/provider_devdax_memory_not_impl.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 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 "base.hpp"

#include <umf/providers/provider_devdax_memory.h>

using umf_test::test;

TEST_F(test, devdax_provider_not_implemented) {
umf_devdax_memory_provider_params_handle_t params = nullptr;
umf_result_t umf_result =
umfDevDaxMemoryProviderParamsCreate(&params, "path", 4096);
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);
EXPECT_EQ(params, nullptr);

umf_result = umfDevDaxMemoryProviderParamsDestroy(nullptr);
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);

umf_result =
umfDevDaxMemoryProviderParamsSetDeviceDax(nullptr, "path", 4096);
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);

umf_result = umfDevDaxMemoryProviderParamsSetProtection(nullptr, 0);
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);

umf_memory_provider_ops_t *ops = umfDevDaxMemoryProviderOps();
EXPECT_EQ(ops, nullptr);
}

0 comments on commit dd73f61

Please sign in to comment.