Fix linker errors in unit tests.
(cherry picked from commit 7a85c9a0b6e825a164e5b5c9921bc869e95759f4)