summaryrefslogtreecommitdiff
path: root/testcase.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-05 13:38:27 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-05 13:38:27 -0500
commit7f3a568983470016bf99baafb4db47c8223c0494 (patch)
tree136c095e2cc68176e80eb59c38120165e1b739c9 /testcase.go
parent2ccad1c9bc42093fb341faed26ea41c1463fcfae (diff)
downloaddeb-planr-7f3a568983470016bf99baafb4db47c8223c0494.tar.xz
deb-planr-7f3a568983470016bf99baafb4db47c8223c0494.zip
Preserve original ordering
Diffstat (limited to 'testcase.go')
-rw-r--r--testcase.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/testcase.go b/testcase.go
index 19f1e58..d1db292 100644
--- a/testcase.go
+++ b/testcase.go
@@ -45,8 +45,17 @@ type TestCase struct {
Cname string
Config TestCaseConfig
+
+ // Reorder according to original read order after concurrent operation
+ readIdx int
}
func (tc TestCase) AdapterConfig() InheritableConfig {
return tc.Config.adapters_[*tc.Config.Adapter]
}
+
+type ByReadIdx []TestResult
+
+func (a ByReadIdx) Len() int { return len(a) }
+func (a ByReadIdx) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a ByReadIdx) Less(i, j int) bool { return a[i].Tc.readIdx < a[j].Tc.readIdx }