When a unit test fails, provide a string output of the wrong value too.
That makes reading the debug log file quite a bit easier.
Instead of only
«ntohl(((struct boothc_ticket_msg *)buf)->header.cmd)»: got «1349674352», expected «CMD_CATCHUP». ERROR.
now there are lines
-> gdb print state_to_string($$) <- gdb $52 = 0x6116f8 <cache.12837+40> "Prep"
From that it's easy to see that instead of the expected CATCHUP
there's a PREPARE in the message.