DoorKeeper/test/unit/tilecoords.cpp
King_DuckZ 6aa4d15381 Add tilecoords and unit test.
Disable most projects because the build is broken. A lot.
2015-07-30 01:18:19 +02:00

21 lines
588 B
C++

#include <gtest/gtest.h>
#include "doorkeeper/components/tilecoords.hpp"
TEST(increment, tilecoords) {
typedef dk::TileCoords<2> tcoords2;
typedef dk::TileCoords<2>::coords coords2;
{
const coords2 max_coords(150, 200);
tcoords2 test(max_coords);
EXPECT_EQ(tcoords2(coords2(0), max_coords), test);
for (auto z = coords2(0).x(); z < max_coords.x(); ++z) {
EXPECT_EQ(tcoords2(coords2(z, 0), max_coords), test);
++test;
}
auto test_old = test++;
EXPECT_EQ(tcoords2(coords2(1, 1), max_coords), test);
EXPECT_EQ(tcoords2(coords2(0, 1), max_coords), test_old);
}
}