Fix a bunch of compiler warnings and annoyances with tests

The indentation was pretty horrible, and the plethora of warnings
was just appalling. Naming variables the same as types is not only
frowned upon, but an actual error for many compilers, and mixing
declarations and statements is illegal in ISO C90.

The rest is mostly just getting rid of shadowed variables and
functions and getting included files in the right order.

Signed-off-by: Andreas Ericsson <ae@op5.se>
sretention: Remove some debugging output

Leftover printf()'s from the times when state retention was made
configuration sensitive.

Signed-off-by: Andreas Ericsson <ae@op5.se>
downtime: Log properly when and why we fail to add downtime

Previously that stuff ended up in the debug log, which isn't always
enabled. With this patch, it will end up in the normal logfile
where real errors belong (even though they may well be user errors).

Signed-off-by: Andreas Ericsson <ae@op5.se>
t-tap/smallconfig/retention.dat: Make retained host downtime sensible

It doesn't make sense to have zero-second downtimes, and the code we
have today rightly denies such crap as nonsense. However, the tests
in test_config.c (well, soon-to-be test_config.c) attempts to locate
a host downtime with exactly those parameters, stashed in our
retention data testfile.

This patch fixes it by nudging the end_time by 10 seconds, thus
allowing the downtime a small piece of space in the fourth dimension
in where it can, if not thrive, then at least exist.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Reintroduce config and retention data testing

The old test_nagios_config.c has been revived as test_config.c and
has been given some love so that it actually works and passes just
fine now.

Signed-off-by: Andreas Ericsson <ae@op5.se>
t-tap/smallconfig/naemon.cfg: Enable logging, but to stdout

All the automated testrunners we have grab stdout and send us in
nice emails and stuff. With this patch we'll be spending a little
less time bughunting and a little more time on the fun stuff, like
eating icecream, drinking beer and going bungyjumping.

Signed-off-by: Andreas Ericsson <ae@op5.se>
t-tap/test_timeperiods: Fix 'em

Faster than the speed of Robin. Shuzam!

Signed-off-by: Andreas Ericsson <ae@op5.se>