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

Unified Diff: impl/memory/gkvlite_iter_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: 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
Index: impl/memory/gkvlite_iter_test.go
diff --git a/impl/memory/gkvlite_iter_test.go b/impl/memory/gkvlite_iter_test.go
index 936bb3f4aa03075787fef78a98639d9017e68b9f..c0accae0d90be736cc22cbe850e9a047e7a3fdbf 100644
--- a/impl/memory/gkvlite_iter_test.go
+++ b/impl/memory/gkvlite_iter_test.go
@@ -34,13 +34,14 @@ func TestIterator(t *testing.T) {
t.Parallel()
s := newMemStore()
- c := s.SetCollection("zup", nil)
+ c := s.GetOrCreateCollection("zup")
prev := []byte{}
for i := 5; i < 100; i++ {
data := mkNum(int64(i))
c.Set(data, prev)
prev = data
}
+ c = s.Snapshot().GetCollection("zup")
get := func(c C, t *iterator) interface{} {
ret := interface{}(nil)
@@ -191,14 +192,16 @@ func TestMultiIteratorSimple(t *testing.T) {
Convey("Test MultiIterator", t, func() {
s := newMemStore()
- c := s.SetCollection("zup1", nil)
+ c := s.GetOrCreateCollection("zup1")
for _, row := range valBytes {
c.Set(row, []byte{})
}
- c2 := s.SetCollection("zup2", nil)
+ c2 := s.GetOrCreateCollection("zup2")
for _, row := range otherValBytes {
c2.Set(row, []byte{})
}
+ c = s.Snapshot().GetCollection("zup1")
+ c2 = s.Snapshot().GetCollection("zup2")
Convey("can join the same collection twice", func() {
// get just the (1, *)

Powered by Google App Engine
This is Rietveld 408576698