Mercurial > hg > orthanc
comparison UnitTestsSources/ServerIndexTests.cpp @ 1237:0f3716b88af7
cleaning
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 05 Dec 2014 15:33:16 +0100 |
parents | 21d84e3acc0d |
children | 6c07108ff1e2 |
comparison
equal
deleted
inserted
replaced
1236:21d84e3acc0d | 1237:0f3716b88af7 |
---|---|
538 ASSERT_EQ(0u, index_->GetTableRecordCount("PatientRecyclingOrder")); | 538 ASSERT_EQ(0u, index_->GetTableRecordCount("PatientRecyclingOrder")); |
539 } | 539 } |
540 | 540 |
541 | 541 |
542 | 542 |
543 TEST_P(DatabaseWrapperTest, Sequence) | 543 TEST(ServerIndex, Sequence) |
544 { | 544 { |
545 ASSERT_EQ(1u, index_->IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | 545 const std::string path = "UnitTestsStorage"; |
546 ASSERT_EQ(2u, index_->IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | 546 |
547 ASSERT_EQ(3u, index_->IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | 547 Toolbox::RemoveFile(path + "/index"); |
548 ASSERT_EQ(4u, index_->IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | 548 FilesystemStorage storage(path); |
549 ServerContext context(":memory:"); // The SQLite DB is in memory | |
550 context.SetStorageArea(storage); | |
551 ServerIndex& index = context.GetIndex(); | |
552 | |
553 ASSERT_EQ(1u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | |
554 ASSERT_EQ(2u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | |
555 ASSERT_EQ(3u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | |
556 ASSERT_EQ(4u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); | |
549 } | 557 } |
550 | 558 |
551 | 559 |
552 | 560 |
553 TEST_P(DatabaseWrapperTest, LookupIdentifier) | 561 TEST_P(DatabaseWrapperTest, LookupIdentifier) |