comparison UnitTestsSources/ServerIndexTests.cpp @ 2140:aa4b8895cd23

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Nov 2016 16:12:47 +0100
parents 7e8889bc95c6
children 5a8840920121
comparison
equal deleted inserted replaced
2139:764c9157301b 2140:aa4b8895cd23
669 669
670 TEST(ServerIndex, Sequence) 670 TEST(ServerIndex, Sequence)
671 { 671 {
672 const std::string path = "UnitTestsStorage"; 672 const std::string path = "UnitTestsStorage";
673 673
674 Toolbox::RemoveFile(path + "/index"); 674 SystemToolbox::RemoveFile(path + "/index");
675 FilesystemStorage storage(path); 675 FilesystemStorage storage(path);
676 DatabaseWrapper db; // The SQLite DB is in memory 676 DatabaseWrapper db; // The SQLite DB is in memory
677 db.Open(); 677 db.Open();
678 ServerContext context(db, storage); 678 ServerContext context(db, storage);
679 ServerIndex& index = context.GetIndex(); 679 ServerIndex& index = context.GetIndex();
767 767
768 TEST(ServerIndex, AttachmentRecycling) 768 TEST(ServerIndex, AttachmentRecycling)
769 { 769 {
770 const std::string path = "UnitTestsStorage"; 770 const std::string path = "UnitTestsStorage";
771 771
772 Toolbox::RemoveFile(path + "/index"); 772 SystemToolbox::RemoveFile(path + "/index");
773 FilesystemStorage storage(path); 773 FilesystemStorage storage(path);
774 DatabaseWrapper db; // The SQLite DB is in memory 774 DatabaseWrapper db; // The SQLite DB is in memory
775 db.Open(); 775 db.Open();
776 ServerContext context(db, storage); 776 ServerContext context(db, storage);
777 ServerIndex& index = context.GetIndex(); 777 ServerIndex& index = context.GetIndex();
822 index.ComputeStatistics(tmp); 822 index.ComputeStatistics(tmp);
823 ASSERT_GE(10, boost::lexical_cast<int>(tmp["TotalDiskSize"].asString())); 823 ASSERT_GE(10, boost::lexical_cast<int>(tmp["TotalDiskSize"].asString()));
824 } 824 }
825 825
826 // Because the DB is in memory, the SQLite index must not have been created 826 // Because the DB is in memory, the SQLite index must not have been created
827 ASSERT_FALSE(Toolbox::IsRegularFile(path + "/index")); 827 ASSERT_FALSE(SystemToolbox::IsRegularFile(path + "/index"));
828 828
829 context.Stop(); 829 context.Stop();
830 db.Close(); 830 db.Close();
831 } 831 }
832 832