From a1384c3d5ab0009e436bf3fbee8dd674bdec853b Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Thu, 10 Oct 2024 16:21:41 -1000 Subject: [PATCH] Commenting out unused code testing++ --- include/fsmod/PartitionFIFOCaching.hpp | 2 +- src/PartitionFIFOCaching.cpp | 14 +++++++------- test/truncate_test.cpp | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/fsmod/PartitionFIFOCaching.hpp b/include/fsmod/PartitionFIFOCaching.hpp index e1d8e75..38709a9 100644 --- a/include/fsmod/PartitionFIFOCaching.hpp +++ b/include/fsmod/PartitionFIFOCaching.hpp @@ -41,7 +41,7 @@ namespace simgrid::fsmod { private: unsigned long sequence_number_ = 0; std::map priority_list_; - void print_priority_list(); +// void print_priority_list(); }; /** \endcond */ diff --git a/src/PartitionFIFOCaching.cpp b/src/PartitionFIFOCaching.cpp index 22dda1a..f30882e 100644 --- a/src/PartitionFIFOCaching.cpp +++ b/src/PartitionFIFOCaching.cpp @@ -38,13 +38,13 @@ namespace simgrid::fsmod { } } - void PartitionFIFOCaching::print_priority_list() { - std::cerr << "PLIST " << this->get_name() << " = "; - for (auto const &i : priority_list_) { - std::cerr << " " << i.second->file_name_ << " "; - } - std::cerr << "\n"; - } +// void PartitionFIFOCaching::print_priority_list() { +// std::cerr << "PLIST " << this->get_name() << " = "; +// for (auto const &i : priority_list_) { +// std::cerr << " " << i.second->file_name_ << " "; +// } +// std::cerr << "\n"; +// } void PartitionFIFOCaching::new_file_creation_event(FileMetadata *file_metadata) { file_metadata->sequence_number_ = sequence_number_++; diff --git a/test/truncate_test.cpp b/test/truncate_test.cpp index b67250e..36e2d31 100644 --- a/test/truncate_test.cpp +++ b/test/truncate_test.cpp @@ -56,6 +56,8 @@ TEST_F(TruncateTest, TruncateAndTell) { ASSERT_NO_THROW(file = fs_->open("/dev/a/foo.txt", "a")); XBT_INFO("Check current position, should be 100k ('append' mode)"); ASSERT_DOUBLE_EQ(file->tell(), 100*1000); + XBT_INFO("Try to truncate an opened file, which should fail"); + ASSERT_THROW(fs_->truncate_file("/dev/a/foo.txt", 50*1000), sgfs::InvalidTruncateException); XBT_INFO("Close the file"); ASSERT_NO_THROW(file->close()); XBT_INFO("Truncate the file to half its size");