The test methods that take printf style input now have the printf attribute. This enables format checks making oversights less likely. Also fixed any existing errors in the code. Only the one in test_binlog_fnc.cpp would've had an actual effect.
Added a test case that reproduces the problem and verifies that it is solved.