Skip to content

add missing negative providers tests - #1478

Merged
bratpiorka merged 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_cuda_tests
Oct 26, 2026
Merged

bratpiorka merged 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_cuda_tests

Conversation

@bratpiorka

Copy link
Copy Markdown
Contributor

add missing negative providers tests

@bratpiorka
bratpiorka force-pushed the rrudnick_cuda_tests branch from ca1d1db to 1d1e9e8 Compare August 6, 2025 07:39

@lukaszstolarczuk lukaszstolarczuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment thread src/provider/provider_level_zero.c
@bratpiorka
bratpiorka force-pushed the rrudnick_cuda_tests branch 3 times, most recently from 35a9aac to c23391a Compare August 6, 2025 08:13
@bratpiorka
bratpiorka marked this pull request as ready for review October 20, 2026 17:29
@bratpiorka
bratpiorka requested a review from a team as a code owner October 20, 2026 17:29
Comment thread test/providers/provider_cuda.cpp
Comment thread test/providers/provider_cuda.cpp
@bratpiorka
bratpiorka force-pushed the rrudnick_cuda_tests branch 2 times, most recently from 8ebc885 to 55f532b Compare October 22, 2026 15:52
@ldorau

ldorau commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

test.cudaProviderNullName breaks the CUDA dlopen tests

@lukaszstolarczuk lukaszstolarczuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

@ldorau ldorau left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM.

Could you add a test with a very long name? All ...ParamsSetName() functions use strncpy and cut a long name without an error. The test can check that umfMemoryProviderGetName() returns the cut name and that it ends with '\0'. You can put it next to params_NULL_name in provider_file_memory.cpp and provider_devdax_memory.cpp.

// test all valid combinations
for (unsigned protection = UMF_PROTECTION_NONE;
protection < (UMF_PROTECTION_MAX - 1) << 1; ++protection) {
ret = umfFileMemoryProviderParamsSetProtection(params, protection);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test can never fail. umfFileMemoryProviderParamsSetProtection() only checks
that hParams is not NULL. It accepts any value. The devdax provider checks the
flags and has a params_invalid_protection_flag test, but the file provider does
not check them. Please add the same check to the file provider and add a
params_invalid_protection_flag test. Or remove this test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check + new test added

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

umf_result = umfDevDaxMemoryProviderParamsSetName(params, "test");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: params is always nullptr here. The other calls in this test use
nullptr directly. Please use nullptr here too. It is easier to read.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread test/provider_file_memory_not_impl.cpp Outdated
umfFileMemoryProviderParamsSetVisibility(nullptr, UMF_MEM_MAP_PRIVATE);
EXPECT_EQ(umf_result, UMF_RESULT_ERROR_NOT_SUPPORTED);

umf_result = umfFileMemoryProviderParamsSetName(params, "test");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same as in the devdax test. Please use nullptr instead of params.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@bratpiorka
bratpiorka force-pushed the rrudnick_cuda_tests branch 5 times, most recently from c0d1349 to a6bdba3 Compare October 26, 2026 09:11
@bratpiorka
bratpiorka merged commit c611be1 into oneapi-src:main Oct 26, 2026
138 of 143 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants