aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_super_block_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/storage/volume_super_block_test.go')
-rw-r--r--weed/storage/volume_super_block_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/weed/storage/volume_super_block_test.go b/weed/storage/volume_super_block_test.go
new file mode 100644
index 000000000..13db4b194
--- /dev/null
+++ b/weed/storage/volume_super_block_test.go
@@ -0,0 +1,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()
+ }
+
+}