ndn-handle: Implement TCP backdoor to inject data packets into repo
Change-Id: I74d0698f914a2e68d47ede427c7f36b3ba3b4f47
Refs: #1485
diff --git a/tests/sqlite-fixture.hpp b/tests/sqlite-fixture.hpp
new file mode 100644
index 0000000..b370f20
--- /dev/null
+++ b/tests/sqlite-fixture.hpp
@@ -0,0 +1,46 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (C) 2014 Regents of the University of California.
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef REPO_TESTS_SQLITE_FIXTURE_HPP
+#define REPO_TESTS_SQLITE_FIXTURE_HPP
+
+#include "../storage/sqlite/sqlite-handle.hpp"
+
+#include <boost/filesystem.hpp>
+#include <boost/test/unit_test.hpp>
+
+namespace repo {
+namespace tests {
+
+class SqliteFixture
+{
+public:
+ SqliteFixture()
+ {
+ boost::filesystem::path testPath("unittestdb");
+ boost::filesystem::file_status testPathStatus = boost::filesystem::status(testPath);
+ if (!boost::filesystem::is_directory(testPathStatus)) {
+ if (!boost::filesystem::create_directory(boost::filesystem::path(testPath))) {
+ BOOST_FAIL("Cannot create unittestdb folder");
+ }
+ }
+ handle = new SqliteHandle("unittestdb");
+ }
+
+ ~SqliteFixture()
+ {
+ delete handle;
+ boost::filesystem::remove_all(boost::filesystem::path("unittestdb"));
+ }
+
+public:
+ SqliteHandle* handle;
+};
+
+} // namespace tests
+} // namespace repo
+
+#endif // REPO_TESTS_SQLITE_FIXTURE_HPP