# HG changeset patch # User Sebastien Jodogne # Date 1547479388 -3600 # Node ID f86ebf971a72d4e155f82d7274c42b71ded0b45b # Parent a323b75e5b08f4570c84d6a4ff53375b42eb5d37 fix unit tests diff -r a323b75e5b08 -r f86ebf971a72 OrthancServer/Database/Compatibility/ICreateInstance.cpp --- a/OrthancServer/Database/Compatibility/ICreateInstance.cpp Mon Jan 14 13:13:12 2019 +0100 +++ b/OrthancServer/Database/Compatibility/ICreateInstance.cpp Mon Jan 14 16:23:08 2019 +0100 @@ -143,6 +143,8 @@ database.AttachChild(result.patientId_, result.studyId_); } + database.TagAsMostRecentPatient(result.patientId_); + // Sanity checks assert(result.patientId_ != -1); assert(result.studyId_ != -1); diff -r a323b75e5b08 -r f86ebf971a72 OrthancServer/Database/Compatibility/ICreateInstance.h --- a/OrthancServer/Database/Compatibility/ICreateInstance.h Mon Jan 14 13:13:12 2019 +0100 +++ b/OrthancServer/Database/Compatibility/ICreateInstance.h Mon Jan 14 16:23:08 2019 +0100 @@ -51,6 +51,8 @@ virtual void AttachChild(int64_t parent, int64_t child) = 0; + + virtual void TagAsMostRecentPatient(int64_t patientId) = 0; static bool Apply(ICreateInstance& database, IDatabaseWrapper::CreateInstanceResult& result, diff -r a323b75e5b08 -r f86ebf971a72 OrthancServer/Database/SQLiteDatabaseWrapper.cpp --- a/OrthancServer/Database/SQLiteDatabaseWrapper.cpp Mon Jan 14 13:13:12 2019 +0100 +++ b/OrthancServer/Database/SQLiteDatabaseWrapper.cpp Mon Jan 14 16:23:08 2019 +0100 @@ -330,7 +330,7 @@ int SQLiteDatabaseWrapper::GetGlobalIntegerProperty(GlobalProperty property, - unsigned int defaultValue) + int defaultValue) { std::string tmp; @@ -418,11 +418,6 @@ } } - /*if (GetGlobalIntegerProperty(GlobalProperty_DatabasePatchLevel, 0) <= 0) - { - SetGlobalProperty(GlobalProperty_DatabasePatchLevel, "1"); - }*/ - t.Commit(); } @@ -1326,4 +1321,10 @@ return 0; } } + + + void SQLiteDatabaseWrapper::TagAsMostRecentPatient(int64_t patient) + { + // TODO + } } diff -r a323b75e5b08 -r f86ebf971a72 OrthancServer/Database/SQLiteDatabaseWrapper.h --- a/OrthancServer/Database/SQLiteDatabaseWrapper.h Mon Jan 14 13:13:12 2019 +0100 +++ b/OrthancServer/Database/SQLiteDatabaseWrapper.h Mon Jan 14 16:23:08 2019 +0100 @@ -79,8 +79,9 @@ void ClearTable(const std::string& tableName); + // Unused => could be removed int GetGlobalIntegerProperty(GlobalProperty property, - unsigned int defaultValue); + int defaultValue); public: SQLiteDatabaseWrapper(const std::string& path); @@ -358,5 +359,7 @@ } virtual int64_t GetLastChangeIndex() ORTHANC_OVERRIDE; + + virtual void TagAsMostRecentPatient(int64_t patient) ORTHANC_OVERRIDE; }; } diff -r a323b75e5b08 -r f86ebf971a72 Plugins/Engine/OrthancPluginDatabase.cpp --- a/Plugins/Engine/OrthancPluginDatabase.cpp Mon Jan 14 13:13:12 2019 +0100 +++ b/Plugins/Engine/OrthancPluginDatabase.cpp Mon Jan 14 16:23:08 2019 +0100 @@ -1414,4 +1414,10 @@ return result; } } + + + void OrthancPluginDatabase::TagAsMostRecentPatient(int64_t patient) + { + // TODO + } } diff -r a323b75e5b08 -r f86ebf971a72 Plugins/Engine/OrthancPluginDatabase.h --- a/Plugins/Engine/OrthancPluginDatabase.h Mon Jan 14 13:13:12 2019 +0100 +++ b/Plugins/Engine/OrthancPluginDatabase.h Mon Jan 14 16:23:08 2019 +0100 @@ -362,6 +362,8 @@ ORTHANC_OVERRIDE; virtual int64_t GetLastChangeIndex() ORTHANC_OVERRIDE; + + virtual void TagAsMostRecentPatient(int64_t patient) ORTHANC_OVERRIDE; }; } diff -r a323b75e5b08 -r f86ebf971a72 UnitTestsSources/ServerIndexTests.cpp --- a/UnitTestsSources/ServerIndexTests.cpp Mon Jan 14 13:13:12 2019 +0100 +++ b/UnitTestsSources/ServerIndexTests.cpp Mon Jan 14 16:23:08 2019 +0100 @@ -395,7 +395,7 @@ CheckTableRecordCount(0, "Resources"); CheckTableRecordCount(0, "AttachedFiles"); - CheckTableRecordCount(4, "GlobalProperties"); // 4 since 1.5.2 because of GlobalProperty_DatabasePatchLevel + CheckTableRecordCount(3, "GlobalProperties"); std::string tmp; ASSERT_TRUE(index_->LookupGlobalProperty(tmp, GlobalProperty_DatabaseSchemaVersion));