(t *testing.T)
| 1250 | } |
| 1251 | |
| 1252 | func TestCollectionStats(t *testing.T) { |
| 1253 | cs0 := &CollectionStats{} |
| 1254 | cs1 := &CollectionStats{} |
| 1255 | cs0.AtomicCopyTo(cs1) |
| 1256 | if !reflect.DeepEqual(cs0, cs1) { |
| 1257 | t.Errorf("expect empty compare to equal") |
| 1258 | } |
| 1259 | cs0.TotOnError = 1234 |
| 1260 | cs0.AtomicCopyTo(cs1) |
| 1261 | if !reflect.DeepEqual(cs0, cs1) { |
| 1262 | t.Errorf("expect empty compare to equal") |
| 1263 | } |
| 1264 | |
| 1265 | m, _ := NewCollection(CollectionOptions{}) |
| 1266 | m.Start() |
| 1267 | m.Close() |
| 1268 | |
| 1269 | s, err := m.Stats() |
| 1270 | if err != nil || s == nil { |
| 1271 | t.Errorf("expect some stats") |
| 1272 | } |
| 1273 | |
| 1274 | if reflect.DeepEqual(s, &CollectionStats{}) { |
| 1275 | t.Errorf("expect nonzero stats") |
| 1276 | } |
| 1277 | |
| 1278 | if s.TotCloseBeg != 1 || s.TotCloseEnd != 1 { |
| 1279 | t.Errorf("expect close stat == 1") |
| 1280 | } |
| 1281 | } |
| 1282 | |
| 1283 | func TestCollectionStatsClose(t *testing.T) { |
| 1284 | m, _ := NewCollection(CollectionOptions{}) |
nothing calls this directly
no test coverage detected
searching dependent graphs…