diff options
author | Alexander Harkness <me@bearbin.net> | 2015-06-12 12:00:47 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2015-06-12 12:00:47 +0200 |
commit | 001305247fa28e78d0f3d9d565ff7aff25864edc (patch) | |
tree | 9f1e41fa0e6afee7ce9f90f3778f02e7a770ebf7 /src/Generating | |
parent | Update gratipay (diff) | |
parent | SelfTests are registered and executed after logging framework init. (diff) | |
download | cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.gz cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.bz2 cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.lz cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.xz cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.tar.zst cuberite-001305247fa28e78d0f3d9d565ff7aff25864edc.zip |
Diffstat (limited to 'src/Generating')
-rw-r--r-- | src/Generating/PieceGenerator.cpp | 12 |
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); |