00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/common/TestHelpers.hpp $ 00003 // $Id: TestHelpers.hpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Header for Boost.Test helper functions. 00018 00019 #ifndef TORC_COMMON_TESTHELPERS_HPP 00020 #define TORC_COMMON_TESTHELPERS_HPP 00021 00022 #include <string> 00023 #include <boost/filesystem/convenience.hpp> 00024 00025 namespace torc { 00026 namespace common { 00027 00028 /// \brief Read the raw contents of the specified file into a std::string. 00029 /// \param inPath The boost::filesystem::path for the file of interest. 00030 /// \param outString The string in which to place the raw file contents. 00031 /// \returns true if the file contents were read successfully. 00032 bool readFileIntoString(const boost::filesystem::path& inPath, std::string& outString); 00033 00034 /// \brief Compare the raw contents of two files to determine whether they are identical. 00035 /// \param inA The boost::filesystem::path for one of the two files. 00036 /// \param inB The boost::filesystem::path for the other of the two files. 00037 /// \returns true if the contents of the two files are identical. 00038 bool fileContentsAreEqual(const boost::filesystem::path& inA, const boost::filesystem::path& inB); 00039 00040 } // namespace common 00041 } // namespace torc 00042 00043 #endif // TORC_COMMON_TESTHELPERS_HPP