diff --git a/src/twtest/genreswitcher_t.cpp b/src/twtest/genreswitcher_t.cpp index ae43142..8a01e5c 100644 --- a/src/twtest/genreswitcher_t.cpp +++ b/src/twtest/genreswitcher_t.cpp @@ -57,7 +57,12 @@ void TestGenreSwitcher() genreSwitcher->SelectGenre(cFS::GenreID()); TEST(genreSwitcher->CurrentGenre() == cFS::GenreID()); + +#ifndef HAVE_IBM_GXLC + // this fails on IBM XLC; the type_info::name() for the factory instance arg + // returns a blank string. TEST(typeid(*iTWFactory::GetInstance()) == typeid(cFSFactory)); +#endif d.TraceDebug("All tests passed.\n"); } diff --git a/src/twtest/unixfsservices_t.cpp b/src/twtest/unixfsservices_t.cpp index a572c12..69754a6 100644 --- a/src/twtest/unixfsservices_t.cpp +++ b/src/twtest/unixfsservices_t.cpp @@ -206,6 +206,24 @@ void TestFileDelete() TEST(iFSServices::GetInstance()->FileDelete(to_rm)); } +// This looks silly, but we've run into situations where basic exception handling fails due to +// fun linker issues, so here's a test to verify that we were built correctly. +void TestCatch() +{ + bool threw = false; + try + { + throw eFSServices("a thing happened"); + } + catch (const eFSServices& e) + { + threw = true; + } + + TEST(threw); +} + + void RegisterSuite_UnixFSServices() { RegisterTest("UnixFSServices", "ReadDir", TestReadDir); @@ -219,4 +237,5 @@ void RegisterSuite_UnixFSServices() RegisterTest("UnixFSServices", "GetExecutableFilename", TestGetExecutableFilename); RegisterTest("UnixFSServices", "Rename", TestRename); RegisterTest("UnixFSServices", "FileDelete", TestFileDelete); + RegisterTest("UnixFSServices", "TestCatch", TestCatch); }