(t *testing.T)
| 829 | } |
| 830 | |
| 831 | func TestReadComplex64(t *testing.T) { |
| 832 | var buf bytes.Buffer |
| 833 | wr := NewWriter(&buf) |
| 834 | rd := NewReader(&buf) |
| 835 | |
| 836 | for range 100 { |
| 837 | buf.Reset() |
| 838 | f := complex(rand.Float32()*math.MaxFloat32, rand.Float32()*math.MaxFloat32) |
| 839 | |
| 840 | wr.WriteComplex64(f) |
| 841 | err := wr.Flush() |
| 842 | if err != nil { |
| 843 | t.Fatal(err) |
| 844 | } |
| 845 | |
| 846 | out, err := rd.ReadComplex64() |
| 847 | if err != nil { |
| 848 | t.Error(err) |
| 849 | continue |
| 850 | } |
| 851 | |
| 852 | if out != f { |
| 853 | t.Errorf("Wrote %f; read %f", f, out) |
| 854 | } |
| 855 | |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | func BenchmarkReadComplex64(b *testing.B) { |
| 860 | f := complex(rand.Float32(), rand.Float32()) |
nothing calls this directly
no test coverage detected
searching dependent graphs…