diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2017-04-27 20:31:00 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@google.com> | 2017-05-12 15:47:59 +0200 |
| commit | ac0c70f74a5badbebec721c2be0602ea98c0437b (patch) | |
| tree | 69278d03cdaae547c1c87a84deb44969081837bd /executor/test_test.go | |
| parent | b2dbb4f4d10f436088ba8a1d2d18437911a83887 (diff) | |
prog, executor: move checksum computation to executor
This commit moves checksum computation to executor. This will allow to embed
dynamically generated values (like TCP sequence numbers) into packets.
Diffstat (limited to 'executor/test_test.go')
| -rw-r--r-- | executor/test_test.go | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/executor/test_test.go b/executor/test_test.go index f197dbf51..368454ac3 100644 --- a/executor/test_test.go +++ b/executor/test_test.go @@ -5,8 +5,8 @@ package executor import "testing" -func TestCopyin(t *testing.T) { - switch res := testCopyin(); { +func testWrapper(t *testing.T, f func() int) { + switch res := f(); { case res < 0: t.Skip() case res > 0: @@ -15,12 +15,18 @@ func TestCopyin(t *testing.T) { } } +func TestCopyin(t *testing.T) { + testWrapper(t, testCopyin) +} + +func TestCsumInet(t *testing.T) { + testWrapper(t, testCsumInet) +} + +func TestCsumInetAcc(t *testing.T) { + testWrapper(t, testCsumInetAcc) +} + func TestKVM(t *testing.T) { - switch res := testKVM(); { - case res < 0: - t.Skip() - case res > 0: - t.Fail() - default: - } + testWrapper(t, testKVM) } |
