Ignore some more debian artifacts

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
configure.ac: Remove obsolete macros

AC_PROG_RANLIB is obsoleted by LT_INIT, and AC_PROG_LIBTOOL is not
necessary either.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
attribute: Add error handling to riemann_attribute_create()

In riemann_attribute_create(), check the return values of
riemann_attribute_set_key() and riemann_attribute_set_value(), and if
they return an error, propagate them. Also, only call these when the key
and value arguments are non-NULL.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
event: Deinit a varargs variable

In _riemann_event_set_va(), call va_end() on the copied varargs at the
end of the successful branch too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
message: Move a pointer dereference after NULL checks

In _riemann_message_combine_events(), move the dereference of n_events
to after the NULL checks. Although all callers call it with a non-NULL
pointer, there is a NULL check, so move the dereference after it, to be
on the safe side.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
client: Do not leak resources on connection failure

When connecting to riemann fails, correctly free up the allocated
resources on the error branches.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Preparations for 1.0.1

Bumped the version to 1.0.1, and added a draft NEWS entry.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: Add a negative riemann_attribute_free() test case

The new test case checks that riemann_attribute_free() will set a
correct errno when called with a NULL pointer.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: New negative test for riemann_client_connect()

When network tests are enabled, try connecting to a non-existant host
too, to test the behaviour on the error path.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: Add a negative test for riemann_client_recv_message()

Make sure that riemann_client_recv_message() with a NULL pointer returns
the appropriate errno.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: Add a few more negative and double tests for Events

When testing events, make sure to cover error cases, and overwriting
existing values too. This is to catch leaks, among other things.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: More message tests

When testing messages, test error cases for correct return values, and
overwriting existing parts of a message, to catch leaks.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: Improved query tests

When testing queries, also test error cases, and overwriting the query
string, to catch possible memory leaks.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Improve and add tests for the various _free() functions

The various riemann_*_free() functions should all set errno to EINVAL
when called with a NULL pointer.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: Add a test for riemann_client_disconnect()

Calling riemann_client_disconnect() on a NULL pointer should return
-ENOTCONN.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Makefile.am: Add a coverage target

The coverage target assumes that the library was compiled with coverage
support (--coverage in CFLAGS and LDFLAGS), and lcov is installed. It
generates test coverage information for the library itself, generated
protocolbuffer things excluded.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
gitignore: Ignore coverage artifacts

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
NEWS: Added a few more newsworthy items

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
message: Set errno correctly in riemann_message_from_buffer()

When riemann_message_from_buffer() is on the error path, set errno to
EINVAL. Also add a test case for this behaviour.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: Auto-detect a running riemann

Instead of relying on an environment variable to be set, automatically
detect if riemann is running (by trying to connect to it), and enable
network tests if it is.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>