diff UnitTestsSources/ServerIndexTests.cpp @ 1672:4c5a85c3ff43 db-changes

sample database plugin now working
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Oct 2015 12:20:49 +0200
parents e5e975e9b738
children 4db9200c7f46
line wrap: on
line diff
--- a/UnitTestsSources/ServerIndexTests.cpp	Thu Oct 01 17:44:43 2015 +0200
+++ b/UnitTestsSources/ServerIndexTests.cpp	Fri Oct 02 12:20:49 2015 +0200
@@ -122,10 +122,12 @@
       }
 
       index_->SetListener(*listener_);
+      index_->Open();
     }
 
     virtual void TearDown()
     {
+      index_->Close();
       index_.reset(NULL);
       listener_.reset(NULL);
     }
@@ -660,6 +662,7 @@
   Toolbox::RemoveFile(path + "/index");
   FilesystemStorage storage(path);
   DatabaseWrapper db;   // The SQLite DB is in memory
+  db.Open();
   ServerContext context(db, storage);
   ServerIndex& index = context.GetIndex();
 
@@ -669,6 +672,7 @@
   ASSERT_EQ(4u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence));
 
   context.Stop();
+  db.Close();
 }
 
 
@@ -728,6 +732,7 @@
   Toolbox::RemoveFile(path + "/index");
   FilesystemStorage storage(path);
   DatabaseWrapper db;   // The SQLite DB is in memory
+  db.Open();
   ServerContext context(db, storage);
   ServerIndex& index = context.GetIndex();
 
@@ -781,4 +786,5 @@
   ASSERT_THROW(Toolbox::GetFileSize(path + "/index"), OrthancException);  
 
   context.Stop();
+  db.Close();
 }