StorageDriver: Testsuite: call Close before getting Size

Signed-off-by: Arthur Baars <arthur@semmle.com>
This commit is contained in:
Arthur Baars 2016-02-12 17:49:37 +00:00 committed by Brian Bland
parent ff03381d49
commit 666273d9f6

View file

@ -412,12 +412,12 @@ func (suite *DriverSuite) testContinueStreamAppend(c *check.C, chunkSize int64)
c.Assert(err, check.IsNil)
c.Assert(nn, check.Equals, int64(len(contentsChunk1)))
curSize := writer.Size()
c.Assert(curSize, check.Equals, int64(len(contentsChunk1)))
err = writer.Close()
c.Assert(err, check.IsNil)
curSize := writer.Size()
c.Assert(curSize, check.Equals, int64(len(contentsChunk1)))
writer, err = suite.StorageDriver.Writer(suite.ctx, filename, true)
c.Assert(err, check.IsNil)
c.Assert(writer.Size(), check.Equals, curSize)
@ -426,12 +426,12 @@ func (suite *DriverSuite) testContinueStreamAppend(c *check.C, chunkSize int64)
c.Assert(err, check.IsNil)
c.Assert(nn, check.Equals, int64(len(contentsChunk2)))
curSize = writer.Size()
c.Assert(curSize, check.Equals, 2*chunkSize)
err = writer.Close()
c.Assert(err, check.IsNil)
curSize = writer.Size()
c.Assert(curSize, check.Equals, 2*chunkSize)
writer, err = suite.StorageDriver.Writer(suite.ctx, filename, true)
c.Assert(err, check.IsNil)
c.Assert(writer.Size(), check.Equals, curSize)