Commit 512f492d authored by Steven Murray's avatar Steven Murray
Browse files

CatalogueTest now asserts new archive file identifiers are unique as opposed...

CatalogueTest now asserts new archive file identifiers are unique as opposed to strictly incrementing sequentially by 1
parent 9fc324f8
......@@ -5811,17 +5811,14 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_mount
common::dataStructures::UserIdentity userIdentity;
userIdentity.name = requesterName;
userIdentity.group = "group";
uint64_t expectedArchiveFileId = 0;
std::set<uint64_t> archiveFileIds;
for(uint64_t i = 0; i<10; i++) {
const uint64_t archiveFileId =
m_catalogue->checkAndGetNextArchiveFileId(storageClass.diskInstance, storageClass.name, userIdentity);
if(0 == i) {
expectedArchiveFileId = archiveFileId;
} else {
expectedArchiveFileId++;
}
ASSERT_EQ(expectedArchiveFileId, archiveFileId);
const bool archiveFileIdIsNew = archiveFileIds.end() == archiveFileIds.find(archiveFileId);
ASSERT_TRUE(archiveFileIdIsNew);
}
}
......@@ -5904,17 +5901,14 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_group
common::dataStructures::UserIdentity userIdentity;
userIdentity.name = "username";
userIdentity.group = requesterGroupName;
uint64_t expectedArchiveFileId = 0;
std::set<uint64_t> archiveFileIds;
for(uint64_t i = 0; i<10; i++) {
const uint64_t archiveFileId =
m_catalogue->checkAndGetNextArchiveFileId(storageClass.diskInstance, storageClass.name, userIdentity);
if(0 == i) {
expectedArchiveFileId = archiveFileId;
} else {
expectedArchiveFileId++;
}
ASSERT_EQ(expectedArchiveFileId, archiveFileId);
const bool archiveFileIdIsNew = archiveFileIds.end() == archiveFileIds.find(archiveFileId);
ASSERT_TRUE(archiveFileIdIsNew);
}
}
......@@ -6016,17 +6010,14 @@ TEST_P(cta_catalogue_CatalogueTest, checkAndGetNextArchiveFileId_requester_mount
common::dataStructures::UserIdentity userIdentity;
userIdentity.name = requesterName;
userIdentity.group = "group";
uint64_t expectedArchiveFileId = 0;
std::set<uint64_t> archiveFileIds;
for(uint64_t i = 0; i<10; i++) {
const uint64_t archiveFileId =
m_catalogue->checkAndGetNextArchiveFileId(storageClass.diskInstance, storageClass.name, userIdentity);
if(0 == i) {
expectedArchiveFileId = archiveFileId;
} else {
expectedArchiveFileId++;
}
ASSERT_EQ(expectedArchiveFileId, archiveFileId);
const bool archiveFileIdIsNew = archiveFileIds.end() == archiveFileIds.find(archiveFileId);
ASSERT_TRUE(archiveFileIdIsNew);
}
}
......
Supports Markdown
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