Testcase

add some unit-test cases, and fix to build on travis