mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-28 21:39:02 +08:00
23 lines
383 B
Go
23 lines
383 B
Go
|
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()
|
||
|
}
|
||
|
|
||
|
}
|