PPI: Checkin of first compiling (yet not working) version
[senf.git] / Socket / FileHandle.test.cc
index 262bf0c..f4dac9d 100644 (file)
@@ -41,10 +41,11 @@ namespace {
     class FHandle : public senf::FileHandle
     {
     public:
-        FHandle(int fd=-1)
+        FHandle() {}
+        FHandle(int fd)
             : senf::FileHandle(std::auto_ptr<senf::FileBody>(
                                           new senf::FileBody(fd))) {}
-        FHandle(std::string name)
+        FHandle(std::string const & name)
             : senf::FileHandle(std::auto_ptr<senf::FileBody>(
                                           new senf::FileBody()))
             {
@@ -66,7 +67,9 @@ 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());
@@ -115,4 +118,6 @@ BOOST_AUTO_UNIT_TEST(fileHandle)
 // c-file-style: "senf"
 // indent-tabs-mode: nil
 // ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
 // End: