Adds some defensive features to automata tests for the CPP event handler.