Skip to content

Commit

Permalink
Apply review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloGalav committed Aug 4, 2023
1 parent 9066151 commit 0291cee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
5 changes: 2 additions & 3 deletions tests/XrdCl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ add_executable(xrdcl-unit-tests

target_link_libraries(xrdcl-unit-tests
XrdCl
XrdXml
XrdXml
XrdUtils
ZLIB::ZLIB
GTest::GTest
GTest::Main
)

target_include_directories(xrdcl-unit-tests
PRIVATE ${CMAKE_SOURCE_DIR}/src
PRIVATE ../common
PRIVATE ${CMAKE_SOURCE_DIR}/src ../common
)

gtest_discover_tests(xrdcl-unit-tests TEST_PREFIX XrdCl::)
34 changes: 23 additions & 11 deletions tests/XrdCl/GTestXrdHelpers.hh
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
/** Contains some of the macros found in CppUnitXrdHelpers.hh,
* converted into GTest equivalent.
*
* Created by Angelo Galavotti in 2023.
*/
//------------------------------------------------------------------------------
// Copyright (c) 2023 by European Organization for Nuclear Research (CERN)
// Author: Angelo Galavotti <angelo.galavotti@cern.ch>
//------------------------------------------------------------------------------
// XRootD is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// XRootD 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 Lesser General Public License
// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------

#include <gtest/gtest.h>
#include <XrdCl/XrdClXRootDResponses.hh>
#include <cerrno>
#include <cstring>

/** @brief Equivalent of CPPUNIT_ASSERT_XRDST
*
* Shows the code that we are asserting and its value
* in the final evaluation.
*
* Shows the code that we are asserting and its value
* in the final evaluation.
*/
#define GTEST_ASSERT_XRDST( x ) \
{ \
XrdCl::XRootDStatus _st = x; \
#define GTEST_ASSERT_XRDST( x ) \
{ \
XrdCl::XRootDStatus _st = x; \
EXPECT_TRUE(_st.IsOK()) << "[" << #x << "]: " << _st.ToStr() << std::endl; \
}

0 comments on commit 0291cee

Please sign in to comment.