Last active
December 30, 2015 22:39
-
-
Save junkdog/7895219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.Assert.*; | |
import com.artemis.Entity; | |
import com.artemis.World; | |
import org.junit.Test; | |
public class Test { | |
@Test | |
public void entity_is_no_longer_active_after_deletion() { | |
World world = new World(); | |
world.initialize(); | |
// Create entity | |
Entity ent = world.createEntity(); | |
ent.addToWorld(); | |
world.process(); | |
assertTrue(ent.isActive()); | |
// Delete it from world | |
world.deleteEntity(ent); | |
world.process(); | |
// Entity non-active | |
assertFalse(ent.isActive()); | |
// Create another entity | |
Entity ent2 = world.createEntity(); | |
ent2.addToWorld(); | |
world.process(); | |
// ent2 reuses ent instance | |
assertSame(ent, ent2); | |
// Bug: Entity is active again! | |
// assertFalse(ent.isActive()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment