From 915260ad5e0d09eef98b76e294452a9216bc3e14 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 22 Jul 2016 12:40:47 +0300 Subject: Adapt to fdstream extension --- tests/manifest-roundtrip/driver.cxx | 15 +++------------ tests/manifest/driver.cxx | 16 +++------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/tests/manifest-roundtrip/driver.cxx b/tests/manifest-roundtrip/driver.cxx index 4f9a965..91bb108 100644 --- a/tests/manifest-roundtrip/driver.cxx +++ b/tests/manifest-roundtrip/driver.cxx @@ -3,10 +3,9 @@ // license : MIT; see accompanying LICENSE file #include -#include #include -#include // stdout_mode() +#include #include #include @@ -26,13 +25,10 @@ main (int argc, char* argv[]) try { - ifstream ifs; - ifs.exceptions (ifstream::badbit | ifstream::failbit); - ifs.open (argv[1]); - + ifdstream ifs (argv[1]); manifest_parser p (ifs, argv[1]); - stdout_fdmode (fdtranslate::binary); // Write in binary mode. + stdout_fdmode (fdstream_mode::binary); // Write in binary mode. manifest_serializer s (cout, "stdout"); for (bool eom (true), eos (false); !eos; ) @@ -50,11 +46,6 @@ main (int argc, char* argv[]) s.next (nv.name, nv.value); } } - catch (const ios_base::failure&) - { - cerr << "io failure" << endl; - return 1; - } catch (const exception& e) { cerr << e.what () << endl; diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index 74e2166..017b05e 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -3,10 +3,9 @@ // license : MIT; see accompanying LICENSE file #include -#include #include -#include // stdout_mode() +#include #include #include @@ -27,10 +26,7 @@ main (int argc, char* argv[]) try { - ifstream ifs; - ifs.exceptions (ifstream::badbit | ifstream::failbit); - ifs.open (argv[1]); - + ifdstream ifs (argv[1]); manifest_parser p (ifs, argv[1]); #ifdef TEST_PACKAGES @@ -41,16 +37,10 @@ main (int argc, char* argv[]) signature_manifest ms (p); #endif - - stdout_fdmode (fdtranslate::binary); // Write in binary mode. + stdout_fdmode (fdstream_mode::binary); // Write in binary mode. manifest_serializer s (cout, "stdout"); ms.serialize (s); } - catch (const ios_base::failure&) - { - cerr << "io failure" << endl; - return 1; - } catch (const exception& e) { cerr << e.what () << endl; -- cgit v1.1