Skip to content

Commit

Permalink
Add test for LINESTRING EMPTY, GH-993
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Nov 20, 2023
1 parent cfad2ab commit 4767afd
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions tests/unit/capi/GEOSHasZMTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ template<>
template<>
void object::test<1>()
{
input_ = GEOSGeomFromWKT("POLYGON ((1 -2, 9 -2, 9 5, 1 5, 1 -2))");
input_ = fromWKT("POLYGON ((1 -2, 9 -2, 9 5, 1 5, 1 -2))");

ensure_equals(GEOSHasZ(input_), 0);
ensure_equals(GEOSHasM(input_), 0);
Expand All @@ -30,7 +30,7 @@ template<>
template<>
void object::test<2>()
{
input_ = GEOSGeomFromWKT("POINT M (1 2 3)");
input_ = fromWKT("POINT M (1 2 3)");

ensure_equals(GEOSHasZ(input_), 0);
ensure_equals(GEOSHasM(input_), 1);
Expand All @@ -40,7 +40,7 @@ template<>
template<>
void object::test<3>()
{
input_ = GEOSGeomFromWKT("POINT EMPTY");
input_ = fromWKT("POINT EMPTY");

ensure_equals(GEOSHasZ(input_), 0);
ensure_equals(GEOSHasM(input_), 0);
Expand All @@ -50,7 +50,7 @@ template<>
template<>
void object::test<4>()
{
input_ = GEOSGeomFromWKT("POINT Z EMPTY");
input_ = fromWKT("POINT Z EMPTY");

ensure_equals(GEOSHasZ(input_), 1);
ensure_equals(GEOSHasM(input_), 0);
Expand All @@ -60,7 +60,7 @@ template<>
template<>
void object::test<5>()
{
input_ = GEOSGeomFromWKT("POINT M EMPTY");
input_ = fromWKT("POINT M EMPTY");

ensure_equals(GEOSHasZ(input_), 0);
ensure_equals(GEOSHasM(input_), 1);
Expand All @@ -70,11 +70,41 @@ template<>
template<>
void object::test<6>()
{
input_ = GEOSGeomFromWKT("POINT ZM EMPTY");
input_ = fromWKT("POINT ZM EMPTY");

ensure_equals(GEOSHasZ(input_), 1);
ensure_equals(GEOSHasM(input_), 1);
}

template<>
template<>
void object::test<7>()
{
input_ = fromWKT("LINESTRING EMPTY");

ensure_equals(GEOSHasZ(input_), 0);
ensure_equals(GEOSHasM(input_), 0);
}

template<>
template<>
void object::test<8>()
{
input_ = fromWKT("LINESTRING Z EMPTY");

ensure_equals(GEOSHasZ(input_), 1);
ensure_equals(GEOSHasM(input_), 0);
}

template<>
template<>
void object::test<9>()
{
input_ = fromWKT("LINESTRING M EMPTY");

ensure_equals(GEOSHasZ(input_), 0);
ensure_equals(GEOSHasM(input_), 1);
}

} // namespace tut

0 comments on commit 4767afd

Please sign in to comment.