Fix: test test_ust_data.c: check OOM
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Nov 2014 17:39:13 +0000 (12:39 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Nov 2014 17:57:24 +0000 (12:57 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/unit/test_ust_data.c

index dd00089266ad7770ce4c64e18b1340439f167c9b..6df66acbe6ee9e6d6f1ffe5fc083885e673893f9 100644 (file)
@@ -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);
 
This page took 0.026641 seconds and 4 git commands to generate.