Commit 724ba341 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

Corrected the valgrind error linked to createVirtualOrganization() in the unit tests

parent 9248c21b
......@@ -214,6 +214,8 @@ public:
cta::common::dataStructures::VirtualOrganization vo;
vo.name = s_vo;
vo.comment = "comment";
vo.writeMaxDrives = 1;
vo.readMaxDrives = 1;
m_catalogue->createVirtualOrganization(s_adminOnAdminHost,vo);
common::dataStructures::StorageClass storageClass;
......
......@@ -276,6 +276,15 @@ public:
return mountPolicy;
}
cta::common::dataStructures::VirtualOrganization getDefaultVirtualOrganization() {
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.readMaxDrives = 1;
vo.writeMaxDrives = 1;
vo.comment = "comment";
return vo;
}
void setupDefaultCatalogue() {
using namespace cta;
auto & catalogue=getCatalogue();
......@@ -322,9 +331,7 @@ public:
ASSERT_EQ(s_adminOnAdminHost.host, rule.creationLog.host);
ASSERT_EQ(rule.creationLog, rule.lastModificationLog);
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.comment = "comment";
cta::common::dataStructures::VirtualOrganization vo = getDefaultVirtualOrganization();
catalogue.createVirtualOrganization(s_adminOnAdminHost,vo);
common::dataStructures::StorageClass storageClass;
......
......@@ -70,6 +70,15 @@ const uint32_t TEST_GROUP_2 = 9754;
mediaType.comment = "comment";
m_catalogue->createMediaType(admin,mediaType);
}
cta::common::dataStructures::VirtualOrganization getDefaultVo(){
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.readMaxDrives = 1;
vo.writeMaxDrives = 1;
vo.comment = "comment";
return vo;
}
void TearDown() {
m_catalogue.reset();
......@@ -133,9 +142,7 @@ const uint32_t TEST_GROUP_2 = 9754;
const cta::optional<std::string> supply("value for the supply pool mechanism");
const bool fullValue = false;
const std::string createTapeComment = "Create tape";
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.comment = "comment";
cta::common::dataStructures::VirtualOrganization vo = getDefaultVo();
cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost");
m_catalogue->createVirtualOrganization(admin,vo);
......@@ -297,9 +304,7 @@ const uint32_t TEST_GROUP_2 = 9754;
const std::string createTapeComment = "Create tape";
cta::common::dataStructures::SecurityIdentity admin = cta::common::dataStructures::SecurityIdentity("admin","localhost");
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.comment = "comment";
cta::common::dataStructures::VirtualOrganization vo = getDefaultVo();
m_catalogue->createVirtualOrganization(admin,vo);
......
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