File: char_array_buffer.cpp

package info (click to toggle)
mapnik 4.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 18,548 kB
  • sloc: cpp: 163,861; python: 1,190; sh: 690; xml: 161; makefile: 123; perl: 28; lisp: 13
file content (19 lines) | stat: -rw-r--r-- 535 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "catch.hpp"

#include <mapnik/util/char_array_buffer.hpp>
#include <istream>

TEST_CASE("char_array_buffer")
{
    SECTION("std::istream seekg, tellg")
    {
        std::size_t const buffer_size = 66;
        char buffer[buffer_size];
        mapnik::util::char_array_buffer array_buff(buffer, buffer_size);
        std::istream stream(&array_buff);

        CHECK(stream.seekg(0).tellg() == 0);
        CHECK(stream.seekg(buffer_size).tellg() == buffer_size);
        CHECK(stream.seekg(70).tellg() == buffer_size);
    }
}