torture: Avoid -Werror=strict-overflow in -O3 coverage build
authorAndrew Bartlett <abartlet@samba.org>
Mon, 19 Apr 2021 19:34:12 +0000 (07:34 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 28 Apr 2021 03:43:34 +0000 (03:43 +0000)
The test_getinfo() function only needs to return if this happens
not how many times.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/torture/rpc/dsgetinfo.c

index 4e9e5833f02005397c5732458650ead84ec35b2a..58a2f921fbe393e3fb74a9acadbee001c3521633 100644 (file)
@@ -248,7 +248,7 @@ static bool test_getinfo(struct torture_context *tctx,
        union drsuapi_DsReplicaInfo info;
        enum drsuapi_DsReplicaInfoType info_type;
        int i;
-       int invalid_levels = 0;
+       bool no_invalid_levels = true;
        struct {
                int32_t level;
                int32_t infotype;
@@ -382,18 +382,14 @@ static bool test_getinfo(struct torture_context *tctx,
                        torture_comment(tctx,
                                        "DsReplicaGetInfo level %d and/or infotype %d not yet supported by server\n",
                                        array[i].level, array[i].infotype);
-                       invalid_levels++;
+                       no_invalid_levels = false;
                        continue;
                }
 
                torture_drsuapi_assert_call(tctx, p, status, &r, "dcerpc_drsuapi_DsReplicaGetInfo");
        }
 
-       if (invalid_levels > 0) {
-               return false;
-       }
-
-       return true;
+       return no_invalid_levels;
 }
 
 /**