Merge pull request #1248 from dmcgowan/snapshot-storage-kind-test
Update storage kind test
This commit is contained in:
commit
036232856f
@ -18,15 +18,28 @@ func TestMetastore(t *testing.T) {
|
|||||||
|
|
||||||
// TestKidnConversion ensures we can blindly cast from protobuf types.
|
// TestKidnConversion ensures we can blindly cast from protobuf types.
|
||||||
func TestKindConversion(t *testing.T) {
|
func TestKindConversion(t *testing.T) {
|
||||||
for _, testcase := range []snapshot.Kind{
|
for _, testcase := range []struct {
|
||||||
snapshot.KindView,
|
s snapshot.Kind
|
||||||
snapshot.KindActive,
|
p proto.Kind
|
||||||
snapshot.KindCommitted,
|
|
||||||
}{
|
}{
|
||||||
cast := proto.Kind(testcase)
|
{
|
||||||
uncast := snapshot.Kind(cast)
|
s: snapshot.KindView,
|
||||||
if uncast != testcase {
|
p: proto.KindView,
|
||||||
t.Fatalf("kind value cast failed: %v != %v", uncast, testcase)
|
},
|
||||||
|
{
|
||||||
|
s: snapshot.KindActive,
|
||||||
|
p: proto.KindActive,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
s: snapshot.KindCommitted,
|
||||||
|
p: proto.KindCommitted,
|
||||||
|
},
|
||||||
|
} {
|
||||||
|
if testcase.s != snapshot.Kind(testcase.p) {
|
||||||
|
t.Fatalf("snapshot kind value cast failed: %v != %v", testcase.s, testcase.p)
|
||||||
|
}
|
||||||
|
if testcase.p != proto.Kind(testcase.s) {
|
||||||
|
t.Fatalf("proto kind value cast failed: %v != %v", testcase.s, testcase.p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user