the test for encode decode