Skip to content

Commit

Permalink
use z_take_from_loaned macro in test
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Feb 18, 2025
1 parent 1cbe708 commit 0b21450
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/z_api_null_drop_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
assert(!z_internal_check(v)); \
}

#define TEST_TAKE_MUT(name, take_loan_func) \
{ \
name v; \
name v1; \
z_internal_null(&v1); \
memset(&v, -1, sizeof(v)); \
take_loan_func(&v1, z_loan_mut(v)); \
assert(!z_internal_check(v)); \
#define TEST_TAKE_MUT(name) \
{ \
name v; \
name v1; \
z_internal_null(&v1); \
memset(&v, -1, sizeof(v)); \
z_take_from_loaned(&v1, z_loan_mut(v)); \
assert(!z_internal_check(v)); \
}

int main(void) {
Expand Down Expand Up @@ -86,10 +86,10 @@ int main(void) {
// TEST(z_owned_mutex_t)
// TEST(z_owned_condvar_t)

TEST_TAKE_MUT(z_owned_sample_t, z_sample_take_from_loaned)
TEST_TAKE_MUT(z_owned_query_t, z_query_take_from_loaned)
TEST_TAKE_MUT(z_owned_reply_t, z_reply_take_from_loaned)
TEST_TAKE_MUT(z_owned_hello_t, z_hello_take_from_loaned)
TEST_TAKE_MUT(z_owned_sample_t)
TEST_TAKE_MUT(z_owned_query_t)
TEST_TAKE_MUT(z_owned_reply_t)
TEST_TAKE_MUT(z_owned_hello_t)

return 0;
}

0 comments on commit 0b21450

Please sign in to comment.