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

Side by Side Diff: impl/memory/datastore_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 unified diff | Download patch
« no previous file with comments | « impl/memory/datastore_query_execution.go ('k') | impl/memory/doc.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package memory 5 package memory
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "testing" 9 "testing"
10 "time" 10 "time"
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 534 }
535 535
536 func TestCompoundIndexes(t *testing.T) { 536 func TestCompoundIndexes(t *testing.T) {
537 t.Parallel() 537 t.Parallel()
538 538
539 idxKey := func(def dsS.IndexDefinition) string { 539 idxKey := func(def dsS.IndexDefinition) string {
540 So(def, ShouldNotBeNil) 540 So(def, ShouldNotBeNil)
541 return "idx::" + string(serialize.ToBytes(*def.PrepForIdxTable() )) 541 return "idx::" + string(serialize.ToBytes(*def.PrepForIdxTable() ))
542 } 542 }
543 543
544 » numItms := func(c *memCollection) uint64 { 544 » numItms := func(c memCollection) uint64 {
545 ret, _ := c.GetTotals() 545 ret, _ := c.GetTotals()
546 return ret 546 return ret
547 } 547 }
548 548
549 Convey("Test Compound indexes", t, func() { 549 Convey("Test Compound indexes", t, func() {
550 type Model struct { 550 type Model struct {
551 ID int64 `gae:"$id"` 551 ID int64 `gae:"$id"`
552 552
553 Field1 []string 553 Field1 []string
554 Field2 []int64 554 Field2 []int64
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 // Add "foos" to a new namesapce, then confirm that it g ets indexed. 677 // Add "foos" to a new namesapce, then confirm that it g ets indexed.
678 So(dsS.Get(infoS.Get(ctx).MustNamespace("qux")).PutMulti (foos), ShouldBeNil) 678 So(dsS.Get(infoS.Get(ctx).MustNamespace("qux")).PutMulti (foos), ShouldBeNil)
679 dsS.Get(ctx).Testable().CatchupIndexes() 679 dsS.Get(ctx).Testable().CatchupIndexes()
680 680
681 results = nil 681 results = nil
682 So(dsS.Get(infoS.Get(ctx).MustNamespace("qux")).GetAll(q , &results), ShouldBeNil) 682 So(dsS.Get(infoS.Get(ctx).MustNamespace("qux")).GetAll(q , &results), ShouldBeNil)
683 So(len(results), ShouldEqual, 2) 683 So(len(results), ShouldEqual, 2)
684 }) 684 })
685 }) 685 })
686 } 686 }
OLDNEW
« no previous file with comments | « impl/memory/datastore_query_execution.go ('k') | impl/memory/doc.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698