diff options
author | 2016-12-08 20:05:49 -0800 | |
---|---|---|
committer | 2016-12-08 20:21:45 -0800 | |
commit | 1cb96893a64f59b7265f9def9968f7bed1e57662 (patch) | |
tree | 0e6d595a0806028f5f92e64c84342ae9659ca108 /tensorflow/core/util/memmapped_file_system_test.cc | |
parent | 90b72f4b2f07a0126efb110d8d4cc96386fcc968 (diff) |
Merge changes from github.
Additionally:
- change single quotes to double quotes to make path rewriting easier
- guard windows lib reference with PLATFORM_WINDOWS
- fixed failing kmeans test
Change: 141515942
Diffstat (limited to 'tensorflow/core/util/memmapped_file_system_test.cc')
-rw-r--r-- | tensorflow/core/util/memmapped_file_system_test.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tensorflow/core/util/memmapped_file_system_test.cc b/tensorflow/core/util/memmapped_file_system_test.cc index c7d919041a..179c72c1f5 100644 --- a/tensorflow/core/util/memmapped_file_system_test.cc +++ b/tensorflow/core/util/memmapped_file_system_test.cc @@ -137,8 +137,15 @@ TEST(MemmappedFileSystemTest, ProxyToDefault) { const string dir = testing::TmpDir(); const string filename = io::JoinPath(dir, "test_file"); // Check that we can create write and read ordinary file. - std::unique_ptr<WritableFile> writable_file; - TF_ASSERT_OK(memmapped_env.NewAppendableFile(filename, &writable_file)); + std::unique_ptr<WritableFile> writable_file_temp; + TF_ASSERT_OK(memmapped_env.NewAppendableFile(filename, &writable_file_temp)); + // Making sure to clean up after the test finishes. + const auto adh = [&memmapped_env, &filename](WritableFile* f) { + delete f; + memmapped_env.DeleteFile(filename); + }; + std::unique_ptr<WritableFile, decltype(adh)> writable_file( + writable_file_temp.release(), adh); const string test_string = "bla-bla-bla"; TF_ASSERT_OK(writable_file->Append(test_string)); TF_ASSERT_OK(writable_file->Close()); |