Skip to content

Commit

Permalink
Added a test
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <[email protected]>
  • Loading branch information
Nate Koenig committed Sep 11, 2020
1 parent 93e97a8 commit 8a2b44c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/EntityComponentManager_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,19 @@ TEST_P(EntityComponentManagerFixture, SetChanged)
manager.ComponentState(e2, c2.first));
}

//////////////////////////////////////////////////
TEST_P(EntityComponentManagerFixture, SetEntityCreateOffset)
{
// First entity should have a value of 1.
Entity entity = manager.CreateEntity();
EXPECT_EQ(1u, entity);

// Apply an offset.
manager.SetEntityCreateOffset(1000);
Entity entity2 = manager.CreateEntity();
EXPECT_EQ(1001u, entity2);
}

// Run multiple times. We want to make sure that static globals don't cause
// problems.
INSTANTIATE_TEST_CASE_P(EntityComponentManagerRepeat,
Expand Down
2 changes: 1 addition & 1 deletion src/systems/log/LogPlayback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void LogPlayback::Configure(const Entity &,

// Set the entity offset.
// \todo This number should be included in the log file.
_ecm.SetEntityOffset(90000);
_ecm.SetEntityCreateOffset(math::MAX_I64 / 2);

// If path is a file, assume it is a compressed file
// (Otherwise assume it is a directory containing recorded files.)
Expand Down

0 comments on commit 8a2b44c

Please sign in to comment.