fixed expected results for segcalc test

This commit is contained in:
David Vennik
2022-12-10 10:42:15 +01:00
parent 545482e950
commit efe7f472ca
2 changed files with 20 additions and 20 deletions

View File

@@ -8,31 +8,31 @@ import (
var Expected = []string{
`
Segments{
Segment{ DStart: 0, DEnd: 192, PEnd: 256, SLen: 156, Last: 156},
Segment{ DStart: 256, DEnd: 448, PEnd: 512, SLen: 156, Last: 156},
Segment{ DStart: 512, DEnd: 704, PEnd: 768, SLen: 156, Last: 156},
Segment{ DStart: 768, DEnd: 960, PEnd: 1024, SLen: 156, Last: 156},
Segment{ DStart: 1024, DEnd: 1216, PEnd: 1280, SLen: 156, Last: 156},
Segment{ DStart: 1280, DEnd: 1472, PEnd: 1536, SLen: 156, Last: 156},
Segment{ DStart: 1536, DEnd: 1728, PEnd: 1792, SLen: 156, Last: 156},
Segment{ DStart: 1792, DEnd: 1984, PEnd: 2048, SLen: 156, Last: 156},
Segment{ DStart: 2048, DEnd: 2194, PEnd: 2242, SLen: 156, Last: 19},
Segment{ DStart: 0, DEnd: 192, PEnd: 256, SLen: 155, Last: 155},
Segment{ DStart: 256, DEnd: 448, PEnd: 512, SLen: 155, Last: 155},
Segment{ DStart: 512, DEnd: 704, PEnd: 768, SLen: 155, Last: 155},
Segment{ DStart: 768, DEnd: 960, PEnd: 1024, SLen: 155, Last: 155},
Segment{ DStart: 1024, DEnd: 1216, PEnd: 1280, SLen: 155, Last: 155},
Segment{ DStart: 1280, DEnd: 1472, PEnd: 1536, SLen: 155, Last: 155},
Segment{ DStart: 1536, DEnd: 1728, PEnd: 1792, SLen: 155, Last: 155},
Segment{ DStart: 1792, DEnd: 1984, PEnd: 2048, SLen: 155, Last: 155},
Segment{ DStart: 2048, DEnd: 2204, PEnd: 2256, SLen: 155, Last: 150},
}
`,
`
Segments{
Segment{ DStart: 0, DEnd: 132, PEnd: 132, SLen: 3996, Last: 812},
Segment{ DStart: 0, DEnd: 132, PEnd: 132, SLen: 3995, Last: 943},
}
`,
`
Segments{
Segment{ DStart: 0, DEnd: 128, PEnd: 256, SLen: 3996, Last: 3996},
Segment{ DStart: 256, DEnd: 260, PEnd: 264, SLen: 3996, Last: 812},
Segment{ DStart: 0, DEnd: 128, PEnd: 256, SLen: 3995, Last: 3995},
Segment{ DStart: 256, DEnd: 260, PEnd: 264, SLen: 3995, Last: 943},
}
`,
`
Segments{
Segment{ DStart: 0, DEnd: 66, PEnd: 66, SLen: 3996, Last: 2404},
Segment{ DStart: 0, DEnd: 66, PEnd: 66, SLen: 3995, Last: 2469},
}
`,
}
@@ -54,14 +54,14 @@ func TestNewSegments(t *testing.T) {
if o != Expected[1] {
t.Errorf(
"Failed to correctly generate.\ngot:\n%s\nexpected:\n%s",
o, Expected[0])
o, Expected[1])
}
s = NewSegments(msgSize, segSize, Overhead, 128)
o = fmt.Sprint(s)
if o != Expected[2] {
t.Errorf(
"Failed to correctly generate.\ngot:\n%s\nexpected:\n%s",
o, Expected[0])
o, Expected[2])
}
msgSize = 2 << 17
segSize = 4096
@@ -70,6 +70,6 @@ func TestNewSegments(t *testing.T) {
if o != Expected[3] {
t.Errorf(
"Failed to correctly generate.\ngot:\n%s\nexpected:\n%s",
o, Expected[0])
o, Expected[3])
}
}

View File

@@ -13,11 +13,11 @@ var (
// GitRef is the gitref, as in refs/heads/branchname.
GitRef = "refs/heads/main"
// ParentGitCommit is the commit hash of the parent HEAD.
ParentGitCommit = "3d090b9567be9859405b43a7d2be9d93675a5c52"
ParentGitCommit = "94f0b3e0f8a6c2fd2ae4dd3db9c5745ab8571532"
// BuildTime stores the time when the current binary was built.
BuildTime = "2022-12-10T10:34:32+01:00"
BuildTime = "2022-12-10T10:42:15+01:00"
// SemVer lists the (latest) git tag on the build.
SemVer = "v0.0.168"
SemVer = "v0.0.169"
// PathBase is the path base returned from runtime caller.
PathBase = "/home/loki/src/github.com/Indra-Labs/indra/"
// Major is the major number from the tag.
@@ -25,7 +25,7 @@ var (
// Minor is the minor number from the tag.
Minor = 0
// Patch is the patch version number from the tag.
Patch = 168
Patch = 169
)
// Version returns a pretty printed version information string.