//------------------------------------------------------------------------------ // File: XrdMgmOfsTests.cc // Author: Steven Murray //------------------------------------------------------------------------------ /************************************************************************ * EOS - the CERN Disk Storage System * * Copyright (C) 2018 CERN/Switzerland * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see .* ************************************************************************/ #include "mgm/XrdMgmOfs.hh" #include #include class XrdMgmOfsTest : public ::testing::Test { protected: virtual void SetUp() { } virtual void TearDown() { } }; //------------------------------------------------------------------------------ // Test //------------------------------------------------------------------------------ TEST_F(XrdMgmOfsTest, prepareOptsToString) { using namespace eos::mgm; { const int opts = Prep_PRTY0; ASSERT_EQ("PRTY0", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_PRTY1; ASSERT_EQ("PRTY1", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_PRTY2; ASSERT_EQ("PRTY2", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_PRTY3; ASSERT_EQ("PRTY3", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_SENDAOK; ASSERT_EQ("PRTY0,SENDAOK", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_SENDERR; ASSERT_EQ("PRTY0,SENDERR", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_SENDACK; ASSERT_EQ("PRTY0,SENDACK", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_WMODE; ASSERT_EQ("PRTY0,WMODE", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_STAGE; ASSERT_EQ("PRTY0,STAGE", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_COLOC; ASSERT_EQ("PRTY0,COLOC", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_FRESH; ASSERT_EQ("PRTY0,FRESH", XrdMgmOfs::prepareOptsToString(opts)); } #if (XrdMajorVNUM(XrdVNUMBER) == 4 && XrdMinorVNUM(XrdVNUMBER) >= 10) || XrdMajorVNUM(XrdVNUMBER) >= 5 { const int opts = Prep_CANCEL; ASSERT_EQ("PRTY0,CANCEL", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_QUERY; ASSERT_EQ("PRTY0,QUERY", XrdMgmOfs::prepareOptsToString(opts)); } { const int opts = Prep_EVICT; ASSERT_EQ("PRTY0,EVICT", XrdMgmOfs::prepareOptsToString(opts)); } #endif }