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

Unified Diff: impl/memory/datastore_index_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/datastore_index_selection.go ('k') | impl/memory/datastore_query_execution.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/datastore_index_test.go
diff --git a/impl/memory/datastore_index_test.go b/impl/memory/datastore_index_test.go
index 03c6cde51289d01bac9acc062823d0a986df7ead..e83026d23588ed3ef023e867409816bd244ddd62 100644
--- a/impl/memory/datastore_index_test.go
+++ b/impl/memory/datastore_index_test.go
@@ -243,7 +243,7 @@ func TestIndexEntries(t *testing.T) {
}
Convey(tc.name, func() {
- store := (*memStore)(nil)
+ store := (memStore)(nil)
if tc.withBuiltin {
store = indexEntriesWithBuiltins(fakeKey, tc.pmap, tc.idxs)
} else {
@@ -252,7 +252,7 @@ func TestIndexEntries(t *testing.T) {
}
for colName, vals := range tc.collections {
i := 0
- coll := store.GetCollection(colName)
+ coll := store.Snapshot().GetCollection(colName)
numItems, _ := coll.GetTotals()
So(numItems, ShouldEqual, len(tc.collections[colName]))
coll.VisitItemsAscend(nil, true, func(itm *gkvlite.Item) bool {
@@ -354,7 +354,7 @@ func TestUpdateIndexes(t *testing.T) {
for _, tc := range updateIndexesTests {
Convey(tc.name, func() {
store := newMemStore()
- idxColl := store.SetCollection("idx", nil)
+ idxColl := store.GetOrCreateCollection("idx")
for _, i := range tc.idxs {
idxColl.Set(cat(i.PrepForIdxTable()), []byte{})
}
@@ -369,7 +369,7 @@ func TestUpdateIndexes(t *testing.T) {
tmpLoader = nil
for colName, data := range tc.expected {
- coll := store.GetCollection(colName)
+ coll := store.Snapshot().GetCollection(colName)
So(coll, ShouldNotBeNil)
i := 0
coll.VisitItemsAscend(nil, false, func(itm *gkvlite.Item) bool {
« no previous file with comments | « impl/memory/datastore_index_selection.go ('k') | impl/memory/datastore_query_execution.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698