X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FFileHandle.test.cc;h=6835f151a85b011e69932f7c3c4f0759c3dc56d4;hb=55c979a770543e8086a9828f5ec4576a7c7a9384;hp=21b3708b5a1ad40d051271054e05cd302dd7a7a4;hpb=145f6a7d0f3a6aaa77b3625351c952d24cb0b8a1;p=senf.git diff --git a/Socket/FileHandle.test.cc b/Socket/FileHandle.test.cc index 21b3708..6835f15 100644 --- a/Socket/FileHandle.test.cc +++ b/Socket/FileHandle.test.cc @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ #include #include "FileHandle.hh" -#include +#include "../Utils/auto_unit_test.hh" #include #define prefix_ @@ -45,13 +45,13 @@ namespace { 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())) { int rv = ::open(name.c_str(),O_RDWR|O_NONBLOCK) ; if (rv<0) - throw senf::SystemException(errno); + throw senf::SystemException(); fd(rv); } }; @@ -97,6 +97,7 @@ BOOST_AUTO_UNIT_TEST(fileHandle) if (fcntl(fds[1],F_SETFL,flags|O_NONBLOCK) == -1) BOOST_FAIL(strerror(errno)); char buffer[1024]; + ::memset(buffer, 0, sizeof(buffer)); while (write(fds[1],buffer,1024) == 1024) ; FHandle fh2(fds[1]);