ctdb-tests: Drop CTDB_TEST_MAX_IPS
authorMartin Schwenke <martin@meltin.net>
Tue, 21 Jun 2016 04:49:28 +0000 (14:49 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 4 Jul 2016 13:42:24 +0000 (15:42 +0200)
Arrays are now dynamically reallocated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/src/ctdb_takeover_tests.c

index 151ccd26ab46017c6054705747a946dd556ecacf..e15b49dac18a20b8dfd2d67761dc951df9bfb41b 100644 (file)
@@ -23,7 +23,6 @@
 
 /* This is lazy... but it is test code! */
 #define CTDB_TEST_MAX_NODES 256
-#define CTDB_TEST_MAX_IPS 1024
 
 static void print_ctdb_public_ip_list(struct public_ip_list * ips)
 {
@@ -65,7 +64,7 @@ read_ctdb_public_ip_info(TALLOC_CTX *ctx  ,
        char line[1024];
        ctdb_sock_addr addr;
        char *t, *tok;
-       int pnn, numips, n;
+       int pnn, n;
        struct ctdb_public_ip_list * k;
 
        enum ctdb_runstate *runstate;
@@ -81,7 +80,6 @@ read_ctdb_public_ip_info(TALLOC_CTX *ctx  ,
        k = talloc_zero(ctx, struct ctdb_public_ip_list);
        assert(k != NULL);
 
-       numips = 0;
        while (fgets(line, sizeof(line), stdin) != NULL) {
 
                /* Get rid of pesky newline */
@@ -106,12 +104,6 @@ read_ctdb_public_ip_info(TALLOC_CTX *ctx  ,
                        continue;
                }
 
-               numips++;
-               if (numips > CTDB_TEST_MAX_IPS) {
-                       DEBUG(DEBUG_ERR, ("ERROR: Exceeding CTDB_TEST_MAX_IPS: %d\n", CTDB_TEST_MAX_IPS));
-                       exit(1);
-               }
-
                /* Get the PNN */
                pnn = -1;
                tok = strtok(NULL, " \t");