volume_super_block_test.go 403 B

1234567891011121314151617181920212223
  1. package storage
  2. import (
  3. "testing"
  4. )
  5. func TestSuperBlockReadWrite(t *testing.T) {
  6. rp, _ := NewReplicaPlacementFromByte(byte(001))
  7. ttl, _ := ReadTTL("15d")
  8. s := &SuperBlock{
  9. version: CurrentVersion,
  10. ReplicaPlacement: rp,
  11. Ttl: ttl,
  12. }
  13. bytes := s.Bytes()
  14. if !(bytes[2] == 15 && bytes[3] == Day) {
  15. println("byte[2]:", bytes[2], "byte[3]:", bytes[3])
  16. t.Fail()
  17. }
  18. }