From 91003487acda056be18c9efecedd951ca9629f26 Mon Sep 17 00:00:00 2001 From: hanemile Date: Sat, 3 Nov 2018 00:48:01 +0100 Subject: refactored some names, they are now being exported. --- structs_test.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'structs_test.go') diff --git a/structs_test.go b/structs_test.go index 66598bf..685557b 100644 --- a/structs_test.go +++ b/structs_test.go @@ -8,7 +8,7 @@ import ( func TestQuadtree(t *testing.T) { testQuadtree := quadtree{ nodeCapacity: 0, - boundary: boundingBox{}, + boundary: BoundingBox{}, pointsSlice: nil, northWest: nil, northEast: nil, @@ -21,12 +21,12 @@ func TestQuadtree(t *testing.T) { // NewQuadTree test func TestNewQuadtree(t *testing.T) { - var boundary = boundingBox{ + var boundary = BoundingBox{ center: Coord{0, 0}, halfDimension: 3, } - var newQuadtree = *newQuadtree(boundary, 0) + var newQuadtree = *NewQuadtree(boundary, 0) t.Log(newQuadtree) } @@ -49,7 +49,7 @@ func TestNewCoord(t *testing.T) { } func TestBoundingBox(t *testing.T) { - var newBoundingBox = boundingBox{ + var newBoundingBox = BoundingBox{ center: Coord{ x: 1, y: 2, @@ -62,7 +62,7 @@ func TestBoundingBox(t *testing.T) { func TestInsideOf(t *testing.T) { var testCoordinate = Coord{0, 0} - var testQuadTree = newQuadtree(boundingBox{ + var testQuadTree = NewQuadtree(BoundingBox{ center: Coord{ x: 0, y: 0, @@ -74,7 +74,7 @@ func TestInsideOf(t *testing.T) { t.Log(isInsideOf) } -// Test the newBoundingBox function +// Test the NewBoundingBox function func TestNewBoundingBox(t *testing.T) { // Initialize some values that are needed @@ -82,19 +82,19 @@ func TestNewBoundingBox(t *testing.T) { var newHalfDimension float64 = 3 // Initialize the bounding box using the values above - var newBoundingBox = newBoundingBox(newCenter, newHalfDimension) + var newBoundingBox = NewBoundingBox(newCenter, newHalfDimension) - // Print the newBoundingBox + // Print the NewBoundingBox t.Log(newBoundingBox) } func TestSubdivide(t *testing.T) { - var boundary = boundingBox{ + var boundary = BoundingBox{ center: Coord{0, 0}, halfDimension: 3, } - var newQuadtree = *newQuadtree(boundary, 0) + var newQuadtree = *NewQuadtree(boundary, 0) newQuadtree.subdivide() @@ -106,20 +106,20 @@ func TestSubdivide(t *testing.T) { } -// test the insert function +// test the Insert function func TestInsert(t *testing.T) { // Define a new quadtree-root-boundary - var boundary = boundingBox{ + var boundary = BoundingBox{ center: Coord{0, 0}, halfDimension: 3, } // create a new quadtree using the boundary - var newQuadtree = *newQuadtree(boundary, 0) + var newQuadtree = *NewQuadtree(boundary, 0) - // Define a star and insert it into the quadtree + // Define a star and Insert it into the quadtree singleCoord := Coord{0.5, 0.5} - newQuadtree.insert(singleCoord) + newQuadtree.Insert(singleCoord) // Print the stuff generated t.Logf("Complete Tree: %v\n", newQuadtree.northEast.southWest.southWest.northEast) -- cgit 1.4.1