Mercurial > fife-parpg
diff tests/core_tests/test_imagepool.cpp @ 85:35f6cfea565e
Fixed the unit tests so they will now compile and link with msvc2005. There are still a couple more changes needed to run them correctly.
author | vtchill@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 19 Jul 2008 04:56:28 +0000 |
parents | 90005975cdbb |
children | 72c25cc27d8b |
line wrap: on
line diff
--- a/tests/core_tests/test_imagepool.cpp Fri Jul 18 21:07:03 2008 +0000 +++ b/tests/core_tests/test_imagepool.cpp Sat Jul 19 04:56:28 2008 +0000 @@ -61,23 +61,21 @@ boost::shared_ptr<VFS> vfs; environment() - : timemanager(new TimeManager()) { + : timemanager(new TimeManager()), vfs(new VFS()) { if (SDL_Init(SDL_INIT_NOPARACHUTE | SDL_INIT_TIMER) < 0) { throw SDLException(SDL_GetError()); } } }; -TEST(test_image_pool) +TEST_FIXTURE(environment, test_image_pool) { - environment env; RenderBackendSDL renderbackend; - boost::scoped_ptr<VFS> vfs(new VFS()); vfs->addSource(new VFSDirectory(vfs.get())); renderbackend.init(); - renderbackend.createMainScreen(800, 600, 0, false); + renderbackend.createMainScreen(800, 600, 0, false, "FIFE", ""); ImagePool pool; pool.addResourceLoader(new SubImageLoader()); pool.addResourceLoader(new ImageLoader(vfs.get())); @@ -132,6 +130,15 @@ CHECK_EQUAL(0, pool.getResourceCount(RES_NON_LOADED)); } -int main() { +// need this here because SDL redefines +// main to SDL_main in SDL_main.h +#ifdef main +#undef main +#endif + +int main() +{ return UnitTest::RunAllTests(); } + +