nmtst: improve test macros FAIL() and ASSERT()
authorThomas Haller <thaller@redhat.com>
Wed, 3 Feb 2016 11:16:07 +0000 (12:16 +0100)
committerThomas Haller <thaller@redhat.com>
Wed, 3 Feb 2016 11:41:35 +0000 (12:41 +0100)
commit123747963a6d76fcc1d2813db5707493af1b5e84
treede2ae763d44fdb54fe8bfad38edfba62ddafba3b
parentc510323368b342c500f012a67891aaec39e8fa52
nmtst: improve test macros FAIL() and ASSERT()

Fail only printed a message to stderr and exited.
Instead, print it with g_error(), which also breaks
in the debugger and produces a core-dump.

Also, it constructed the message based on an unchecked
format string and constructed a format string dynamically.
Just don't do that.

Also add a comment that these macros are discouraged because
they are cumbersome to write (requiring a test-name and a failure
message).
shared/nm-test-utils.h