mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-25 03:29:10 +08:00
26 lines
477 B
Go
26 lines
477 B
Go
package storage
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/joeslay/seaweedfs/weed/storage/needle"
|
|
)
|
|
|
|
func TestSuperBlockReadWrite(t *testing.T) {
|
|
rp, _ := NewReplicaPlacementFromByte(byte(001))
|
|
ttl, _ := needle.ReadTTL("15d")
|
|
s := &SuperBlock{
|
|
version: needle.CurrentVersion,
|
|
ReplicaPlacement: rp,
|
|
Ttl: ttl,
|
|
}
|
|
|
|
bytes := s.Bytes()
|
|
|
|
if !(bytes[2] == 15 && bytes[3] == needle.Day) {
|
|
println("byte[2]:", bytes[2], "byte[3]:", bytes[3])
|
|
t.Fail()
|
|
}
|
|
|
|
}
|