encode/decode round trip test