From: Francis Dupont Date: Wed, 8 Jul 2015 13:25:35 +0000 (+0200) Subject: [3932] Changed removeFile() to return a status one can check X-Git-Tag: trac4006_base~23^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb67da1c5e5a9fc757d5977e1900b17daa94969c;p=thirdparty%2Fkea.git [3932] Changed removeFile() to return a status one can check --- diff --git a/src/lib/util/tests/csv_file_unittest.cc b/src/lib/util/tests/csv_file_unittest.cc index 1facd1ef22..823d4dab4c 100644 --- a/src/lib/util/tests/csv_file_unittest.cc +++ b/src/lib/util/tests/csv_file_unittest.cc @@ -148,7 +148,7 @@ public: std::string readFile() const; /// @brief Removes existing file (if any). - void removeFile() const; + int removeFile() const; /// @brief Creates file with contents. /// @@ -162,11 +162,11 @@ public: CSVFileTest::CSVFileTest() : testfile_(absolutePath("test.csv")) { - removeFile(); + static_cast(removeFile()); } CSVFileTest::~CSVFileTest() { - removeFile(); + static_cast(removeFile()); } std::string @@ -196,9 +196,9 @@ CSVFileTest::readFile() const { return (contents); } -void +int CSVFileTest::removeFile() const { - remove(testfile_.c_str()); + return (remove(testfile_.c_str())); } void @@ -496,7 +496,7 @@ TEST_F(CSVFileTest, exists) { // Close the file and remove it. csv->close(); - removeFile(); + EXPECT_EQ(0, removeFile()); // The file should not exist. EXPECT_FALSE(csv->exists());