(b *testing.B)
| 98 | } |
| 99 | |
| 100 | func (ent *Ent) Update(b *testing.B) { |
| 101 | m := NewModelAlt() |
| 102 | |
| 103 | created, err := ent.conn.Model.Create(). |
| 104 | SetName(m.Name). |
| 105 | SetTitle(m.Title). |
| 106 | SetFax(m.Fax). |
| 107 | SetWeb(m.Web). |
| 108 | SetAge(m.Age). |
| 109 | SetRight(m.Right). |
| 110 | SetCounter(m.Counter). |
| 111 | Save(ctx) |
| 112 | if err != nil { |
| 113 | helper.SetError(b, ent.Name(), "Update", err.Error()) |
| 114 | } |
| 115 | m.Id = created.ID |
| 116 | |
| 117 | b.ReportAllocs() |
| 118 | b.ResetTimer() |
| 119 | |
| 120 | for i := 0; i < b.N; i++ { |
| 121 | _, err := ent.conn.Model.Update(). |
| 122 | Where(model.IDEQ(m.Id)). |
| 123 | SetName(m.Name). |
| 124 | SetTitle(m.Title). |
| 125 | SetFax(m.Fax). |
| 126 | SetWeb(m.Web). |
| 127 | SetAge(m.Age). |
| 128 | SetRight(m.Right). |
| 129 | SetCounter(m.Counter). |
| 130 | Save(ctx) |
| 131 | if err != nil { |
| 132 | helper.SetError(b, ent.Name(), "Update", err.Error()) |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | func (ent *Ent) Read(b *testing.B) { |
| 138 | m := NewModelAlt() |
nothing calls this directly
no test coverage detected