(t *testing.T)
| 379 | } |
| 380 | |
| 381 | func TestBuffer_bytes(t *testing.T) { |
| 382 | var wants = [][]byte{ |
| 383 | {1, 3, 4, 5, 6, 100, 250}, |
| 384 | []byte("hello world"), |
| 385 | } |
| 386 | var got []byte |
| 387 | for _, want := range wants { |
| 388 | buf := NewBuffer() |
| 389 | err := buf.WriteBytes(want) |
| 390 | if err != nil { |
| 391 | t.Errorf("Test Write_bytes failed. err:%s\n", err) |
| 392 | } |
| 393 | |
| 394 | reader := r(buf) |
| 395 | err = reader.ReadBytes(&got, int32(len(want)), true) |
| 396 | if err != nil { |
| 397 | t.Errorf("Test Read_bytes failed. err:%s\n", err) |
| 398 | } |
| 399 | |
| 400 | if !reflect.DeepEqual(want, got) { |
| 401 | t.Errorf("Test Write_bytes failed. want:%v, got:%v\n", want, got) |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | func TestBuffer_bool(t *testing.T) { |
| 407 | var got bool |
nothing calls this directly
no test coverage detected