(t *testing.T)
| 770 | } |
| 771 | |
| 772 | func TestMatrixSet(t *testing.T) { |
| 773 | m := IdentityMatrix() |
| 774 | for i := 0; i < 9; i++ { |
| 775 | exp := float32(0) |
| 776 | if i == 0 || i == 4 || i == 8 { |
| 777 | exp = 1 |
| 778 | } |
| 779 | if !FloatEqual(m.Val[i], exp) { |
| 780 | t.Errorf("Identity was not the identity matrix. Index: %v\n Wanted: %v\n Got: %v\n", i, exp, m.Val[i]) |
| 781 | } |
| 782 | } |
| 783 | set := []float32{ |
| 784 | 2, 3, 4, |
| 785 | 3, 4, 5, |
| 786 | 4, 5, 6, |
| 787 | } |
| 788 | m.Set(set) |
| 789 | for i := 0; i < 9; i++ { |
| 790 | if !FloatEqual(set[i], m.Val[i]) { |
| 791 | t.Errorf("Set did not set properly. Index: %v\n Wanted: %v\n Got: %v\n", i, set[i], m.Val[i]) |
| 792 | } |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | func TestMatrixMultiply(t *testing.T) { |
| 797 | data := []struct { |
nothing calls this directly
no test coverage detected