summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-11 22:20:04 +0200
committerMattes D <github@xoft.cz>2015-06-11 22:20:04 +0200
commitd390214929f4b280cc66cdbc170694ec9b1fa8c4 (patch)
tree3c49c75771ffd8931f47b895b2bd31014f7885d8 /src/Generating
parentMerge pull request #2162 from lkolbly/master (diff)
downloadcuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.gz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.bz2
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.lz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.xz
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.tar.zst
cuberite-d390214929f4b280cc66cdbc170694ec9b1fa8c4.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/PieceGenerator.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Generating/PieceGenerator.cpp b/src/Generating/PieceGenerator.cpp
index 14a9da39d..93e7179e2 100644
--- a/src/Generating/PieceGenerator.cpp
+++ b/src/Generating/PieceGenerator.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "PieceGenerator.h"
+#include "../SelfTests.h"
@@ -22,6 +23,11 @@ static class cPieceGeneratorSelfTest :
public:
cPieceGeneratorSelfTest(void)
{
+ cSelfTests::Get().Register(std::bind(&cPieceGeneratorSelfTest::Test, this), "PieceGenerator");
+ }
+
+ void Test(void)
+ {
// Prepare the internal state:
InitializePieces();
@@ -31,14 +37,14 @@ public:
Gen.PlacePieces(500, 50, 500, 3, OutPieces);
// Print out the pieces:
- printf("OutPieces.size() = " SIZE_T_FMT "\n", OutPieces.size());
+ LOG("OutPieces.size() = " SIZE_T_FMT, OutPieces.size());
size_t idx = 0;
for (cPlacedPieces::const_iterator itr = OutPieces.begin(), end = OutPieces.end(); itr != end; ++itr, ++idx)
{
const Vector3i & Coords = (*itr)->GetCoords();
cCuboid Hitbox = (*itr)->GetHitBox();
Hitbox.Sort();
- printf(SIZE_T_FMT ": {%d, %d, %d}, rot %d, hitbox {%d, %d, %d} - {%d, %d, %d} (%d * %d * %d)\n", idx,
+ LOG(SIZE_T_FMT ": {%d, %d, %d}, rot %d, hitbox {%d, %d, %d} - {%d, %d, %d} (%d * %d * %d)", idx,
Coords.x, Coords.y, Coords.z,
(*itr)->GetNumCCWRotations(),
Hitbox.p1.x, Hitbox.p1.y, Hitbox.p1.z,
@@ -46,7 +52,7 @@ public:
Hitbox.DifX() + 1, Hitbox.DifY() + 1, Hitbox.DifZ() + 1
);
} // itr - OutPieces[]
- printf("Done.\n");
+ LOG("Done.");
// Free the placed pieces properly:
Gen.FreePieces(OutPieces);