adding ttl field to volume super block

This commit is contained in:
Chris Lu
2014-08-31 23:25:54 -07:00
parent 57a4549d86
commit 69343c5951
4 changed files with 45 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
package storage
import (
"testing"
)
func TestSuperBlockReadWrite(t *testing.T) {
rp, _ := NewReplicaPlacementFromByte(byte(001))
s := &SuperBlock{
version: CurrentVersion,
ReplicaPlacement: rp,
Ttl: uint16(35),
}
bytes := s.Bytes()
if !(bytes[2] == 0 && bytes[3] == 35) {
println("byte[2]:", bytes[2], "byte[3]:", bytes[3])
t.Fail()
}
}