table: mock PIT
refs #1128
Change-Id: I8943ad07d93422dc456fd051b2e4c0d5f38bc227
diff --git a/tests/face/dummy-face.hpp b/tests/face/dummy-face.hpp
new file mode 100644
index 0000000..a960380
--- /dev/null
+++ b/tests/face/dummy-face.hpp
@@ -0,0 +1,39 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Named Data Networking Project
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NFD_TEST_FACE_DUMMY_FACE_HPP
+#define NFD_TEST_FACE_DUMMY_FACE_HPP
+
+#include "face/face.hpp"
+
+namespace ndn {
+
+/** \class DummyFace
+ * \brief provides a Face that cannot communicate
+ * for unit testing only
+ */
+class DummyFace : public Face
+{
+public:
+ DummyFace(FaceId id)
+ : Face(id)
+ {
+ }
+
+ virtual void
+ sendInterest(const Interest &interest)
+ {
+ }
+
+ virtual void
+ sendData(const Data &data)
+ {
+ }
+};
+
+} // namespace ndn
+
+#endif // TEST_FACE_DUMMY_FACE_HPP
diff --git a/tests/face/face.cpp b/tests/face/face.cpp
index b453110..e84ab03 100644
--- a/tests/face/face.cpp
+++ b/tests/face/face.cpp
@@ -5,6 +5,7 @@
*/
#include "face/face.hpp"
+#include "dummy-face.hpp"
#include <boost/test/unit_test.hpp>
@@ -12,28 +13,9 @@
BOOST_AUTO_TEST_SUITE(FaceFace)
-class FaceTestFace : public Face
-{
-public:
- FaceTestFace()
- : Face(1)
- {
- }
-
- virtual void
- sendInterest(const Interest &interest)
- {
- }
-
- virtual void
- sendData(const Data &data)
- {
- }
-};
-
BOOST_AUTO_TEST_CASE(Description)
{
- FaceTestFace face;
+ DummyFace face(1);
face.setDescription("3pFsKrvWr");
BOOST_CHECK_EQUAL(face.getDescription(), "3pFsKrvWr");
}