add unit tests and test by clang