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

import (
	"testing"

	"github.com/seaweedfs/seaweedfs/weed/storage/needle"
)

func TestSortVolumeInfos(t *testing.T) {
	vis := []*VolumeInfo{
		&VolumeInfo{
			Id: 2,
		},
		&VolumeInfo{
			Id: 1,
		},
		&VolumeInfo{
			Id: 3,
		},
	}
	sortVolumeInfos(vis)
	for i := 0; i < len(vis); i++ {
		if vis[i].Id != needle.VolumeId(i+1) {
			t.Fatal()
		}
	}
}