Improve roundtrip verification tests and debug dump.

Add another round-trip verification.  For both original and generated
state, generate a diff from an initial, empty state.  Verify that
these two diffs are the same.
This commit is contained in:
John Hood
2015-10-19 18:37:39 -04:00
parent 66634eb97c
commit e0f6eb78ef
6 changed files with 73 additions and 24 deletions
+6
View File
@@ -176,6 +176,12 @@ void TransportSender<MyState>::tick( void )
if ( current_state.compare( newstate ) ) {
fprintf( stderr, "Warning, round-trip Instruction verification failed!\n" );
}
/* Also verify that both the original frame and generated frame have the same initial diff. */
std::string current_diff( current_state.init_diff() );
std::string new_diff( newstate.init_diff() );
if ( current_diff != new_diff ) {
fprintf( stderr, "Warning, target state Instruction verification failed!\n" );
}
}
if ( diff.empty() && (now >= next_ack_time) ) {