diff --git a/server/mapobjectdb/accessor_test.go b/server/mapobjectdb/accessor_test.go new file mode 100644 index 0000000..675d3c4 --- /dev/null +++ b/server/mapobjectdb/accessor_test.go @@ -0,0 +1,33 @@ +package mapobjectdb + +import ( + "mapserver/coords" + "testing" + "fmt" +) + + +func TestNewMapBlockCoords(t *testing.T) { + attrs := make(map[string]string) + attrs["X"] = "y" + + pos := coords.NewMapBlockCoords(1, 2, 3) + fmt.Println(pos) + + obj := NewMapObject(&pos, 10, 12, 14, "xy") + fmt.Println(obj) + + if obj.X != 26 { + t.Error("x coord off") + } + + if obj.Y != 44 { + t.Error("Y coord off") + } + + if obj.Z != 62 { + t.Error("Z coord off") + } + + +} diff --git a/server/mapobjectdb/sqlite/mapobjects_test.go b/server/mapobjectdb/sqlite/mapobjects_test.go index 6a33bcc..bb30a40 100644 --- a/server/mapobjectdb/sqlite/mapobjects_test.go +++ b/server/mapobjectdb/sqlite/mapobjects_test.go @@ -90,9 +90,9 @@ func TestMapObjects(t *testing.T) { o := mapobjectdb.MapObject{ MBPos: &pos, - X: 1, - Y: 2, - Z: 3, + X: 15, + Y: 15, + Z: 15, Type: "xy", Mtime: 1234, Attributes: attrs,