[SSSD] [PATCH] test_sysdb_subdomains: Do use assignment in assertions

Lukas Slebodnik lslebodn at redhat.com
Fri Nov 13 07:51:17 UTC 2015


ehlo,

I found these iisues due to different size of integer and pointer
on el6.

/home/build/sssd/src/tests/cmocka/test_sysdb_subdomains.c:248: error: cast from
pointer to integer of different size

Simple patch is attached.

LS
-------------- next part --------------
>From dcdba8696ef0548768a5a6a46fb54fd1a8fa1fb2 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 13 Nov 2015 08:45:30 +0100
Subject: [PATCH] test_sysdb_subdomains: Do use assignment in assertions

---
 src/tests/cmocka/test_sysdb_subdomains.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/tests/cmocka/test_sysdb_subdomains.c b/src/tests/cmocka/test_sysdb_subdomains.c
index 0fb1d6eed4efa3bc05f97f5f169ada10d242ea4c..701bfb726ff7e950d4439b3dc1a3bee437c9e7ed 100644
--- a/src/tests/cmocka/test_sysdb_subdomains.c
+++ b/src/tests/cmocka/test_sysdb_subdomains.c
@@ -245,19 +245,19 @@ static void test_sysdb_link_forest_root_ipa(void **state)
 
     sub = find_domain_by_name(test_ctx->tctx->dom, dom1[0], true);
     assert_non_null(sub->forest_root);
-    assert_true(sub->forest_root = sub);
+    assert_ptr_equal(sub->forest_root, sub);
 
     child = find_domain_by_name(test_ctx->tctx->dom, child_dom1[0], true);
     assert_non_null(child->forest_root);
-    assert_true(child->forest_root = sub);
+    assert_ptr_equal(child->forest_root, sub);
 
     sub = find_domain_by_name(test_ctx->tctx->dom, dom2[0], true);
     assert_non_null(sub->forest_root);
-    assert_true(sub->forest_root = sub);
+    assert_ptr_equal(sub->forest_root, sub);
 
     child = find_domain_by_name(test_ctx->tctx->dom, child_dom2[0], true);
     assert_non_null(child->forest_root);
-    assert_true(child->forest_root = sub);
+    assert_ptr_equal(child->forest_root, sub);
 
     main_dom = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM1_NAME, true);
     assert_non_null(main_dom);
@@ -328,11 +328,11 @@ static void test_sysdb_link_forest_root_ad(void **state)
 
     child = find_domain_by_name(test_ctx->tctx->dom, child_dom[0], true);
     assert_non_null(child->forest_root);
-    assert_true(child->forest_root = test_ctx->tctx->dom);
+    assert_ptr_equal(child->forest_root, test_ctx->tctx->dom);
 
     sub = find_domain_by_name(test_ctx->tctx->dom, sub_dom[0], true);
     assert_non_null(sub->forest_root);
-    assert_true(sub->forest_root = test_ctx->tctx->dom);
+    assert_ptr_equal(sub->forest_root, test_ctx->tctx->dom);
 
     /* Another separate domain is a forest of its own */
     main_dom = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM2_NAME, true);
@@ -407,14 +407,14 @@ static void test_sysdb_link_forest_member_ad(void **state)
     /* Checks */
     root = find_domain_by_name(test_ctx->tctx->dom, forest_root[0], true);
     assert_non_null(root->forest_root);
-    assert_true(root->forest_root = root);
+    assert_ptr_equal(root->forest_root, root);
 
     assert_non_null(test_ctx->tctx->dom->forest_root);
     assert_true(test_ctx->tctx->dom->forest_root == root);
 
     sub = find_domain_by_name(test_ctx->tctx->dom, sub_dom[0], true);
     assert_non_null(sub->forest_root);
-    assert_true(sub->forest_root = root);
+    assert_ptr_equal(sub->forest_root, root);
 
     /* Another separate domain is a forest of its own */
     main_dom = find_domain_by_name(test_ctx->tctx->dom, TEST_DOM2_NAME, true);
@@ -505,7 +505,7 @@ static void test_sysdb_link_ad_multidom(void **state)
     root = find_domain_by_name(test_ctx->tctx->dom, dom2_forest_root[0], true);
     assert_non_null(root);
     assert_non_null(root->forest_root);
-    assert_true(root->forest_root = main_dom2);
+    assert_ptr_equal(root->forest_root, main_dom2);
 
 }
 
-- 
2.5.0



More information about the sssd-devel mailing list