Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-13720 common: Check return code for negative value (#12416) #12477

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/common/tests/acl_api_tests.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2019-2021 Intel Corporation.
* (C) Copyright 2019-2023 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -1035,7 +1035,8 @@ test_acl_add_ace_everyone_to_existing_list(void **state)
static void
expect_add_duplicate_ace_unchanged(enum daos_acl_principal_type type)
{
int num_aces = NUM_DAOS_ACL_TYPES;
int num_aces = NUM_DAOS_ACL_TYPES;
ssize_t size;
struct daos_ace *ace[num_aces];
struct daos_ace *new_ace;
struct daos_acl *acl;
Expand All @@ -1046,10 +1047,11 @@ expect_add_duplicate_ace_unchanged(enum daos_acl_principal_type type)
orig_acl = daos_acl_dup(acl);

/* Create an exact duplicate */
D_ALLOC(new_ace, daos_ace_get_size(ace[type]));
size = daos_ace_get_size(ace[type]);
assert_true(size > 0);
D_ALLOC(new_ace, size);
assert_non_null(new_ace);
memcpy(new_ace, ace[type],
daos_ace_get_size(ace[type]));
memcpy(new_ace, ace[type], size);

assert_rc_equal(daos_acl_add_ace(&acl, new_ace), 0);

Expand Down