Fix: test test_ust_data.c: check OOM
[lttng-tools.git] / 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.025207 seconds and 5 git commands to generate.