Commit a27b7681 authored by Eric Cano's avatar Eric Cano
Browse files

Fixed mix-ups with expected values in unit test.

parent 58c2c5aa
......@@ -641,7 +641,12 @@ cta::ArchiveDirEntry cta::MockNameServer::getArchiveDirEntry(
if (ArchiveDirEntry::ENTRYTYPE_FILE == entryType)
size = atol(Utils::getXattr(fsPath, "user.CTASize").c_str());
const uint64_t fileId = atol(Utils::getXattr(fsPath, "user.CTAFileID").c_str());
ArchiveFileStatus status(owner, fileId, statResult.st_mode, size, checksum, storageClassName);
std::stringstream modeStrTr;
std::string modeStr = Utils::getXattr(fsPath, "user.CTAMode");
modeStrTr << modeStr;
mode_t mode;
modeStrTr >> std::oct >> mode;
ArchiveFileStatus status(owner, fileId, mode, size, checksum, storageClassName);
return ArchiveDirEntry(entryType, name, status, tapeCopies);
......@@ -922,9 +922,9 @@ TEST_F(castor_tape_tapeserver_daemon_DataTransferSessionTest, DataTransferSessio
for(auto i=remoteFilePaths.begin(); i!=remoteFilePaths.end(); i++) {
/*ASSERT_NO_THROW*/(ns.statFile(requester, *i));
std::unique_ptr<cta::ArchiveFileStatus> stat(ns.statFile(requester, *i));
ASSERT_NE((uint64_t)(stat.get()), NULL);
ASSERT_EQ(stat->mode, 0777);
ASSERT_EQ(stat->size, 1000);
ASSERT_NE(NULL, (uint64_t)(stat.get()));
ASSERT_EQ(0100777, stat->mode);
ASSERT_EQ(1000, stat->size);
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