Update and test  TestState.cpp