openrw icon indicating copy to clipboard operation
openrw copied to clipboard

test_Globals should be converted into two separate fixtures

Open ghost opened this issue 7 years ago • 2 comments

Actual approach - makro - doesn't fulfill to well its task. Also two fixtures should be more flexible tool.

ghost avatar Nov 04 '18 19:11 ghost

Can you give more specifics about this issue? Do you mean #355 ? I have refactored test_Globals in my proposed branch in that issue.

madebr avatar Nov 14 '18 13:11 madebr

Partially, it fixes mess caused by makro, but there's is still that connected with constructing world.

Problem: There's is a lot lines of code like: https://github.com/rwengine/openrw/blob/a0b97a4027d9832042539569ac63b66bfec87d2e/tests/test_GameWorld.cpp#L22

You need to build world on your self, know structure of it, remember to cleanup. It adds many unneeded lines of code. Prevent fixing leaks (without using shared_ptrs).

Fixing that can be done, by preparing two separate fixtures (with data and without) which are able to construct as simple as possible, but working world(s).

ghost avatar Nov 14 '18 20:11 ghost