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 20:27:32 +0000 (15:27 -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 150d5dafb70b785cd63cf6c5442b53584f1c0b97..70f6f7adbe29c6d0896d948682ab74678fa8a6a1 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;
@@ -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);
 
This page took 0.02531 seconds and 4 git commands to generate.