From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:39:13 +0000 (-0500) Subject: Fix: test test_ust_data.c: check OOM X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c710ece754dd40000d0b3646980eab1407a1b29e;p=lttng-tools.git Fix: test test_ust_data.c: check OOM Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index dd0008926..6df66acbe 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -39,7 +39,7 @@ #define RANDOM_STRING_LEN 11 /* Number of TAP tests in this file */ -#define NUM_TESTS 10 +#define NUM_TESTS 11 /* For error.h */ int lttng_opt_quiet = 1; @@ -157,6 +157,12 @@ static void test_create_ust_event_exclusion(void) /* set up an exclusion set */ exclusion = zmalloc(sizeof(*exclusion) + LTTNG_SYMBOL_NAME_LEN); + if (!exclusion) { + PERROR("zmalloc"); + } + + ok(exclusion != NULL, "Create UST exclusion"); + exclusion->count = 1; strncpy((char *)(exclusion->names), get_random_string(), LTTNG_SYMBOL_NAME_LEN);