aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/memmapped_file_system_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2016-07-12 21:12:47 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-07-12 22:17:06 -0700
commit2094bb5349c060516907f02975bcdc6e752d407b (patch)
treee9456682a1ac6deb9a4a1991ec33ebf6c8bea8d2 /tensorflow/core/util/memmapped_file_system_test.cc
parentf6f36020a7e9c2da563cf4053cf653ef00fbd4f7 (diff)
Adding FileSystem::Stat to the core filesystem API. Implemented versions of it for all subclasses except for GCS File System for now.
Change: 127282696
Diffstat (limited to 'tensorflow/core/util/memmapped_file_system_test.cc')
-rw-r--r--tensorflow/core/util/memmapped_file_system_test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/core/util/memmapped_file_system_test.cc b/tensorflow/core/util/memmapped_file_system_test.cc
index cf03647264..a209ef8b9b 100644
--- a/tensorflow/core/util/memmapped_file_system_test.cc
+++ b/tensorflow/core/util/memmapped_file_system_test.cc
@@ -90,6 +90,11 @@ TEST(MemmappedFileSystemTest, SimpleTest) {
TF_ASSERT_OK(memmapped_env.GetFileSize(kTensor2FileName, &file_size));
EXPECT_EQ(test_tensor.TotalBytes(), file_size);
+ // Check that Stat works.
+ FileStatistics stat;
+ TF_ASSERT_OK(memmapped_env.Stat(kTensor2FileName, &stat));
+ EXPECT_EQ(test_tensor.TotalBytes(), stat.length);
+
// Check that if file not found correct error message returned.
EXPECT_EQ(
error::NOT_FOUND,
@@ -139,6 +144,9 @@ TEST(MemmappedFileSystemTest, ProxyToDefault) {
uint64 file_length = 0;
TF_EXPECT_OK(memmapped_env.GetFileSize(filename, &file_length));
EXPECT_EQ(test_string.length(), file_length);
+ FileStatistics stat;
+ TF_EXPECT_OK(memmapped_env.Stat(filename, &stat));
+ EXPECT_EQ(test_string.length(), stat.length);
std::unique_ptr<RandomAccessFile> random_access_file;
TF_ASSERT_OK(
memmapped_env.NewRandomAccessFile(filename, &random_access_file));