mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-10-01 15:46:17 -04:00
adding size and version tests for ds1
This commit is contained in:
parent
51cc23abef
commit
9fe2069040
@ -194,3 +194,29 @@ func TestDS1_MarshalUnmarshal(t *testing.T) {
|
|||||||
t.Error(loadErr)
|
t.Error(loadErr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDS1_Version(t *testing.T) {
|
||||||
|
ds1 := exampleData()
|
||||||
|
|
||||||
|
v := ds1.Version()
|
||||||
|
|
||||||
|
ds1.SetVersion(v + 1)
|
||||||
|
|
||||||
|
if ds1.Version() == v {
|
||||||
|
t.Fatal("expected different ds1 version")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDS1_SetSize(t *testing.T) {
|
||||||
|
ds1 := exampleData()
|
||||||
|
|
||||||
|
w, h := ds1.Size()
|
||||||
|
|
||||||
|
ds1.SetSize(w+1, h-1)
|
||||||
|
|
||||||
|
w2, h2 := ds1.Size()
|
||||||
|
|
||||||
|
if w2 != (w+1) || h2 != (h-1) {
|
||||||
|
t.Fatal("unexpected width/height after setting size")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user