aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-12-12 17:55:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-12-12 17:55:12 +0000
commit59aaa6c06b80bd7285573b407dad4f3e008351de (patch)
tree7b2dcfc365f8e1acfde2828a092696cc9026c842 /llvm/unittests/Support/Path.cpp
parent5753cf3c6371ef269da3f645afbabb2fd92ae56e (diff)
downloadllvm-59aaa6c06b80bd7285573b407dad4f3e008351de.zip
llvm-59aaa6c06b80bd7285573b407dad4f3e008351de.tar.gz
llvm-59aaa6c06b80bd7285573b407dad4f3e008351de.tar.bz2
Pass a FD to resise_file and add a testcase.
I will add a real use in another commit. llvm-svn: 224136
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r--llvm/unittests/Support/Path.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 81d9234..88baade 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -638,6 +638,16 @@ TEST_F(FileSystemTest, CarriageReturn) {
}
#endif
+TEST_F(FileSystemTest, Resize) {
+ int FD;
+ SmallString<64> TempPath;
+ ASSERT_NO_ERROR(fs::createTemporaryFile("prefix", "temp", FD, TempPath));
+ ASSERT_NO_ERROR(fs::resize_file(FD, 123));
+ fs::file_status Status;
+ ASSERT_NO_ERROR(fs::status(FD, Status));
+ ASSERT_EQ(Status.getSize(), 123U);
+}
+
TEST_F(FileSystemTest, FileMapping) {
// Create a temp file.
int FileDescriptor;