[Backport Unit Tests] Fix platform unit tests in core.