refs #695 Allow to set a mock root directory for caches, for unit tests.

This commit is contained in:
Mathew Sutcliffe
2016-07-28 22:00:27 +01:00
parent 9339991644
commit 61f3655b2c
4 changed files with 36 additions and 8 deletions

View File

@@ -48,6 +48,13 @@ namespace BlackMisc
{
class CLogCategoryList;
/*!
* Overwrite the default root directory for cache and settings, for testing purposes.
*
* May not be called after any cache or settings objects have been constructed.
*/
BLACKMISC_EXPORT void setMockCacheRootDirectory(const QString &path);
/*!
* Value class used for signalling changed values in the cache.
*/
@@ -280,6 +287,9 @@ namespace BlackMisc
//! \threadsafe
qint64 getTimestampSync(const QString &key) { return std::get<1>(getValue(key)); }
//! \private
static const QString &getCacheRootDirectory();
private:
friend class Private::CValuePage;
struct Element;