Skip to content

Commit

Permalink
Fix macOS build: components::Name in benchmark (#784)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>

Co-authored-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
chapulina and scpeters authored Apr 26, 2021
1 parent 5031702 commit 361982a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions test/benchmark/each.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ class EntityComponentManagerFixture: public benchmark::Fixture
{
Entity worldEntity = mgr->CreateEntity();
mgr->CreateComponent(worldEntity, World());
mgr->CreateComponent(worldEntity, Name("world_name"));
mgr->CreateComponent(worldEntity, components::Name("world_name"));
}

for (int i = 0; i < _nonmatchingEntityCount; ++i)
{
Entity worldEntity = mgr->CreateEntity();
mgr->CreateComponent(worldEntity, Name("world_name"));
mgr->CreateComponent(worldEntity, components::Name("world_name"));
}
}

Expand All @@ -77,8 +77,8 @@ BENCHMARK_DEFINE_F(EntityComponentManagerFixture, EachNoCache)
{
int entitiesMatched = 0;

mgr->EachNoCache<World, Name>(
[&](const Entity &, const World *, const Name *)->bool
mgr->EachNoCache<World, components::Name>(
[&](const Entity &, const World *, const components::Name *)->bool
{
entitiesMatched++;
return true;
Expand All @@ -102,8 +102,8 @@ BENCHMARK_DEFINE_F(EntityComponentManagerFixture, EachCache)
{
int entitiesMatched = 0;

mgr->Each<World, Name>(
[&](const Entity &, const World *, const Name *)->bool
mgr->Each<World, components::Name>(
[&](const Entity &, const World *, const components::Name *)->bool
{
entitiesMatched++;
return true;
Expand Down Expand Up @@ -131,7 +131,7 @@ class ManyComponentFixture: public benchmark::Fixture
for (int i = 0; i < _entityCount; ++i)
{
Entity entity = mgr->CreateEntity();
mgr->CreateComponent(entity, Name("world_name"));
mgr->CreateComponent(entity, components::Name("world_name"));
mgr->CreateComponent(entity, AngularVelocity());
mgr->CreateComponent(entity, WorldAngularVelocity());
mgr->CreateComponent(entity, Inertial());
Expand All @@ -158,8 +158,8 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each1ComponentCache)
{
int entitiesMatched = 0;

mgr->Each<Name>(
[&](const Entity &, const Name *)->bool
mgr->Each<components::Name>(
[&](const Entity &, const components::Name *)->bool
{
entitiesMatched++;
return true;
Expand All @@ -184,13 +184,13 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each5ComponentCache)
{
int entitiesMatched = 0;

mgr->Each<Name,
mgr->Each<components::Name,
AngularVelocity,
Inertial,
LinearAcceleration,
LinearVelocity>(
[&](const Entity &,
const Name *,
const components::Name *,
const AngularVelocity *,
const Inertial *,
const LinearAcceleration *,
Expand Down Expand Up @@ -219,7 +219,7 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each10ComponentCache)
{
int entitiesMatched = 0;

mgr->Each<Name,
mgr->Each<components::Name,
AngularVelocity,
WorldAngularVelocity,
Inertial,
Expand All @@ -230,7 +230,7 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each10ComponentCache)
Pose,
WorldPose>(
[&](const Entity &,
const Name *,
const components::Name *,
const AngularVelocity *,
const WorldAngularVelocity *,
const Inertial *,
Expand Down Expand Up @@ -264,8 +264,8 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each1ComponentNoCache)
{
int entitiesMatched = 0;

mgr->EachNoCache<Name>(
[&](const Entity &, const Name *)->bool
mgr->EachNoCache<components::Name>(
[&](const Entity &, const components::Name *)->bool
{
entitiesMatched++;
return true;
Expand All @@ -290,13 +290,13 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each5ComponentNoCache)
{
int entitiesMatched = 0;

mgr->EachNoCache<Name,
mgr->EachNoCache<components::Name,
AngularVelocity,
Inertial,
LinearAcceleration,
LinearVelocity>(
[&](const Entity &,
const Name *,
const components::Name *,
const AngularVelocity *,
const Inertial *,
const LinearAcceleration *,
Expand Down Expand Up @@ -325,7 +325,7 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each10ComponentNoCache)
{
int entitiesMatched = 0;

mgr->EachNoCache<Name,
mgr->EachNoCache<components::Name,
AngularVelocity,
WorldAngularVelocity,
Inertial,
Expand All @@ -336,7 +336,7 @@ BENCHMARK_DEFINE_F(ManyComponentFixture, Each10ComponentNoCache)
Pose,
WorldPose>(
[&](const Entity &,
const Name *,
const components::Name *,
const AngularVelocity *,
const WorldAngularVelocity *,
const Inertial *,
Expand Down

0 comments on commit 361982a

Please sign in to comment.