diff -r 77e7acc57f67 -r aec58c99dafc sourcehook/test/main.cpp --- a/sourcehook/test/main.cpp Tue Sep 13 22:16:29 2005 +0000 +++ b/sourcehook/test/main.cpp Fri Sep 23 20:14:10 2005 +0000 @@ -1,14 +1,15 @@ // Hello BAIL! // hello pm how are you +// I'm fine, what about you? // This is a test file #include #include #include -#include #include #include #include "sh_tinyhash.h" +#include "sh_list.h" #include "sourcehook_impl.h" using namespace std; @@ -21,7 +22,7 @@ TestProto m_Func; std::string m_Name; - static std::list ms_Tests; + static SourceHook::List ms_Tests; public: Test(TestProto func, const char *name) : m_Func(func), m_Name(name) { @@ -46,7 +47,7 @@ static void DoTests() { int passed=0, failed=0; - for (std::list::iterator iter = ms_Tests.begin(); iter != ms_Tests.end(); ++iter) + for (SourceHook::List::iterator iter = ms_Tests.begin(); iter != ms_Tests.end(); ++iter) { if ((**iter)()) ++passed; @@ -58,40 +59,22 @@ } }; -std::list Test::ms_Tests; +SourceHook::List Test::ms_Tests; #define DO_TEST(x) \ bool Test##x(std::string &error); \ Test g_Test##x(Test##x, #x); +DO_TEST(List); DO_TEST(Basic); DO_TEST(VafmtAndOverload); DO_TEST(ThisPtrOffs); DO_TEST(PlugSys); DO_TEST(Bail); -template <> -int SourceHook::HashFunction(const int & k) -{ - return k; -} - -template <> -int SourceHook::Compare(const int & v1, const int & v2) -{ - if (v1 == v2) - return 0; - if (v1 < v2) - return -1; - if (v1 > v2) - return 1; - return 0; -} - int main(int argc, char *argv[]) { std::string error; - int passed=0, failed=0; g_Verbose = argc > 1 && strcmp(argv[1], "-v") == 0;