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

Side by Side Diff: logdog/appengine/coordinator/endpoints/logs/get_test.go

Issue 2435883002: LogDog: Fix archival Get/Tail implementations. (Closed)
Patch Set: LogDog: Fix archival Get/Tail implementations. Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package logs 5 package logs
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 cr := iotools.CountingReader{Reader: r} 54 cr := iotools.CountingReader{Reader: r}
55 rio := recordio.NewReader(&cr, 4096) 55 rio := recordio.NewReader(&cr, 4096)
56 trash := bytes.Buffer{} 56 trash := bytes.Buffer{}
57 57
58 for { 58 for {
59 s, r, err := rio.ReadFrame() 59 s, r, err := rio.ReadFrame()
60 if err != nil { 60 if err != nil {
61 break 61 break
62 } 62 }
63 63
64 » » pos := int(cr.Count()) 64 » » pos := int(cr.Count)
65 for i := int64(0); i < s; i++ { 65 for i := int64(0); i < s; i++ {
66 d[pos+int(i)] = 0x00 66 d[pos+int(i)] = 0x00
67 } 67 }
68 68
69 // Read the (now-zeroed) data. 69 // Read the (now-zeroed) data.
70 trash.Reset() 70 trash.Reset()
71 trash.ReadFrom(r) 71 trash.ReadFrom(r)
72 } 72 }
73 } 73 }
74 74
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 t.Parallel() 602 t.Parallel()
603 603
604 testGetImpl(t, false) 604 testGetImpl(t, false)
605 } 605 }
606 606
607 func TestGetArchived(t *testing.T) { 607 func TestGetArchived(t *testing.T) {
608 t.Parallel() 608 t.Parallel()
609 609
610 testGetImpl(t, false) 610 testGetImpl(t, false)
611 } 611 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698