ASSERT_LT(rados_pool_list(cluster, NULL, POOL_LIST_BUF_SZ), POOL_LIST_BUF_SZ);
bool found_pool = false;
+ int firstlen = 0;
while (buf[0] != '\0') {
if ((found_pool == false) && (strcmp(buf, pool_name.c_str()) == 0)) {
found_pool = true;
}
+ if (!firstlen)
+ firstlen = strlen(buf) + 1;
buf += strlen(buf) + 1;
}
ASSERT_EQ(found_pool, true);
// make sure we honor the buffer size limit
buf = pool_list_buf;
memset(buf, 0, POOL_LIST_BUF_SZ);
- ASSERT_LT(rados_pool_list(cluster, buf, 20), POOL_LIST_BUF_SZ);
+ ASSERT_LT(rados_pool_list(cluster, buf, firstlen), POOL_LIST_BUF_SZ);
ASSERT_NE(0, buf[0]); // include at least one pool name
- ASSERT_EQ(0, buf[20]); // but don't touch the stopping point
+ ASSERT_EQ(0, buf[firstlen]); // but don't touch the stopping point
ASSERT_EQ(0, destroy_one_pool(pool_name, &cluster));
}