2017-11-13 22:41:48 +01:00
|
|
|
#include "catch.hpp"
|
|
|
|
|
|
|
|
#include <mapnik/util/char_array_buffer.hpp>
|
|
|
|
#include <istream>
|
|
|
|
|
2022-01-26 23:25:53 +01:00
|
|
|
TEST_CASE("char_array_buffer")
|
|
|
|
{
|
|
|
|
SECTION("std::istream seekg, tellg")
|
|
|
|
{
|
|
|
|
const std::size_t buffer_size = 66;
|
|
|
|
char buffer[buffer_size];
|
|
|
|
mapnik::util::char_array_buffer array_buff(buffer, buffer_size);
|
|
|
|
std::istream stream(&array_buff);
|
2017-11-13 22:41:48 +01:00
|
|
|
|
2022-01-26 23:25:53 +01:00
|
|
|
CHECK(stream.seekg(0).tellg() == 0);
|
|
|
|
CHECK(stream.seekg(buffer_size).tellg() == buffer_size);
|
|
|
|
CHECK(stream.seekg(70).tellg() == buffer_size);
|
|
|
|
}
|
2017-11-13 22:41:48 +01:00
|
|
|
}
|