From b564fbf4e8188ab060972623e2a3e5b577891a72 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 12:39:13 -0500 Subject: [PATCH] Fix: test test_ust_data.c: check OOM MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- tests/unit/test_ust_data.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.34.1