diff --git a/tests/face/ethernet.cpp b/tests/face/ethernet.cpp
index f2e7134..9322d4c 100644
--- a/tests/face/ethernet.cpp
+++ b/tests/face/ethernet.cpp
@@ -22,18 +22,21 @@
   if (interfaces.size() > 0)
     {
       shared_ptr<EthernetFace> face1;
-      BOOST_REQUIRE_NO_THROW(face1 = factory.createMulticast(interfaces[0],
-                                                             ethernet::getBroadcastAddress()));
+      BOOST_REQUIRE_NO_THROW(face1 =
+                             factory.createMulticastFace(interfaces[0],
+                                                     ethernet::getBroadcastAddress()));
       shared_ptr<EthernetFace> face1bis;
-      BOOST_REQUIRE_NO_THROW(face1bis = factory.createMulticast(interfaces[0],
-                                                                ethernet::getBroadcastAddress()));
+      BOOST_REQUIRE_NO_THROW(face1bis =
+                             factory.createMulticastFace(interfaces[0],
+                                                         ethernet::getBroadcastAddress()));
       BOOST_CHECK_EQUAL(face1, face1bis);
 
       if (interfaces.size() > 1)
         {
           shared_ptr<EthernetFace> face2;
-          BOOST_REQUIRE_NO_THROW(face2 = factory.createMulticast(interfaces[1],
-                                                                 ethernet::getBroadcastAddress()));
+          BOOST_REQUIRE_NO_THROW(face2 =
+                                 factory.createMulticastFace(interfaces[1],
+                                                             ethernet::getBroadcastAddress()));
           BOOST_CHECK_NE(face1, face2);
         }
       else
@@ -43,8 +46,9 @@
         }
 
       shared_ptr<EthernetFace> face3;
-      BOOST_REQUIRE_NO_THROW(face3 = factory.createMulticast(interfaces[0],
-                                                             ethernet::getDefaultMulticastAddress()));
+      BOOST_REQUIRE_NO_THROW(face3 =
+                             factory.createMulticastFace(interfaces[0],
+                                                         ethernet::getDefaultMulticastAddress()));
       BOOST_CHECK_NE(face1, face3);
     }
   else
@@ -67,7 +71,7 @@
     }
 
   shared_ptr<EthernetFace> face =
-    factory.createMulticast(interfaces[0], ethernet::getDefaultMulticastAddress());
+    factory.createMulticastFace(interfaces[0], ethernet::getDefaultMulticastAddress());
 
   BOOST_REQUIRE(static_cast<bool>(face));
   BOOST_CHECK_EQUAL(face->isLocal(), false);
