-
-
Notifications
You must be signed in to change notification settings - Fork 480
Expand file tree
/
Copy pathtest-geom-null.cpp
More file actions
32 lines (28 loc) · 897 Bytes
/
Copy pathtest-geom-null.cpp
File metadata and controls
32 lines (28 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* SPDX-License-Identifier: GPL-2.0-or-later
*
* This file is part of osm2pgsql (https://osm2pgsql.org/).
*
* Copyright (C) 2006-2026 by the osm2pgsql developer community.
* For a full list of authors see the git log.
*/
#include <catch.hpp>
#include "geom-from-osm.hpp"
#include "geom-functions.hpp"
#include "geom-output.hpp"
#include "geom.hpp"
TEST_CASE("null geometry", "[NoDB]")
{
geom::geometry_t const geom{};
REQUIRE(geom.n_points() == 0);
REQUIRE(dimension(geom) == 0);
REQUIRE(num_geometries(geom) == 0);
REQUIRE(area(geom) == Approx(0.0));
REQUIRE(spherical_area(geom) == Approx(0.0));
REQUIRE(length(geom) == Approx(0.0));
REQUIRE(spherical_length(geom) == Approx(0.0));
REQUIRE(geometry_type(geom) == "NULL");
REQUIRE(centroid(geom).is_null());
REQUIRE(geometry_n(geom, 1).is_null());
REQUIRE(reverse(geom).is_null());
}