Skip to content

Commit

Permalink
test: use re_is_aligned() (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh authored Dec 29, 2023
1 parent 9898622 commit d3f12d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion include/re_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ typedef SSIZE_T ssize_t;

/** Check alignment of pointer (p) and byte count (c) **/
#define re_is_aligned(p, c) (((uintptr_t)(const void *)(p)) % (c) == 0)
#define is_aligned re_is_aligned

/** Get the minimal value */
#undef MIN
Expand Down
4 changes: 2 additions & 2 deletions test/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int test_mem(void)
obj->pattern = PATTERN;

TEST_EQUALS(1, mem_nrefs(obj));
TEST_ASSERT(is_aligned(obj, mem_alignment));
TEST_ASSERT(re_is_aligned(obj, mem_alignment));

obj = mem_ref(obj);
TEST_EQUALS(2, mem_nrefs(obj));
Expand All @@ -67,7 +67,7 @@ int test_mem(void)
TEST_ERR(err);
}

TEST_ASSERT(is_aligned(obj, mem_alignment));
TEST_ASSERT(re_is_aligned(obj, mem_alignment));

old = mem_ref(obj);
TEST_EQUALS(2, mem_nrefs(obj));
Expand Down

0 comments on commit d3f12d4

Please sign in to comment.