Commit b371f105 authored by Elvin Sindrilaru's avatar Elvin Sindrilaru

UNIT_TEST: Check that the helper doesn't allocate a new id when the xrd connection pool is disabled

parent 974df5ce
......@@ -36,6 +36,11 @@ TEST(XrdConnPool, DefaultDisabled)
eos::common::XrdConnPool pool;
ASSERT_EQ(pool.AssignConnection(url), 0);
ASSERT_EQ(url.GetURL(), surl);
// No id should be allocated and the url should stay the same
eos::common::XrdConnIdHelper id_helper(pool, url);
ASSERT_EQ(id_helper.GetId(), 0);
ASSERT_FALSE(id_helper.HasNewConnection());
ASSERT_EQ(url.GetURL(), surl);
}
TEST(XrdConnPool, EvenDistribuion)
......@@ -94,6 +99,7 @@ TEST(XrdConnPool, ConnIdHelper)
// Each gets the same id since it's released at the end of each loop
for (uint32_t i = 0; i < max_size; ++i) {
XrdConnIdHelper id_helper(pool, url);
ASSERT_TRUE(id_helper.HasNewConnection());
ASSERT_EQ(id_helper.GetId(), 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment