diff options
Diffstat (limited to 'src/lib/util')
-rw-r--r-- | src/lib/util/file_utilities.cc | 1 | ||||
-rw-r--r-- | src/lib/util/tests/Makefile.am | 1 | ||||
-rw-r--r-- | src/lib/util/tests/file_utilities_unittest.cc | 8 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/util/file_utilities.cc b/src/lib/util/file_utilities.cc index e59e8f43ca..759c52c3dc 100644 --- a/src/lib/util/file_utilities.cc +++ b/src/lib/util/file_utilities.cc @@ -73,7 +73,6 @@ isFile(const string& name) { return ((stats.st_mode & S_IFMT) == S_IFREG); } - } // namespace file } // namespace log } // namespace isc diff --git a/src/lib/util/tests/Makefile.am b/src/lib/util/tests/Makefile.am index 9a59b4c8ca..cea80c19a1 100644 --- a/src/lib/util/tests/Makefile.am +++ b/src/lib/util/tests/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = . AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib AM_CPPFLAGS += $(BOOST_INCLUDES) +AM_CPPFLAGS += -DABS_SRCDIR=\"$(abs_srcdir)\" AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_builddir)\" AM_CXXFLAGS = $(KEA_CXXFLAGS) diff --git a/src/lib/util/tests/file_utilities_unittest.cc b/src/lib/util/tests/file_utilities_unittest.cc index 478d4764ec..8ab4ee70e9 100644 --- a/src/lib/util/tests/file_utilities_unittest.cc +++ b/src/lib/util/tests/file_utilities_unittest.cc @@ -28,7 +28,7 @@ public: }; FileUtilTest::~FileUtilTest() { - string test_file_name = string(TEST_DATA_BUILDDIR) + "/fu.test"; + string test_file_name(TEST_DATA_BUILDDIR "/fu.test"); static_cast<void>(remove(test_file_name.c_str())); } @@ -65,7 +65,7 @@ TEST_F(FileUtilTest, notRegular) { /// @brief Check getContent works. TEST_F(FileUtilTest, basic) { - string file_name = string(TEST_DATA_BUILDDIR) + "/fu.test"; + string file_name(TEST_DATA_BUILDDIR "/fu.test"); ofstream fs(file_name.c_str(), ofstream::out | ofstream::trunc); ASSERT_TRUE(fs.is_open()); fs << "abdc"; @@ -79,13 +79,13 @@ TEST_F(FileUtilTest, basic) { TEST_F(FileUtilTest, isDir) { EXPECT_TRUE(isDir("/dev")); EXPECT_FALSE(isDir("/dev/null")); - EXPECT_FALSE(isDir("/this/does/not/exists")); + EXPECT_FALSE(isDir("/this/does/not/exist")); EXPECT_FALSE(isDir("/etc/hosts")); } /// @brief Check isFile. TEST_F(FileUtilTest, isFile) { - EXPECT_TRUE(isFile("file_utilities_unittest.cc")); + EXPECT_TRUE(isFile(ABS_SRCDIR "/file_utilities_unittest.cc")); EXPECT_FALSE(isFile(TEST_DATA_BUILDDIR)); } |