diff options
Diffstat (limited to 'main/tests')
-rw-r--r-- | main/tests/test_astar.cpp | 6 | ||||
-rw-r--r-- | main/tests/test_math.cpp | 18 | ||||
-rw-r--r-- | main/tests/test_physics.cpp | 8 | ||||
-rw-r--r-- | main/tests/test_physics_2d.cpp | 10 | ||||
-rw-r--r-- | main/tests/test_render.cpp | 2 |
5 files changed, 18 insertions, 26 deletions
diff --git a/main/tests/test_astar.cpp b/main/tests/test_astar.cpp index dee107f0af..e82d885af2 100644 --- a/main/tests/test_astar.cpp +++ b/main/tests/test_astar.cpp @@ -68,7 +68,7 @@ public: bool test_abc() { ABCX abcx; - PoolVector<int> path = abcx.get_id_path(ABCX::A, ABCX::C); + Vector<int> path = abcx.get_id_path(ABCX::A, ABCX::C); bool ok = path.size() == 3; int i = 0; ok = ok && path[i++] == ABCX::A; @@ -79,7 +79,7 @@ bool test_abc() { bool test_abcx() { ABCX abcx; - PoolVector<int> path = abcx.get_id_path(ABCX::X, ABCX::C); + Vector<int> path = abcx.get_id_path(ABCX::X, ABCX::C); bool ok = path.size() == 4; int i = 0; ok = ok && path[i++] == ABCX::X; @@ -304,7 +304,7 @@ bool test_solutions() { for (int u = 0; u < N; u++) for (int v = 0; v < N; v++) if (u != v) { - PoolVector<int> route = a.get_id_path(u, v); + Vector<int> route = a.get_id_path(u, v); if (!Math::is_inf(d[u][v])) { // Reachable if (route.size() == 0) { diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index 2c4ba08c6d..d91503501d 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -451,34 +451,26 @@ MainLoop *test() { print_line("RGBE: " + Color(rd, gd, bd)); } - print_line("Dvectors: " + itos(MemoryPool::allocs_used)); - print_line("Mem used: " + itos(MemoryPool::total_memory)); - print_line("MAx mem used: " + itos(MemoryPool::max_memory)); - - PoolVector<int> ints; + Vector<int> ints; ints.resize(20); { - PoolVector<int>::Write w; - w = ints.write(); + int *w; + w = ints.ptrw(); for (int i = 0; i < ints.size(); i++) { w[i] = i; } } - PoolVector<int> posho = ints; + Vector<int> posho = ints; { - PoolVector<int>::Read r = posho.read(); + const int *r = posho.ptr(); for (int i = 0; i < posho.size(); i++) { print_line(itos(i) + " : " + itos(r[i])); } } - print_line("later Dvectors: " + itos(MemoryPool::allocs_used)); - print_line("later Mem used: " + itos(MemoryPool::total_memory)); - print_line("Mlater Ax mem used: " + itos(MemoryPool::max_memory)); - List<String> cmdlargs = OS::get_singleton()->get_cmdline_args(); if (cmdlargs.empty()) { diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp index 3f4f91f8f4..43958a9493 100644 --- a/main/tests/test_physics.cpp +++ b/main/tests/test_physics.cpp @@ -143,7 +143,7 @@ protected: /* BOX SHAPE */ - PoolVector<Plane> box_planes = Geometry::build_box_planes(Vector3(0.5, 0.5, 0.5)); + Vector<Plane> box_planes = Geometry::build_box_planes(Vector3(0.5, 0.5, 0.5)); RID box_mesh = vs->mesh_create(); Geometry::MeshData box_data = Geometry::build_convex_mesh(box_planes); vs->mesh_add_surface_from_mesh_data(box_mesh, box_data); @@ -155,7 +155,7 @@ protected: /* CAPSULE SHAPE */ - PoolVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 0.7, 12, Vector3::AXIS_Z); + Vector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 0.7, 12, Vector3::AXIS_Z); RID capsule_mesh = vs->mesh_create(); Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes); @@ -172,7 +172,7 @@ protected: /* CONVEX SHAPE */ - PoolVector<Plane> convex_planes = Geometry::build_cylinder_planes(0.5, 0.7, 5, Vector3::AXIS_Z); + Vector<Plane> convex_planes = Geometry::build_cylinder_planes(0.5, 0.7, 5, Vector3::AXIS_Z); RID convex_mesh = vs->mesh_create(); Geometry::MeshData convex_data = Geometry::build_convex_mesh(convex_planes); @@ -363,7 +363,7 @@ public: VisualServer *vs = VisualServer::get_singleton(); PhysicsServer *ps = PhysicsServer::get_singleton(); - PoolVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 1, 12, 5, Vector3::AXIS_Y); + Vector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5, 1, 12, 5, Vector3::AXIS_Y); RID capsule_mesh = vs->mesh_create(); Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes); diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp index 9c10fcbd56..160c25f43a 100644 --- a/main/tests/test_physics_2d.cpp +++ b/main/tests/test_physics_2d.cpp @@ -72,7 +72,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 2 * 2); for (int i = 0; i < 2; i++) { @@ -97,7 +97,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 32 * 2); for (int i = 0; i < 32; i++) { @@ -124,7 +124,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 32 * 2); for (int i = 0; i < 32; i++) { @@ -151,7 +151,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - PoolVector<uint8_t> pixels; + Vector<uint8_t> pixels; pixels.resize(32 * 64 * 2); for (int i = 0; i < 64; i++) { @@ -185,7 +185,7 @@ class TestPhysics2DMainLoop : public MainLoop { RID convex_polygon_shape = ps->convex_polygon_shape_create(); - PoolVector<Vector2> arr; + Vector<Vector2> arr; Point2 sb(32, 32); arr.push_back(Point2(20, 3) - sb); arr.push_back(Point2(58, 23) - sb); diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp index 0e101fb566..62239a5cb5 100644 --- a/main/tests/test_render.cpp +++ b/main/tests/test_render.cpp @@ -81,7 +81,7 @@ public: Vector<Vector3> vts; /* - PoolVector<Plane> sp = Geometry::build_sphere_planes(2,5,5); + Vector<Plane> sp = Geometry::build_sphere_planes(2,5,5); Geometry::MeshData md2 = Geometry::build_convex_mesh(sp); vts=md2.vertices; */ |