# HG changeset patch # User Sebastien Jodogne # Date 1420648901 -3600 # Node ID ee43f0d611a8c9a3cf5827e8fe229f7bc2d19b1b # Parent ac877a0fcf5267eb290213a82acba71d928a96e8 testing diff -r ac877a0fcf52 -r ee43f0d611a8 OrthancServer/DatabaseWrapper.h --- 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& childrenPublicIds, - int64_t id); + virtual void GetChildren(std::list& 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); }; } diff -r ac877a0fcf52 -r ee43f0d611a8 OrthancServer/IDatabaseWrapper.h --- 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& 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; + }; } diff -r ac877a0fcf52 -r ee43f0d611a8 UnitTestsSources/ServerIndexTests.cpp --- 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 listener_; - std::auto_ptr index_; + std::auto_ptr index_; DatabaseWrapperTest() {