From 0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 7 Nov 2016 20:29:58 +0100 Subject: global storage interface refactor (#112) * core: ObjectStorage, ReferenceStorage renamed to ObjectStorer and ReferenceStorer * rebase * general, changes request by @alcortes * general, changes request by @alcortes --- formats/packfile/decoder_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'formats/packfile/decoder_test.go') diff --git a/formats/packfile/decoder_test.go b/formats/packfile/decoder_test.go index 48790b4..aa178d7 100644 --- a/formats/packfile/decoder_test.go +++ b/formats/packfile/decoder_test.go @@ -33,7 +33,7 @@ func (s *ReaderSuite) TestDecode(c *C) { scanner := NewScanner(f.Packfile()) storage := memory.NewStorage() - d, err := NewDecoder(scanner, storage.ObjectStorage()) + d, err := NewDecoder(scanner, storage) c.Assert(err, IsNil) defer d.Close() @@ -97,7 +97,7 @@ func (s *ReaderSuite) TestDecodeCRCs(c *C) { scanner := NewScanner(f.Packfile()) storage := memory.NewStorage() - d, err := NewDecoder(scanner, storage.ObjectStorage()) + d, err := NewDecoder(scanner, storage) c.Assert(err, IsNil) _, err = d.Decode() c.Assert(err, IsNil) @@ -158,11 +158,9 @@ func (s *ReaderSuite) TestSetOffsets(c *C) { } func assertObjects(c *C, s *memory.Storage, expects []string) { - o := s.ObjectStorage().(*memory.ObjectStorage) - - c.Assert(len(expects), Equals, len(o.Objects)) + c.Assert(len(expects), Equals, len(s.Objects)) for _, exp := range expects { - obt, err := o.Get(core.AnyObject, core.NewHash(exp)) + obt, err := s.Object(core.AnyObject, core.NewHash(exp)) c.Assert(err, IsNil) c.Assert(obt.Hash().String(), Equals, exp) } -- cgit