contentenc: simplify testRange tables

Get rid of this eyesore.
This commit is contained in:
Jakob Unterwurzacher 2023-01-24 21:35:32 +01:00
parent 6dc8c26100
commit e9a5b8962b

View File

@ -12,15 +12,15 @@ type testRange struct {
} }
func TestSplitRange(t *testing.T) { func TestSplitRange(t *testing.T) {
var ranges []testRange ranges := []testRange{
{0, 70000},
ranges = append(ranges, testRange{0, 70000}, {0, 10},
testRange{0, 10}, {234, 6511},
testRange{234, 6511}, {65444, 54},
testRange{65444, 54}, {0, 1024 * 1024},
testRange{0, 1024 * 1024}, {0, 65536},
testRange{0, 65536}, {6654, 8945},
testRange{6654, 8945}) }
key := make([]byte, cryptocore.KeyLen) key := make([]byte, cryptocore.KeyLen)
cc := cryptocore.New(key, cryptocore.BackendGoGCM, DefaultIVBits, true) cc := cryptocore.New(key, cryptocore.BackendGoGCM, DefaultIVBits, true)
@ -42,13 +42,13 @@ func TestSplitRange(t *testing.T) {
} }
func TestCiphertextRange(t *testing.T) { func TestCiphertextRange(t *testing.T) {
var ranges []testRange ranges := []testRange{
{0, 70000},
ranges = append(ranges, testRange{0, 70000}, {0, 10},
testRange{0, 10}, {234, 6511},
testRange{234, 6511}, {65444, 54},
testRange{65444, 54}, {6654, 8945},
testRange{6654, 8945}) }
key := make([]byte, cryptocore.KeyLen) key := make([]byte, cryptocore.KeyLen)
cc := cryptocore.New(key, cryptocore.BackendGoGCM, DefaultIVBits, true) cc := cryptocore.New(key, cryptocore.BackendGoGCM, DefaultIVBits, true)