forked from opengisch/QField
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_featureutils.cpp
More file actions
33 lines (26 loc) · 1.5 KB
/
test_featureutils.cpp
File metadata and controls
33 lines (26 loc) · 1.5 KB
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
33
/***************************************************************************
test_featureutils.h
--------------------
begin : Jun 2020
copyright : (C) 2020 by Ivan Ivanov
email : ivan@opengis.ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "catch2.h"
#include "qgsvectorlayer.h"
#include "utils/featureutils.h"
TEST_CASE( "FeatureUtils" )
{
std::unique_ptr<QgsVectorLayer> vl = std::make_unique<QgsVectorLayer>( QStringLiteral( "Polygon?crs=epsg:3946" ), QStringLiteral( "vl" ), QStringLiteral( "memory" ) );
QgsGeometry geometry = QgsGeometry::fromWkt( QStringLiteral( "Polygon (((8 8, 9 8, 8 9, 8 8)))" ) );
QgsFeature f = FeatureUtils::createFeature( vl.get(), geometry );
REQUIRE( f.fields() == vl->fields() );
REQUIRE( f.geometry().equals( geometry ) );
}