Simulator's loading of resources
hmwildermuth opened this issue · 3 comments
hmwildermuth commented
==9371== Command: ./tests.o
==9371==
==9371== Invalid read of size 4
==9371== at 0x507CBB4: sf::priv::GlxContext::GlxContext(sf::priv::GlxContext*) (in /usr/lib/libsfml-window.so.2.1)
==9371== by 0x5076B9C: sf::priv::GlContext::globalInit() (in /usr/lib/libsfml-window.so.2.1)
==9371== by 0x5077482: sf::GlResource::GlResource() (in /usr/lib/libsfml-window.so.2.1)
==9371== by 0x5079A55: sf::Window::Window() (in /usr/lib/libsfml-window.so.2.1)
==9371== by 0x4E5C3C5: sf::RenderWindow::RenderWindow() (in /usr/lib/libsfml-graphics.so.2.1)
==9371== by 0x467A30: Simlink::Simlink() (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371== by 0x45A872: ____C_A_T_C_H____T_E_S_T____8() (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371== by 0x4271CD: Catch::FreeFunctionTestCase::invoke() const (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371== by 0x4132F6: Catch::TestCase::invoke() const (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371== by 0x4261DA: Catch::RunContext::invokeActiveTestCase() (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371== by 0x425E69: Catch::RunContext::runCurrentTest(std::string&, std::string&) (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371== by 0x424810: Catch::RunContext::runTest(Catch::TestCase const&) (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371== Address 0xe0 is not stack'd, malloc'd or (recently) free'd
==9371==
truell20 commented
@FlyingGraysons This is because I currently load the background and sansation font files using absolute paths. These will only work on my system. The reason it is like that right now is SFML loads files based on current working directory (the directory of the executable) and so the relative path to background.png varies between the running of tests and the running of the library (since their executables are stored in two different dirs).
The problem is documented here: http://en.sfml-dev.org/forums/index.php?topic=7701.0.
hmwildermuth commented
well no matter what the script cd
's into the tests/
directory so put the path from there