Tests: fix linking order