From 1a6d365db54ca6a3204adb09b0f0d9a92e920cdb Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 3 May 2014 15:46:11 -0700 Subject: [PATCH] Fix move assignment. --- test/gtest-extra-test.cc | 2 +- test/gtest-extra.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/gtest-extra-test.cc b/test/gtest-extra-test.cc index 02feaa01..daf5fe3e 100644 --- a/test/gtest-extra-test.cc +++ b/test/gtest-extra-test.cc @@ -204,7 +204,7 @@ TEST(FileTest, MoveAssignmentClosesFile) { File f2("CMakeLists.txt", File::RDONLY); int old_fd = f2.descriptor(); f2 = std::move(f); - EXPECT_TRUE(IsClosedInternal(old_fd)); + EXPECT_CLOSED(old_fd); } File OpenFile(int &fd) { diff --git a/test/gtest-extra.h b/test/gtest-extra.h index 31104750..057ab8f1 100644 --- a/test/gtest-extra.h +++ b/test/gtest-extra.h @@ -177,7 +177,8 @@ class File { other.fd_ = -1; } - File& operator=(File &&other) FMT_NOEXCEPT(true) { + File& operator=(File &&other) { + close(); fd_ = other.fd_; other.fd_ = -1; return *this;