From 6c8e3f09c185d7fa4664ccd9e5c4f623a17b84cc Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 12 Jul 2016 17:24:00 +0300 Subject: Extend fdstream --- tests/link/driver.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tests/link') diff --git a/tests/link/driver.cxx b/tests/link/driver.cxx index 7ec4ac2..a32a8dc 100644 --- a/tests/link/driver.cxx +++ b/tests/link/driver.cxx @@ -4,11 +4,11 @@ #include #include -#include #include // pair #include #include +#include #include using namespace std; @@ -35,10 +35,9 @@ link_file (const path& target, const path& link, bool hard, bool check_content) return true; string s; - ifstream ifs; - ifs.exceptions (fstream::badbit | fstream::failbit); - ifs.open (link.string ()); + ifdstream ifs (link); ifs >> s; + ifs.close (); // Not to miss failed close of the underlying file descriptor. return s == text; } @@ -93,10 +92,9 @@ main () path fp (td / fn); { - ofstream ofs; - ofs.exceptions (fstream::badbit | fstream::failbit); - ofs.open (fp.string ()); + ofdstream ofs (fp); ofs << text; + ofs.close (); } // Create the file hard link. -- cgit v1.1