Mercurial > hg > orthanc
comparison UnitTestsSources/ServerIndexTests.cpp @ 1549:e5e975e9b738
refactoring and simplification of StorageAccessor
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 17 Aug 2015 10:47:04 +0200 |
parents | d73a2178b319 |
children | 4c5a85c3ff43 |
comparison
equal
deleted
inserted
replaced
1548:e9325f3ac496 | 1549:e5e975e9b738 |
---|---|
658 const std::string path = "UnitTestsStorage"; | 658 const std::string path = "UnitTestsStorage"; |
659 | 659 |
660 Toolbox::RemoveFile(path + "/index"); | 660 Toolbox::RemoveFile(path + "/index"); |
661 FilesystemStorage storage(path); | 661 FilesystemStorage storage(path); |
662 DatabaseWrapper db; // The SQLite DB is in memory | 662 DatabaseWrapper db; // The SQLite DB is in memory |
663 ServerContext context(db); | 663 ServerContext context(db, storage); |
664 context.SetStorageArea(storage); | |
665 ServerIndex& index = context.GetIndex(); | 664 ServerIndex& index = context.GetIndex(); |
666 | 665 |
667 ASSERT_EQ(1u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | 666 ASSERT_EQ(1u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); |
668 ASSERT_EQ(2u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | 667 ASSERT_EQ(2u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); |
669 ASSERT_EQ(3u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | 668 ASSERT_EQ(3u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); |
727 const std::string path = "UnitTestsStorage"; | 726 const std::string path = "UnitTestsStorage"; |
728 | 727 |
729 Toolbox::RemoveFile(path + "/index"); | 728 Toolbox::RemoveFile(path + "/index"); |
730 FilesystemStorage storage(path); | 729 FilesystemStorage storage(path); |
731 DatabaseWrapper db; // The SQLite DB is in memory | 730 DatabaseWrapper db; // The SQLite DB is in memory |
732 ServerContext context(db); | 731 ServerContext context(db, storage); |
733 context.SetStorageArea(storage); | |
734 ServerIndex& index = context.GetIndex(); | 732 ServerIndex& index = context.GetIndex(); |
735 | 733 |
736 index.SetMaximumStorageSize(10); | 734 index.SetMaximumStorageSize(10); |
737 | 735 |
738 Json::Value tmp; | 736 Json::Value tmp; |