(t *testing.T)
| 15 | } |
| 16 | |
| 17 | func TestDecodeWithCommonError(t *testing.T) { |
| 18 | err := DecodeWithCommonError([]byte(errData), "Send") |
| 19 | if err == nil { |
| 20 | t.Error("DecodeWithCommonError should return error") |
| 21 | return |
| 22 | } |
| 23 | |
| 24 | cErr, ok := err.(*CommonError) |
| 25 | if !ok { |
| 26 | t.Errorf("DecodeWithCommonError should return *CommonError but %T", err) |
| 27 | return |
| 28 | } |
| 29 | if !(cErr.ErrCode == 43101 && cErr.ErrMsg == "user refuse to accept the msg" && cErr.Error() == expectError) { |
| 30 | t.Error("DecodeWithCommonError return bad *CommonError") |
| 31 | return |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func TestDecodeWithError(t *testing.T) { |
| 36 | type DE struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…