Mercurial > hg > orthanc
changeset 1252:ee43f0d611a8
testing
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 07 Jan 2015 17:41:41 +0100 |
parents | ac877a0fcf52 |
children | f66beac9ee42 |
files | OrthancServer/DatabaseWrapper.h OrthancServer/IDatabaseWrapper.h UnitTestsSources/ServerIndexTests.cpp |
diffstat | 3 files changed, 19 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.h Tue Jan 06 14:25:44 2015 +0100 +++ b/OrthancServer/DatabaseWrapper.h Wed Jan 07 17:41:41 2015 +0100 @@ -213,13 +213,13 @@ return db_.GetErrorMessage(); } - void GetChildren(std::list<std::string>& childrenPublicIds, - int64_t id); + virtual void GetChildren(std::list<std::string>& childrenPublicIds, + int64_t id); - int64_t GetTableRecordCount(const std::string& table); + virtual int64_t GetTableRecordCount(const std::string& table); - bool GetParentPublicId(std::string& result, - int64_t id); + virtual bool GetParentPublicId(std::string& result, + int64_t id); }; }
--- a/OrthancServer/IDatabaseWrapper.h Tue Jan 06 14:25:44 2015 +0100 +++ b/OrthancServer/IDatabaseWrapper.h Wed Jan 07 17:41:41 2015 +0100 @@ -172,5 +172,18 @@ virtual SQLite::ITransaction* StartTransaction() = 0; virtual void SetListener(IServerIndexListener& listener) = 0; + + + // For unit tests only! + virtual void GetChildren(std::list<std::string>& childrenPublicIds, + int64_t id) = 0; + + // For unit tests only! + virtual int64_t GetTableRecordCount(const std::string& table) = 0; + + // For unit tests only! + virtual bool GetParentPublicId(std::string& result, + int64_t id) = 0; + }; }
--- a/UnitTestsSources/ServerIndexTests.cpp Tue Jan 06 14:25:44 2015 +0100 +++ b/UnitTestsSources/ServerIndexTests.cpp Wed Jan 07 17:41:41 2015 +0100 @@ -101,7 +101,7 @@ { protected: std::auto_ptr<ServerIndexListener> listener_; - std::auto_ptr<DatabaseWrapper> index_; + std::auto_ptr<IDatabaseWrapper> index_; DatabaseWrapperTest() {