28 lines
732 B
C++
28 lines
732 B
C++
#include <gtest/gtest.h>
|
|
#include "doorkeeper/components/tileiterator.hpp"
|
|
#include "doorkeeper/components/pixelconv.hpp"
|
|
#include <vector>
|
|
#include <boost/iterator/counting_iterator.hpp>
|
|
#include <limits>
|
|
|
|
TEST(tileiterator, increment) {
|
|
typedef dk::TileIterator<int, 7> tileit7;
|
|
typedef dk::Vector<7> coords7;
|
|
|
|
using boost::counting_iterator;
|
|
|
|
std::vector<int> data(counting_iterator<int>(0), counting_iterator<int>(100000));
|
|
dk::PixelConvSquare<7> pixconv(coords7(16));
|
|
|
|
{
|
|
const coords7 max_coords(99, 999, 2, 2, 2, 2, 2);
|
|
tileit7 it(&data, pixconv, max_coords);
|
|
|
|
for (std::size_t z = 0; z < data.size(); ++z) {
|
|
EXPECT_EQ(data[z], *it);
|
|
++it;
|
|
}
|
|
|
|
EXPECT_EQ(coords7(0, 0, 1, 0, 0, 0, 0), it.position());
|
|
}
|
|
}
|