Wednesday, August 10, 2016

PlayerSession, unit tests

Sorry for the lack of post yesterday; I took it as a vacation day and went on a beautiful hike, and to a concert in the evening. 

Today I continued work on PlayerSession, the core class for managing player's connection lifetime. I've come up with some pretty intricate unit tests for it, including a full life cycle (connect, do a PlayerState transaction, and shutdown), and several failure cases. I discovered a problem in NetConnection; I had done some very server-centric error handling in receiver thread. To do that error handling I had had to mix in a more specialized namespace that I had intended to keep separate. Turns out that was wrong anyway--the logic I wrote wouldn't make any sense on the client. One of those cases where, if I had done it properly the first time, the system would have "just worked". 

Up to 105 unit tests now. 


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.