diff UnitTestsSources/ServerIndexTests.cpp @ 1247:32fcc5dc7562

abstraction
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Dec 2014 13:54:27 +0100
parents 90d2f320862d
children ee43f0d611a8
line wrap: on
line diff
--- a/UnitTestsSources/ServerIndexTests.cpp	Mon Dec 08 12:56:30 2014 +0100
+++ b/UnitTestsSources/ServerIndexTests.cpp	Mon Dec 08 13:54:27 2014 +0100
@@ -110,7 +110,8 @@
     virtual void SetUp() 
     {
       listener_.reset(new ServerIndexListener);
-      index_.reset(new DatabaseWrapper(*listener_));
+      index_.reset(new DatabaseWrapper());
+      index_->SetListener(*listener_);
     }
 
     virtual void TearDown()
@@ -547,7 +548,8 @@
 
   Toolbox::RemoveFile(path + "/index");
   FilesystemStorage storage(path);
-  ServerContext context(":memory:");   // The SQLite DB is in memory
+  DatabaseWrapper db;   // The SQLite DB is in memory
+  ServerContext context(db);
   context.SetStorageArea(storage);
   ServerIndex& index = context.GetIndex();
 
@@ -614,7 +616,8 @@
 
   Toolbox::RemoveFile(path + "/index");
   FilesystemStorage storage(path);
-  ServerContext context(":memory:");   // The SQLite DB is in memory
+  DatabaseWrapper db;   // The SQLite DB is in memory
+  ServerContext context(db);
   context.SetStorageArea(storage);
   ServerIndex& index = context.GetIndex();