Skip to content

Commit

Permalink
Fix GCC warning
Browse files Browse the repository at this point in the history
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
  • Loading branch information
arjo129 committed Aug 2, 2023
1 parent 08298b6 commit a6e85ba
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/EntityComponentManager_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2216,39 +2216,39 @@ TEST_P(EntityComponentManagerFixture,

// No periodic changes keep cache empty.
manager.UpdatePeriodicChangeCache(changeTracker);
EXPECT_EQ(changeTracker.size(), 0);
EXPECT_EQ(changeTracker.size(), 0u);

// Create a periodic change.
manager.SetChanged(e1, c1->TypeId(), ComponentState::PeriodicChange);

// 1 periodic change, should be reflected in cache.
manager.UpdatePeriodicChangeCache(changeTracker);
EXPECT_EQ(changeTracker.size(), 1);
EXPECT_EQ(changeTracker[c1->TypeId()].count(e1), 1);
EXPECT_EQ(changeTracker.size(), 1u);
EXPECT_EQ(changeTracker[c1->TypeId()].count(e1), 1u);

manager.RunSetAllComponentsUnchanged();

// Has periodic change. Cache should be full.
manager.UpdatePeriodicChangeCache(changeTracker);
EXPECT_EQ(changeTracker.size(), 1);
EXPECT_EQ(changeTracker[c1->TypeId()].count(e1), 1);
EXPECT_EQ(changeTracker[c1->TypeId()].size(), 1);
EXPECT_EQ(changeTracker.size(), 1u);
EXPECT_EQ(changeTracker[c1->TypeId()].count(e1), 1u);
EXPECT_EQ(changeTracker[c1->TypeId()].size(), 1u);

// Serialize state
msgs::SerializedStateMap state;
manager.PeriodicStateFromCache(state, changeTracker);
EXPECT_EQ(state.entities().size(), 1);
EXPECT_EQ(state.entities().size(), 1u);
EXPECT_EQ(
state.entities().find(e1)->second.components().size(), 1);
state.entities().find(e1)->second.components().size(), 1u);
EXPECT_NE(state.entities().find(e1)->second
.components().find(c1->TypeId()),
state.entities().find(e1)->second.components().end());

// Component removed cache should be updated.
manager.RemoveComponent<IntComponent>(e1);
manager.UpdatePeriodicChangeCache(changeTracker);
EXPECT_EQ(changeTracker.size(), 1);
EXPECT_EQ(changeTracker[c1->TypeId()].size(), 0);
EXPECT_EQ(changeTracker.size(), 1u);
EXPECT_EQ(changeTracker[c1->TypeId()].size(), 0u);

manager.RunSetAllComponentsUnchanged();

Expand All @@ -2257,17 +2257,17 @@ TEST_P(EntityComponentManagerFixture,
manager.UpdatePeriodicChangeCache(changeTracker);

// Cache does not track additions, only PeriodicChanges
EXPECT_EQ(changeTracker[c2->TypeId()].size(), 0);
EXPECT_EQ(changeTracker[c2->TypeId()].size(), 0u);

// Track change
manager.SetChanged(e1, c1->TypeId(), ComponentState::PeriodicChange);
manager.UpdatePeriodicChangeCache(changeTracker);
EXPECT_EQ(changeTracker[c2->TypeId()].size(), 1);
EXPECT_EQ(changeTracker[c2->TypeId()].size(), 1u);

// Entity removed cache should be updated.
manager.RequestRemoveEntity(e1);
manager.UpdatePeriodicChangeCache(changeTracker);
EXPECT_EQ(changeTracker[c2->TypeId()].size(), 0);
EXPECT_EQ(changeTracker[c2->TypeId()].size(), 0u);
}

//////////////////////////////////////////////////
Expand Down

0 comments on commit a6e85ba

Please sign in to comment.