HomeClusterLabs Projects
Diffusion Booth 2eaef6f367f4

When a unit test fails, provide a string output of the wrong value too.

Description

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.

Details

Provenance
Philipp Marek <philipp.marek@linbit.com>Authored on Feb 17 2014, 6:10 AM
Parents
rB6c7792ea7de7: Unit tests: Fix variable name and debug output confusion.
Branches
Unknown
Tags
Unknown

Event Timeline