MCPcopy Create free account
hub / github.com/encodeous/nylon / TestBatchSize

Function TestBatchSize

polyamide/device/device_test.go:450–476  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

448func (t *fakeTUNDeviceSized) BatchSize() int { return t.size }
449
450func TestBatchSize(t *testing.T) {
451 d := Device{}
452
453 d.net.bind = &fakeBindSized{1}
454 d.tun.device = &fakeTUNDeviceSized{1}
455 if want, got := 1, d.BatchSize(); got != want {
456 t.Errorf("expected batch size %d, got %d", want, got)
457 }
458
459 d.net.bind = &fakeBindSized{1}
460 d.tun.device = &fakeTUNDeviceSized{128}
461 if want, got := 128, d.BatchSize(); got != want {
462 t.Errorf("expected batch size %d, got %d", want, got)
463 }
464
465 d.net.bind = &fakeBindSized{128}
466 d.tun.device = &fakeTUNDeviceSized{1}
467 if want, got := 128, d.BatchSize(); got != want {
468 t.Errorf("expected batch size %d, got %d", want, got)
469 }
470
471 d.net.bind = &fakeBindSized{128}
472 d.tun.device = &fakeTUNDeviceSized{128}
473 if want, got := 128, d.BatchSize(); got != want {
474 t.Errorf("expected batch size %d, got %d", want, got)
475 }
476}

Callers

nothing calls this directly

Calls 1

BatchSizeMethod · 0.95

Tested by

no test coverage detected