Skip to content

Commit

Permalink
Fix reading uninitialized value in ComponentLifecycle test
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Aug 28, 2024
1 parent f9eed7e commit 6cb8291
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/core/src/ComponentLifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static void ecs_on_add(Position)(ecs_iter_t *it) {
}
}

static void on_add_position_emplace(ecs_iter_t *it) {
static void on_add_position_count(ecs_iter_t *it) {
on_add_position += it->count;
}

Expand Down Expand Up @@ -1254,7 +1254,7 @@ void ComponentLifecycle_on_add_w_emplace(void) {
ECS_COMPONENT(world, Position);

ecs_set_hooks(world, Position, {
.on_add = on_add_position_emplace
.on_add = on_add_position_count
});

ecs_entity_t e = ecs_new(world);
Expand All @@ -1276,7 +1276,7 @@ void ComponentLifecycle_on_add_w_emplace_existing(void) {

ecs_set_hooks(world, Position, {
.ctor = ecs_ctor(Position),
.on_add = on_add_position_emplace
.on_add = on_add_position_count
});

ecs_entity_t e = ecs_new_w(world, Velocity);
Expand All @@ -1298,7 +1298,7 @@ void ComponentLifecycle_on_add_w_emplace_defer(void) {
ECS_COMPONENT(world, Position);

ecs_set_hooks(world, Position, {
.on_add = on_add_position_emplace
.on_add = on_add_position_count
});

ecs_entity_t e = ecs_new(world);
Expand Down Expand Up @@ -3403,7 +3403,7 @@ void ComponentLifecycle_new_w_table_on_add_hook(void) {
ECS_TAG(world, Bar);

ecs_set_hooks(world, Position, {
.on_add = ecs_on_add(Position)
.on_add = on_add_position_count
});

ecs_table_t *table = ecs_table_add_id(world, NULL, ecs_id(Position));
Expand Down

0 comments on commit 6cb8291

Please sign in to comment.