adapter: add some test and fix bug