comparison UnitTestsSources/ServerIndexTests.cpp @ 2665:389d050a2e66 jobs

fix deadlock, speed up unit tests
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 08 Jun 2018 13:51:31 +0200
parents 4dcafa8d6633
children 06c0a6b8a871
comparison
equal deleted inserted replaced
2664:a21b244efb37 2665:389d050a2e66
673 673
674 SystemToolbox::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, true /* running unit tests */);
679 ServerIndex& index = context.GetIndex(); 679 ServerIndex& index = context.GetIndex();
680 680
681 ASSERT_EQ(1u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); 681 ASSERT_EQ(1u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence));
682 ASSERT_EQ(2u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); 682 ASSERT_EQ(2u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence));
683 ASSERT_EQ(3u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); 683 ASSERT_EQ(3u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence));
771 771
772 SystemToolbox::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, true /* running unit tests */);
777 ServerIndex& index = context.GetIndex(); 777 ServerIndex& index = context.GetIndex();
778 778
779 index.SetMaximumStorageSize(10); 779 index.SetMaximumStorageSize(10);
780 780
781 Json::Value tmp; 781 Json::Value tmp;