diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-01-05 20:04:32 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:43 +0100 |
commit | d491aaab13a7719fe31c7474f09d86f3cd0c53f7 (patch) | |
tree | cf9f8320e2acc0a46546eb300ceb8858379b1494 | |
parent | 63b09d923c6d1dcee03ac0ec84c547864f7870f5 (diff) | |
download | usdx-d491aaab13a7719fe31c7474f09d86f3cd0c53f7.tar.gz usdx-d491aaab13a7719fe31c7474f09d86f3cd0c53f7.tar.xz usdx-d491aaab13a7719fe31c7474f09d86f3cd0c53f7.zip |
added possibility to test private methods
-rw-r--r-- | src/base/database.hpp | 12 | ||||
-rw-r--r-- | test/base/database.cpp | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/base/database.hpp b/src/base/database.hpp index e9ebdb20..687537cc 100644 --- a/src/base/database.hpp +++ b/src/base/database.hpp @@ -47,6 +47,15 @@ namespace usdx StatDatabase(std::string filename); static StatDatabase* instance; + + int get_version(void); + void set_version(int version); + +#ifdef STAT_DATABASE_TEST + // for testing private members + friend class StatDatabaseTest; +#endif + public: static StatDatabase* get_instance(); @@ -54,9 +63,6 @@ namespace usdx static void init(const std::string filename); - int get_version(void); - void set_version(int version); - /* void read_score(Song *song); void add_score(Song *song, int level, const char* name, int score); void write_score(Song *song); diff --git a/test/base/database.cpp b/test/base/database.cpp index db15d948..52635687 100644 --- a/test/base/database.cpp +++ b/test/base/database.cpp @@ -24,8 +24,12 @@ * $Id$ */ +#define STAT_DATABASE_TEST + #include "database.hpp" #include <cppunit/extensions/HelperMacros.h> +#include <ctime> +#include <cstring> namespace usdx { |