From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:39:13 +0000 (-0500) Subject: Fix: test test_ust_data.c: check OOM X-Git-Tag: v2.5.3~10 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b564fbf4e8188ab060972623e2a3e5b577891a72;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 150d5dafb..70f6f7adb 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; @@ -156,6 +156,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);