You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
383 B

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