From 681fd36964b873135b2b8dd5200ddcfd1e420214 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Mon, 27 Jul 2015 17:24:45 +0200
Subject: [PATCH 20/23] VIEWS TEST: add null-check
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
---
src/tests/cmocka/test_sysdb_views.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/tests/cmocka/test_sysdb_views.c b/src/tests/cmocka/test_sysdb_views.c
index 1fb598219e9ee581e465ddbb32ba9f2544600c26..123d4c5cb613f41e1bca9e89feed701a1e86f8d3 100644
--- a/src/tests/cmocka/test_sysdb_views.c
+++ b/src/tests/cmocka/test_sysdb_views.c
@@ -225,10 +225,12 @@ void test_sysdb_add_overrides_to_object(void **state)
assert_non_null(orig);
tmp_str = talloc_strdup(orig, "ORIGNAME");
+ assert_non_null(tmp_str);
ret = ldb_msg_add_string(orig, SYSDB_NAME, tmp_str);
assert_int_equal(ret, EOK);
tmp_str = talloc_strdup(orig, "ORIGGECOS");
+ assert_non_null(tmp_str);
ret = ldb_msg_add_string(orig, SYSDB_GECOS, tmp_str);
assert_int_equal(ret, EOK);
@@ -236,18 +238,22 @@ void test_sysdb_add_overrides_to_object(void **state)
assert_non_null(override);
tmp_str = talloc_strdup(override, "OVERRIDENAME");
+ assert_non_null(tmp_str);
ret = ldb_msg_add_string(override, SYSDB_NAME, tmp_str);
assert_int_equal(ret, EOK);
tmp_str = talloc_strdup(override, "OVERRIDEGECOS");
+ assert_non_null(tmp_str);
ret = ldb_msg_add_string(override, SYSDB_GECOS, tmp_str);
assert_int_equal(ret, EOK);
tmp_str = talloc_strdup(override, "OVERRIDEKEY1");
+ assert_non_null(tmp_str);
ret = ldb_msg_add_string(override, SYSDB_SSH_PUBKEY, tmp_str);
assert_int_equal(ret, EOK);
tmp_str = talloc_strdup(override, "OVERRIDEKEY2");
+ assert_non_null(tmp_str);
ret = ldb_msg_add_string(override, SYSDB_SSH_PUBKEY, tmp_str);
assert_int_equal(ret, EOK);
--
2.4.3