add tests and changes in platform-mac