diff options
Diffstat (limited to 'libgo/go/container')
-rw-r--r-- | libgo/go/container/vector/intvector_test.go | 48 | ||||
-rw-r--r-- | libgo/go/container/vector/numbers_test.go | 8 | ||||
-rw-r--r-- | libgo/go/container/vector/stringvector_test.go | 48 | ||||
-rw-r--r-- | libgo/go/container/vector/vector_test.go | 48 |
4 files changed, 76 insertions, 76 deletions
diff --git a/libgo/go/container/vector/intvector_test.go b/libgo/go/container/vector/intvector_test.go index fcc7403b36d..1e38a1982f6 100644 --- a/libgo/go/container/vector/intvector_test.go +++ b/libgo/go/container/vector/intvector_test.go @@ -127,59 +127,59 @@ func TestIntInsertDeleteClear(t *testing.T) { for i := 0; i < n; i++ { if a.Len() != i { - t.Errorf("T%: A) wrong Len() %d (expected %d)", a, a.Len(), i) + t.Errorf("%T: A) wrong Len() %d (expected %d)", a, a.Len(), i) } if len(a) != i { - t.Errorf("T%: A) wrong len() %d (expected %d)", a, len(a), i) + t.Errorf("%T: A) wrong len() %d (expected %d)", a, len(a), i) } a.Insert(0, int2IntValue(val(i))) if elem2IntValue(a.Last()) != int2IntValue(val(0)) { - t.Error("T%: B", a) + t.Errorf("%T: B", a) } } for i := n - 1; i >= 0; i-- { if elem2IntValue(a.Last()) != int2IntValue(val(0)) { - t.Error("T%: C", a) + t.Errorf("%T: C", a) } if elem2IntValue(a.At(0)) != int2IntValue(val(i)) { - t.Error("T%: D", a) + t.Errorf("%T: D", a) } if elem2IntValue(a[0]) != int2IntValue(val(i)) { - t.Error("T%: D2", a) + t.Errorf("%T: D2", a) } a.Delete(0) if a.Len() != i { - t.Errorf("T%: E) wrong Len() %d (expected %d)", a, a.Len(), i) + t.Errorf("%T: E) wrong Len() %d (expected %d)", a, a.Len(), i) } if len(a) != i { - t.Errorf("T%: E) wrong len() %d (expected %d)", a, len(a), i) + t.Errorf("%T: E) wrong len() %d (expected %d)", a, len(a), i) } } if a.Len() != 0 { - t.Errorf("T%: F) wrong Len() %d (expected 0)", a, a.Len()) + t.Errorf("%T: F) wrong Len() %d (expected 0)", a, a.Len()) } if len(a) != 0 { - t.Errorf("T%: F) wrong len() %d (expected 0)", a, len(a)) + t.Errorf("%T: F) wrong len() %d (expected 0)", a, len(a)) } for i := 0; i < n; i++ { a.Push(int2IntValue(val(i))) if a.Len() != i+1 { - t.Errorf("T%: G) wrong Len() %d (expected %d)", a, a.Len(), i+1) + t.Errorf("%T: G) wrong Len() %d (expected %d)", a, a.Len(), i+1) } if len(a) != i+1 { - t.Errorf("T%: G) wrong len() %d (expected %d)", a, len(a), i+1) + t.Errorf("%T: G) wrong len() %d (expected %d)", a, len(a), i+1) } if elem2IntValue(a.Last()) != int2IntValue(val(i)) { - t.Error("T%: H", a) + t.Errorf("%T: H", a) } } a.Resize(0, 0) if a.Len() != 0 { - t.Errorf("T%: I wrong Len() %d (expected 0)", a, a.Len()) + t.Errorf("%T: I wrong Len() %d (expected 0)", a, a.Len()) } if len(a) != 0 { - t.Errorf("T%: I wrong len() %d (expected 0)", a, len(a)) + t.Errorf("%T: I wrong len() %d (expected 0)", a, len(a)) } const m = 5 @@ -189,21 +189,21 @@ func TestIntInsertDeleteClear(t *testing.T) { x := val(i) a.Push(int2IntValue(x)) if elem2IntValue(a.Pop()) != int2IntValue(x) { - t.Error("T%: J", a) + t.Errorf("%T: J", a) } if a.Len() != j+1 { - t.Errorf("T%: K) wrong Len() %d (expected %d)", a, a.Len(), j+1) + t.Errorf("%T: K) wrong Len() %d (expected %d)", a, a.Len(), j+1) } if len(a) != j+1 { - t.Errorf("T%: K) wrong len() %d (expected %d)", a, len(a), j+1) + t.Errorf("%T: K) wrong len() %d (expected %d)", a, len(a), j+1) } } } if a.Len() != m { - t.Errorf("T%: L) wrong Len() %d (expected %d)", a, a.Len(), m) + t.Errorf("%T: L) wrong Len() %d (expected %d)", a, a.Len(), m) } if len(a) != m { - t.Errorf("T%: L) wrong len() %d (expected %d)", a, len(a), m) + t.Errorf("%T: L) wrong len() %d (expected %d)", a, len(a), m) } } @@ -211,14 +211,14 @@ func TestIntInsertDeleteClear(t *testing.T) { func verify_sliceInt(t *testing.T, x *IntVector, elt, i, j int) { for k := i; k < j; k++ { if elem2IntValue(x.At(k)) != int2IntValue(elt) { - t.Errorf("T%: M) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt)) + t.Errorf("%T: M) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt)) } } s := x.Slice(i, j) for k, n := 0, j-i; k < n; k++ { if elem2IntValue(s.At(k)) != int2IntValue(elt) { - t.Errorf("T%: N) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt)) + t.Errorf("%T: N) wrong [%d] element %v (expected %v)", x, k, elem2IntValue(x.At(k)), int2IntValue(elt)) } } } @@ -227,10 +227,10 @@ func verify_sliceInt(t *testing.T, x *IntVector, elt, i, j int) { func verify_patternInt(t *testing.T, x *IntVector, a, b, c int) { n := a + b + c if x.Len() != n { - t.Errorf("T%: O) wrong Len() %d (expected %d)", x, x.Len(), n) + t.Errorf("%T: O) wrong Len() %d (expected %d)", x, x.Len(), n) } if len(*x) != n { - t.Errorf("T%: O) wrong len() %d (expected %d)", x, len(*x), n) + t.Errorf("%T: O) wrong len() %d (expected %d)", x, len(*x), n) } verify_sliceInt(t, x, 0, 0, a) verify_sliceInt(t, x, 1, a, a+b) diff --git a/libgo/go/container/vector/numbers_test.go b/libgo/go/container/vector/numbers_test.go index a44242f67b6..d540ace0502 100644 --- a/libgo/go/container/vector/numbers_test.go +++ b/libgo/go/container/vector/numbers_test.go @@ -20,7 +20,7 @@ func s(n uint64) string { lens := len(str) a := make([]string, (lens+2)/3) start := lens - for i, _ := range a { + for i := range a { start -= 3 if start < 0 { start = 0 @@ -46,7 +46,7 @@ func TestVectorNums(t *testing.T) { v.Resize(0, 0) runtime.GC() n := m.Alloc - m0.Alloc - t.Logf("%T.Push(%#v), n = %s: Alloc/n = %.2f\n", v, c, s(memTestN), float(n)/memTestN) + t.Logf("%T.Push(%#v), n = %s: Alloc/n = %.2f\n", v, c, s(memTestN), float64(n)/memTestN) } @@ -64,7 +64,7 @@ func TestIntVectorNums(t *testing.T) { v.Resize(0, 0) runtime.GC() n := m.Alloc - m0.Alloc - t.Logf("%T.Push(%#v), n = %s: Alloc/n = %.2f\n", v, c, s(memTestN), float(n)/memTestN) + t.Logf("%T.Push(%#v), n = %s: Alloc/n = %.2f\n", v, c, s(memTestN), float64(n)/memTestN) } @@ -82,7 +82,7 @@ func TestStringVectorNums(t *testing.T) { v.Resize(0, 0) runtime.GC() n := m.Alloc - m0.Alloc - t.Logf("%T.Push(%#v), n = %s: Alloc/n = %.2f\n", v, c, s(memTestN), float(n)/memTestN) + t.Logf("%T.Push(%#v), n = %s: Alloc/n = %.2f\n", v, c, s(memTestN), float64(n)/memTestN) } diff --git a/libgo/go/container/vector/stringvector_test.go b/libgo/go/container/vector/stringvector_test.go index 2f3f082bdc4..776ae26dea1 100644 --- a/libgo/go/container/vector/stringvector_test.go +++ b/libgo/go/container/vector/stringvector_test.go @@ -127,59 +127,59 @@ func TestStrInsertDeleteClear(t *testing.T) { for i := 0; i < n; i++ { if a.Len() != i { - t.Errorf("T%: A) wrong Len() %d (expected %d)", a, a.Len(), i) + t.Errorf("%T: A) wrong Len() %d (expected %d)", a, a.Len(), i) } if len(a) != i { - t.Errorf("T%: A) wrong len() %d (expected %d)", a, len(a), i) + t.Errorf("%T: A) wrong len() %d (expected %d)", a, len(a), i) } a.Insert(0, int2StrValue(val(i))) if elem2StrValue(a.Last()) != int2StrValue(val(0)) { - t.Error("T%: B", a) + t.Errorf("%T: B", a) } } for i := n - 1; i >= 0; i-- { if elem2StrValue(a.Last()) != int2StrValue(val(0)) { - t.Error("T%: C", a) + t.Errorf("%T: C", a) } if elem2StrValue(a.At(0)) != int2StrValue(val(i)) { - t.Error("T%: D", a) + t.Errorf("%T: D", a) } if elem2StrValue(a[0]) != int2StrValue(val(i)) { - t.Error("T%: D2", a) + t.Errorf("%T: D2", a) } a.Delete(0) if a.Len() != i { - t.Errorf("T%: E) wrong Len() %d (expected %d)", a, a.Len(), i) + t.Errorf("%T: E) wrong Len() %d (expected %d)", a, a.Len(), i) } if len(a) != i { - t.Errorf("T%: E) wrong len() %d (expected %d)", a, len(a), i) + t.Errorf("%T: E) wrong len() %d (expected %d)", a, len(a), i) } } if a.Len() != 0 { - t.Errorf("T%: F) wrong Len() %d (expected 0)", a, a.Len()) + t.Errorf("%T: F) wrong Len() %d (expected 0)", a, a.Len()) } if len(a) != 0 { - t.Errorf("T%: F) wrong len() %d (expected 0)", a, len(a)) + t.Errorf("%T: F) wrong len() %d (expected 0)", a, len(a)) } for i := 0; i < n; i++ { a.Push(int2StrValue(val(i))) if a.Len() != i+1 { - t.Errorf("T%: G) wrong Len() %d (expected %d)", a, a.Len(), i+1) + t.Errorf("%T: G) wrong Len() %d (expected %d)", a, a.Len(), i+1) } if len(a) != i+1 { - t.Errorf("T%: G) wrong len() %d (expected %d)", a, len(a), i+1) + t.Errorf("%T: G) wrong len() %d (expected %d)", a, len(a), i+1) } if elem2StrValue(a.Last()) != int2StrValue(val(i)) { - t.Error("T%: H", a) + t.Errorf("%T: H", a) } } a.Resize(0, 0) if a.Len() != 0 { - t.Errorf("T%: I wrong Len() %d (expected 0)", a, a.Len()) + t.Errorf("%T: I wrong Len() %d (expected 0)", a, a.Len()) } if len(a) != 0 { - t.Errorf("T%: I wrong len() %d (expected 0)", a, len(a)) + t.Errorf("%T: I wrong len() %d (expected 0)", a, len(a)) } const m = 5 @@ -189,21 +189,21 @@ func TestStrInsertDeleteClear(t *testing.T) { x := val(i) a.Push(int2StrValue(x)) if elem2StrValue(a.Pop()) != int2StrValue(x) { - t.Error("T%: J", a) + t.Errorf("%T: J", a) } if a.Len() != j+1 { - t.Errorf("T%: K) wrong Len() %d (expected %d)", a, a.Len(), j+1) + t.Errorf("%T: K) wrong Len() %d (expected %d)", a, a.Len(), j+1) } if len(a) != j+1 { - t.Errorf("T%: K) wrong len() %d (expected %d)", a, len(a), j+1) + t.Errorf("%T: K) wrong len() %d (expected %d)", a, len(a), j+1) } } } if a.Len() != m { - t.Errorf("T%: L) wrong Len() %d (expected %d)", a, a.Len(), m) + t.Errorf("%T: L) wrong Len() %d (expected %d)", a, a.Len(), m) } if len(a) != m { - t.Errorf("T%: L) wrong len() %d (expected %d)", a, len(a), m) + t.Errorf("%T: L) wrong len() %d (expected %d)", a, len(a), m) } } @@ -211,14 +211,14 @@ func TestStrInsertDeleteClear(t *testing.T) { func verify_sliceStr(t *testing.T, x *StringVector, elt, i, j int) { for k := i; k < j; k++ { if elem2StrValue(x.At(k)) != int2StrValue(elt) { - t.Errorf("T%: M) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt)) + t.Errorf("%T: M) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt)) } } s := x.Slice(i, j) for k, n := 0, j-i; k < n; k++ { if elem2StrValue(s.At(k)) != int2StrValue(elt) { - t.Errorf("T%: N) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt)) + t.Errorf("%T: N) wrong [%d] element %v (expected %v)", x, k, elem2StrValue(x.At(k)), int2StrValue(elt)) } } } @@ -227,10 +227,10 @@ func verify_sliceStr(t *testing.T, x *StringVector, elt, i, j int) { func verify_patternStr(t *testing.T, x *StringVector, a, b, c int) { n := a + b + c if x.Len() != n { - t.Errorf("T%: O) wrong Len() %d (expected %d)", x, x.Len(), n) + t.Errorf("%T: O) wrong Len() %d (expected %d)", x, x.Len(), n) } if len(*x) != n { - t.Errorf("T%: O) wrong len() %d (expected %d)", x, len(*x), n) + t.Errorf("%T: O) wrong len() %d (expected %d)", x, len(*x), n) } verify_sliceStr(t, x, 0, 0, a) verify_sliceStr(t, x, 1, a, a+b) diff --git a/libgo/go/container/vector/vector_test.go b/libgo/go/container/vector/vector_test.go index 986dff2da77..a9c4ceb55ac 100644 --- a/libgo/go/container/vector/vector_test.go +++ b/libgo/go/container/vector/vector_test.go @@ -127,59 +127,59 @@ func TestInsertDeleteClear(t *testing.T) { for i := 0; i < n; i++ { if a.Len() != i { - t.Errorf("T%: A) wrong Len() %d (expected %d)", a, a.Len(), i) + t.Errorf("%T: A) wrong Len() %d (expected %d)", a, a.Len(), i) } if len(a) != i { - t.Errorf("T%: A) wrong len() %d (expected %d)", a, len(a), i) + t.Errorf("%T: A) wrong len() %d (expected %d)", a, len(a), i) } a.Insert(0, int2Value(val(i))) if elem2Value(a.Last()) != int2Value(val(0)) { - t.Error("T%: B", a) + t.Errorf("%T: B", a) } } for i := n - 1; i >= 0; i-- { if elem2Value(a.Last()) != int2Value(val(0)) { - t.Error("T%: C", a) + t.Errorf("%T: C", a) } if elem2Value(a.At(0)) != int2Value(val(i)) { - t.Error("T%: D", a) + t.Errorf("%T: D", a) } if elem2Value(a[0]) != int2Value(val(i)) { - t.Error("T%: D2", a) + t.Errorf("%T: D2", a) } a.Delete(0) if a.Len() != i { - t.Errorf("T%: E) wrong Len() %d (expected %d)", a, a.Len(), i) + t.Errorf("%T: E) wrong Len() %d (expected %d)", a, a.Len(), i) } if len(a) != i { - t.Errorf("T%: E) wrong len() %d (expected %d)", a, len(a), i) + t.Errorf("%T: E) wrong len() %d (expected %d)", a, len(a), i) } } if a.Len() != 0 { - t.Errorf("T%: F) wrong Len() %d (expected 0)", a, a.Len()) + t.Errorf("%T: F) wrong Len() %d (expected 0)", a, a.Len()) } if len(a) != 0 { - t.Errorf("T%: F) wrong len() %d (expected 0)", a, len(a)) + t.Errorf("%T: F) wrong len() %d (expected 0)", a, len(a)) } for i := 0; i < n; i++ { a.Push(int2Value(val(i))) if a.Len() != i+1 { - t.Errorf("T%: G) wrong Len() %d (expected %d)", a, a.Len(), i+1) + t.Errorf("%T: G) wrong Len() %d (expected %d)", a, a.Len(), i+1) } if len(a) != i+1 { - t.Errorf("T%: G) wrong len() %d (expected %d)", a, len(a), i+1) + t.Errorf("%T: G) wrong len() %d (expected %d)", a, len(a), i+1) } if elem2Value(a.Last()) != int2Value(val(i)) { - t.Error("T%: H", a) + t.Errorf("%T: H", a) } } a.Resize(0, 0) if a.Len() != 0 { - t.Errorf("T%: I wrong Len() %d (expected 0)", a, a.Len()) + t.Errorf("%T: I wrong Len() %d (expected 0)", a, a.Len()) } if len(a) != 0 { - t.Errorf("T%: I wrong len() %d (expected 0)", a, len(a)) + t.Errorf("%T: I wrong len() %d (expected 0)", a, len(a)) } const m = 5 @@ -189,21 +189,21 @@ func TestInsertDeleteClear(t *testing.T) { x := val(i) a.Push(int2Value(x)) if elem2Value(a.Pop()) != int2Value(x) { - t.Error("T%: J", a) + t.Errorf("%T: J", a) } if a.Len() != j+1 { - t.Errorf("T%: K) wrong Len() %d (expected %d)", a, a.Len(), j+1) + t.Errorf("%T: K) wrong Len() %d (expected %d)", a, a.Len(), j+1) } if len(a) != j+1 { - t.Errorf("T%: K) wrong len() %d (expected %d)", a, len(a), j+1) + t.Errorf("%T: K) wrong len() %d (expected %d)", a, len(a), j+1) } } } if a.Len() != m { - t.Errorf("T%: L) wrong Len() %d (expected %d)", a, a.Len(), m) + t.Errorf("%T: L) wrong Len() %d (expected %d)", a, a.Len(), m) } if len(a) != m { - t.Errorf("T%: L) wrong len() %d (expected %d)", a, len(a), m) + t.Errorf("%T: L) wrong len() %d (expected %d)", a, len(a), m) } } @@ -211,14 +211,14 @@ func TestInsertDeleteClear(t *testing.T) { func verify_slice(t *testing.T, x *Vector, elt, i, j int) { for k := i; k < j; k++ { if elem2Value(x.At(k)) != int2Value(elt) { - t.Errorf("T%: M) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt)) + t.Errorf("%T: M) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt)) } } s := x.Slice(i, j) for k, n := 0, j-i; k < n; k++ { if elem2Value(s.At(k)) != int2Value(elt) { - t.Errorf("T%: N) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt)) + t.Errorf("%T: N) wrong [%d] element %v (expected %v)", x, k, elem2Value(x.At(k)), int2Value(elt)) } } } @@ -227,10 +227,10 @@ func verify_slice(t *testing.T, x *Vector, elt, i, j int) { func verify_pattern(t *testing.T, x *Vector, a, b, c int) { n := a + b + c if x.Len() != n { - t.Errorf("T%: O) wrong Len() %d (expected %d)", x, x.Len(), n) + t.Errorf("%T: O) wrong Len() %d (expected %d)", x, x.Len(), n) } if len(*x) != n { - t.Errorf("T%: O) wrong len() %d (expected %d)", x, len(*x), n) + t.Errorf("%T: O) wrong len() %d (expected %d)", x, len(*x), n) } verify_slice(t, x, 0, 0, a) verify_slice(t, x, 1, a, a+b) |