Fixing compilation and linker errors in tests