add testcase
add testcase & remove unused code
Merge pull request #372 from wenshao/master

add testcase & remove unused code