File: test_nwr_array.cpp

package info (click to toggle)
libosmium 2.22.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,544 kB
  • sloc: cpp: 52,804; sh: 148; makefile: 19
file content (21 lines) | stat: -rw-r--r-- 503 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "catch.hpp"

#include <osmium/index/nwr_array.hpp>

TEST_CASE("nwr_array") {
    osmium::nwr_array<int> a;
    a(osmium::item_type::node) = 1;
    a(osmium::item_type::way) = 2;
    a(osmium::item_type::relation) = 3;

    REQUIRE(a(osmium::item_type::node) == 1);
    REQUIRE(a(osmium::item_type::way) == 2);
    REQUIRE(a(osmium::item_type::relation) == 3);

    auto it = a.cbegin();
    REQUIRE(*it++ == 1);
    REQUIRE(*it++ == 2);
    REQUIRE(*it++ == 3);
    REQUIRE(it == a.cend());
}