X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FFileHandle.test.cc;h=f4dac9dfb3a2e10182821c3979a2359234484dd3;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=dd2243559be77ab7d213c9e600246a4426ce3890;hpb=ac6a813d9d99f7add4e13aff7a4bcd314d5604a6;p=senf.git diff --git a/Socket/FileHandle.test.cc b/Socket/FileHandle.test.cc index dd22435..f4dac9d 100644 --- a/Socket/FileHandle.test.cc +++ b/Socket/FileHandle.test.cc @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2006 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) // Stefan Bund @@ -41,10 +41,11 @@ namespace { class FHandle : public senf::FileHandle { public: - FHandle(int fd=-1) + FHandle() {} + FHandle(int fd) : senf::FileHandle(std::auto_ptr( new senf::FileBody(fd))) {} - FHandle(std::string name) + FHandle(std::string const & name) : senf::FileHandle(std::auto_ptr( new senf::FileBody())) { @@ -66,15 +67,17 @@ BOOST_AUTO_UNIT_TEST(fileHandle) BOOST_CHECK(fh); BOOST_CHECK(!!fh); - FHandle fh2(fh); + FHandle fh2; + BOOST_CHECK( ! fh2.valid() ); + fh2 = fh; BOOST_CHECK_EQUAL(fh.fd(), fh2.fd()); - + BOOST_CHECK(fh.writeable()); BOOST_CHECK_NO_THROW(fh.close()); BOOST_CHECK_THROW(fh.close(),senf::SystemException); BOOST_CHECK_NO_THROW(fh.terminate()); } - + { FHandle fh("/dev/zero"); BOOST_CHECK(fh.readable()); @@ -104,12 +107,17 @@ BOOST_AUTO_UNIT_TEST(fileHandle) BOOST_FAIL(ex.what()); } } - + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ // Local Variables: // mode: c++ +// fill-column: 100 // c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: