Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: impl/memory/gkvlite_utils_test.go

Issue 1911263002: Fix memory corruption bug in impl/memory (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: fix comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/memory/gkvlite_utils.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/gkvlite_utils_test.go
diff --git a/impl/memory/gkvlite_utils_test.go b/impl/memory/gkvlite_utils_test.go
index af07271b0867a53bbb24d7a7efcb82a48f4e27e8..1723267afbe9290f73f17cc683d17d6e55afe729 100644
--- a/impl/memory/gkvlite_utils_test.go
+++ b/impl/memory/gkvlite_utils_test.go
@@ -95,26 +95,26 @@ var testCollisionCases = []struct {
},
}
-func getFilledColl(s *memStore, fill []kv) *memCollection {
+func getFilledColl(fill []kv) memCollection {
if fill == nil {
return nil
}
- ret := s.MakePrivateCollection(nil)
+ store := newMemStore()
+ ret := store.GetOrCreateCollection("")
for _, i := range fill {
ret.Set(i.k, i.v)
}
- return ret
+ return store.Snapshot().GetCollection("")
}
func TestCollision(t *testing.T) {
t.Parallel()
Convey("Test gkvCollide", t, func() {
- s := newMemStore()
for _, tc := range testCollisionCases {
Convey(tc.name, func() {
- left := getFilledColl(s, tc.left)
- right := getFilledColl(s, tc.right)
+ left := getFilledColl(tc.left)
+ right := getFilledColl(tc.right)
i := 0
gkvCollide(left, right, func(key, left, right []byte) {
e := tc.expect[i]
« no previous file with comments | « impl/memory/gkvlite_utils.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698