Skip to content

Instantly share code, notes, and snippets.

@vrobel
Created August 10, 2012 15:01
Show Gist options
  • Save vrobel/3314807 to your computer and use it in GitHub Desktop.
Save vrobel/3314807 to your computer and use it in GitHub Desktop.
Test case for removing and adding system with same priority causess infinite loop
[Test]
public function removeSystemAndAddItAgainDontCauseInvalidLinkedList():void {
var systemB:System = new System();
var systemC:System = new System();
game.addSystem( systemB, 0 );
game.addSystem( systemC, 0 );
game.removeSystem(systemB);
game.addSystem(systemB, 0);
// game.update( 0.1 );
assertThat( systemC.previous, nullValue() );
assertThat( systemB.next, nullValue() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment