Utils: Allow membind-ing const member functions
[senf.git] / Socket / NetdeviceController.test.cc
index a55102e..dcc8a3b 100644 (file)
@@ -20,7 +20,8 @@
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-// Unit tests
+/** \file
+    \brief NetdeviceController unit tests */
 
 //#include "NetdeviceController.test.hh"
 //#include "NetdeviceController.test.ih"
@@ -40,6 +41,11 @@ BOOST_AUTO_UNIT_TEST(NetdeviceController) {
     senf::NetdeviceController ctrl ("lo");
     BOOST_CHECK_EQUAL( ctrl.interfaceName(), "lo");
 
+    int index = ctrl.interfaceIndex();
+    BOOST_CHECK_EQUAL( index, senf::NetdeviceController(index).interfaceIndex() );
+    
+    BOOST_CHECK_THROW( senf::NetdeviceController("invalid_interfacename"), senf::SystemException );
+    
     int oldMTU;
     SENF_CHECK_NO_THROW( oldMTU = ctrl.mtu());
 
@@ -52,6 +58,7 @@ BOOST_AUTO_UNIT_TEST(NetdeviceController) {
     BOOST_CHECK_EQUAL( ctrl.mtu(), oldMTU-16);
     SENF_CHECK_NO_THROW( ctrl.mtu(oldMTU));
     BOOST_CHECK_EQUAL( ctrl.mtu(), oldMTU);
+    
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////