aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_super_block_test.go
blob: 13db4b194fde11ea6a63b7788d22149db1cf2f6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package storage

import (
	"testing"
)

func TestSuperBlockReadWrite(t *testing.T) {
	rp, _ := NewReplicaPlacementFromByte(byte(001))
	ttl, _ := ReadTTL("15d")
	s := &SuperBlock{
		version:          CurrentVersion,
		ReplicaPlacement: rp,
		Ttl:              ttl,
	}

	bytes := s.Bytes()

	if !(bytes[2] == 15 && bytes[3] == Day) {
		println("byte[2]:", bytes[2], "byte[3]:", bytes[3])
		t.Fail()
	}

}