(t *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestWriteSimpleJSONProtocolByte(t *testing.T) { |
| 85 | thetype := "byte" |
| 86 | trans := NewTMemoryBuffer() |
| 87 | p := NewTSimpleJSONProtocol(trans) |
| 88 | for _, value := range BYTE_VALUES { |
| 89 | if e := p.WriteByte(context.Background(), value); e != nil { |
| 90 | t.Fatalf("Unable to write %s value %v due to error: %s", thetype, value, e.Error()) |
| 91 | } |
| 92 | if e := p.Flush(context.Background()); e != nil { |
| 93 | t.Fatalf("Unable to write %s value %v due to error flushing: %s", thetype, value, e.Error()) |
| 94 | } |
| 95 | s := trans.String() |
| 96 | if s != fmt.Sprint(value) { |
| 97 | t.Fatalf("Bad value for %s %v: %s", thetype, value, s) |
| 98 | } |
| 99 | v := int8(0) |
| 100 | if err := json.Unmarshal([]byte(s), &v); err != nil || v != value { |
| 101 | t.Fatalf("Bad json-decoded value for %s %v, wrote: '%s', expected: '%v'", thetype, value, s, v) |
| 102 | } |
| 103 | trans.Reset() |
| 104 | } |
| 105 | trans.Close() |
| 106 | } |
| 107 | |
| 108 | func TestReadSimpleJSONProtocolByte(t *testing.T) { |
| 109 | thetype := "byte" |
nothing calls this directly
no test coverage detected