encoded size function is now public + some janitor duty

This commit is contained in:
Anand Babu (AB) Periasamy
2015-03-22 17:17:53 -07:00
parent 537870ec4f
commit 3a76229551
4 changed files with 40 additions and 35 deletions

View File

@@ -28,10 +28,9 @@ func (s *MySuite) TestVanderMondeDecode(c *C) {
data := []byte("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
e := NewEncoder(ep)
chunks, length := e.Encode(data)
chunks, err := e.Encode(data)
c.Logf("chunks length: %d", len(chunks))
c.Logf("length: %d", length)
c.Assert(length, Equals, len(data))
c.Logf("length: %d", len(data))
chunks[0] = nil
chunks[3] = nil
@@ -39,7 +38,7 @@ func (s *MySuite) TestVanderMondeDecode(c *C) {
chunks[9] = nil
chunks[13] = nil
recoveredData, err := e.Decode(chunks, length)
recoveredData, err := e.Decode(chunks, len(data))
c.Assert(err, IsNil)
if !bytes.Equal(recoveredData, data) {