summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2019-05-07 16:29:54 +1000
committerAmitay Isaacs <amitay@samba.org>2019-05-13 07:27:24 +0000
commita0a82f1b6a0d7d94b99982579fe13291d1e6a1b0 (patch)
tree4b8cbd3a016f1050843a3fbf4ac07ba97aaff145 /ctdb
parent8663e0a64fbdb9ea16babbfe87d6f5d7a7b72bbd (diff)
downloadsamba-a0a82f1b6a0d7d94b99982579fe13291d1e6a1b0.tar.gz
ctdb-tests: Add reqid wrapping test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13930 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tests/src/reqid_test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ctdb/tests/src/reqid_test.c b/ctdb/tests/src/reqid_test.c
index ec0c4a56df1..39f1fbdcc69 100644
--- a/ctdb/tests/src/reqid_test.c
+++ b/ctdb/tests/src/reqid_test.c
@@ -66,6 +66,22 @@ int main(void)
talloc_free(reqid_ctx);
assert(talloc_get_size(mem_ctx) == 0);
+ ret = reqid_init(mem_ctx, INT_MAX-1, &reqid_ctx);
+ assert(ret == 0);
+
+ reqid = reqid_new(reqid_ctx, data);
+ assert(reqid == INT_MAX);
+
+ reqid = reqid_new(reqid_ctx, data);
+ assert(reqid == 0);
+
+ reqid_remove(reqid_ctx, 0);
+
+ reqid = reqid_new(reqid_ctx, data);
+ assert(reqid == 1);
+
+ talloc_free(reqid_ctx);
+
talloc_free(mem_ctx);
return 0;