Skip to content

Commit

Permalink
ffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bret Ambrose committed Oct 25, 2023
1 parent 2aa529b commit acdf8d4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/priority_queue_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,33 +451,33 @@ static int s_test_remove_interior_sift_down(struct aws_allocator *allocator, voi
return 0;
}

#define BACKPOINTER_CLEAR_NODE_COUNT 16

static int s_priority_queue_clear_backpointers_test(struct aws_allocator *allocator, void *ctx) {
(void)ctx;

struct aws_priority_queue queue;

ASSERT_SUCCESS(aws_priority_queue_init_dynamic(&queue, allocator, 16, sizeof(int), s_compare_ints));

static const size_t NODE_COUNT = 16;

struct aws_priority_queue_node queue_nodes[NODE_COUNT];
struct aws_priority_queue_node queue_nodes[BACKPOINTER_CLEAR_NODE_COUNT];

for (size_t i = 0; i < NODE_COUNT; ++i) {
for (size_t i = 0; i < BACKPOINTER_CLEAR_NODE_COUNT; ++i) {
aws_priority_queue_node_init(&queue_nodes[i]);
}

for (int i = 0; i < NODE_COUNT; i++) {
for (int i = 0; i < BACKPOINTER_CLEAR_NODE_COUNT; i++) {
aws_priority_queue_push_ref(&queue, &i, &queue_nodes[i]);
}

for (size_t i = 0; i < NODE_COUNT; ++i) {
for (size_t i = 0; i < BACKPOINTER_CLEAR_NODE_COUNT; ++i) {
ASSERT_TRUE(aws_priority_queue_node_is_in_queue(&queue_nodes[i]));
}

aws_priority_queue_clear(&queue);
ASSERT_INT_EQUALS(0, aws_priority_queue_size(&queue));

for (size_t i = 0; i < NODE_COUNT; ++i) {
for (size_t i = 0; i < BACKPOINTER_CLEAR_NODE_COUNT; ++i) {
ASSERT_FALSE(aws_priority_queue_node_is_in_queue(&queue_nodes[i]));
}

Expand Down

0 comments on commit acdf8d4

Please sign in to comment.