Add encodecapi test

Signed-off-by: Tang Xin <xin.t.tang@intel.com>
please check all return value or add assert.