Skip to content

Commit ee44bc8

Browse files
committed
Implement QEP 17 - add "requires tests" comments to some classes
1 parent d699569 commit ee44bc8

10 files changed

+214
-4
lines changed

src/core/geometry/qgswkbtypes.cpp

+30
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717

1818
#include "qgswkbtypes.h"
1919

20+
/***************************************************************************
21+
* This class is considered CRITICAL and any change MUST be accompanied with
22+
* full unit tests.
23+
* See details in QEP #17
24+
****************************************************************************/
25+
2026
QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry>* QgsWKBTypes::entries()
2127
{
2228
static QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry> entries = registerTypes();
@@ -53,6 +59,12 @@ QgsWKBTypes::Type QgsWKBTypes::flatType( Type type )
5359
return it->mFlatType;
5460
}
5561

62+
/***************************************************************************
63+
* This class is considered CRITICAL and any change MUST be accompanied with
64+
* full unit tests.
65+
* See details in QEP #17
66+
****************************************************************************/
67+
5668
QgsWKBTypes::Type QgsWKBTypes::parseType( const QString &wktStr )
5769
{
5870
QString typestr = wktStr.left( wktStr.indexOf( '(' ) ).simplified().remove( ' ' );
@@ -82,6 +94,12 @@ bool QgsWKBTypes::isMultiType( Type type )
8294
return it->mIsMultiType;
8395
}
8496

97+
/***************************************************************************
98+
* This class is considered CRITICAL and any change MUST be accompanied with
99+
* full unit tests.
100+
* See details in QEP #17
101+
****************************************************************************/
102+
85103
int QgsWKBTypes::wkbDimensions( Type type )
86104
{
87105
GeometryType gtype = geometryType( type );
@@ -129,6 +147,12 @@ QString QgsWKBTypes::displayString( Type type )
129147
return it->mName;
130148
}
131149

150+
/***************************************************************************
151+
* This class is considered CRITICAL and any change MUST be accompanied with
152+
* full unit tests.
153+
* See details in QEP #17
154+
****************************************************************************/
155+
132156
bool QgsWKBTypes::hasZ( Type type )
133157
{
134158
QMap< Type, wkbEntry >::const_iterator it = entries()->constFind( type );
@@ -190,6 +214,12 @@ QgsWKBTypes::Type QgsWKBTypes::addM( QgsWKBTypes::Type type )
190214
return ( QgsWKBTypes::Type )( flat + 2000 );
191215
}
192216

217+
/***************************************************************************
218+
* This class is considered CRITICAL and any change MUST be accompanied with
219+
* full unit tests.
220+
* See details in QEP #17
221+
****************************************************************************/
222+
193223
QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry> QgsWKBTypes::registerTypes()
194224
{
195225
QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry> entries;

src/core/geometry/qgswkbtypes.h

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
#include <QMap>
2222
#include <QString>
2323

24+
/***************************************************************************
25+
* This class is considered CRITICAL and any change MUST be accompanied with
26+
* full unit tests in testqgsstatisticalsummary.cpp.
27+
* See details in QEP #17
28+
****************************************************************************/
29+
2430
/** \ingroup core
2531
* \class QgsWKBTypes
2632
* \brief Handles storage of information regarding WKB types and their properties.

src/core/qgsfeature.cpp

+41-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ email : sherman at mrcc.com
2323

2424
#include <QDataStream>
2525

26+
/***************************************************************************
27+
* This class is considered CRITICAL and any change MUST be accompanied with
28+
* full unit tests in testqgsfeature.cpp.
29+
* See details in QEP #17
30+
****************************************************************************/
31+
2632
QgsFeature::QgsFeature( QgsFeatureId id )
2733
{
2834
d = new QgsFeaturePrivate( id );
@@ -50,6 +56,12 @@ QgsFeature::~QgsFeature()
5056
{
5157
}
5258

59+
/***************************************************************************
60+
* This class is considered CRITICAL and any change MUST be accompanied with
61+
* full unit tests in testqgsfeature.cpp.
62+
* See details in QEP #17
63+
****************************************************************************/
64+
5365
QgsFeatureId QgsFeature::id() const
5466
{
5567
return d->fid;
@@ -80,6 +92,12 @@ QgsGeometry *QgsFeature::geometryAndOwnership()
8092
return d->geometry;
8193
}
8294

95+
/***************************************************************************
96+
* This class is considered CRITICAL and any change MUST be accompanied with
97+
* full unit tests in testqgsfeature.cpp.
98+
* See details in QEP #17
99+
****************************************************************************/
100+
83101
void QgsFeature::setFeatureId( QgsFeatureId id )
84102
{
85103
if ( id == d->fid )
@@ -137,6 +155,12 @@ void QgsFeature::setGeometry( QgsGeometry* geom )
137155
d->ownsGeometry = true;
138156
}
139157

158+
/***************************************************************************
159+
* This class is considered CRITICAL and any change MUST be accompanied with
160+
* full unit tests in testqgsfeature.cpp.
161+
* See details in QEP #17
162+
****************************************************************************/
163+
140164
/** Set the pointer to the feature geometry
141165
*/
142166
void QgsFeature::setGeometryAndOwnership( unsigned char *geom, size_t length )
@@ -166,6 +190,11 @@ const QgsFields *QgsFeature::fields() const
166190
return &( d->fields );
167191
}
168192

193+
/***************************************************************************
194+
* This class is considered CRITICAL and any change MUST be accompanied with
195+
* full unit tests in testqgsfeature.cpp.
196+
* See details in QEP #17
197+
****************************************************************************/
169198

170199
bool QgsFeature::isValid() const
171200
{
@@ -190,7 +219,6 @@ void QgsFeature::initAttributes( int fieldCount )
190219
ptr->clear();
191220
}
192221

193-
194222
bool QgsFeature::setAttribute( int idx, const QVariant &value )
195223
{
196224
if ( idx < 0 || idx >= d->attributes.size() )
@@ -204,6 +232,12 @@ bool QgsFeature::setAttribute( int idx, const QVariant &value )
204232
return true;
205233
}
206234

235+
/***************************************************************************
236+
* This class is considered CRITICAL and any change MUST be accompanied with
237+
* full unit tests in testqgsfeature.cpp.
238+
* See details in QEP #17
239+
****************************************************************************/
240+
207241
bool QgsFeature::setAttribute( const QString& name, const QVariant& value )
208242
{
209243
int fieldIdx = fieldNameIndex( name );
@@ -234,7 +268,6 @@ QVariant QgsFeature::attribute( int fieldIdx ) const
234268
return d->attributes.at( fieldIdx );
235269
}
236270

237-
238271
QVariant QgsFeature::attribute( const QString& name ) const
239272
{
240273
int fieldIdx = fieldNameIndex( name );
@@ -244,6 +277,12 @@ QVariant QgsFeature::attribute( const QString& name ) const
244277
return d->attributes.at( fieldIdx );
245278
}
246279

280+
/***************************************************************************
281+
* This class is considered CRITICAL and any change MUST be accompanied with
282+
* full unit tests in testqgsfeature.cpp.
283+
* See details in QEP #17
284+
****************************************************************************/
285+
247286
int QgsFeature::fieldNameIndex( const QString& fieldName ) const
248287
{
249288
return d->fields.fieldNameIndex( fieldName );

src/core/qgsfeature.h

+11
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ typedef int QgsFeatureId;
103103
// key = field index, value = field value
104104
typedef QMap<int, QVariant> QgsAttributeMap;
105105

106+
/***************************************************************************
107+
* This class is considered CRITICAL and any change MUST be accompanied with
108+
* full unit tests in testqgsfeature.cpp.
109+
* See details in QEP #17
110+
****************************************************************************/
111+
106112
/**
107113
* A vector of attributes. Mostly equal to QVector<QVariant>.
108114
*/
@@ -166,6 +172,11 @@ class QgsField;
166172

167173
#include "qgsfield.h"
168174

175+
/***************************************************************************
176+
* This class is considered CRITICAL and any change MUST be accompanied with
177+
* full unit tests in testqgsfeature.cpp.
178+
* See details in QEP #17
179+
****************************************************************************/
169180

170181
/** \ingroup core
171182
* The feature class encapsulates a single feature including its id,

src/core/qgsfeature_p.h

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ email : nyall dot dawson at gmail dot com
2727
// version without notice, or even be removed.
2828
//
2929

30+
/***************************************************************************
31+
* This class is considered CRITICAL and any change MUST be accompanied with
32+
* full unit tests in testqgsfeature.cpp.
33+
* See details in QEP #17
34+
****************************************************************************/
35+
3036
#include "qgsfield.h"
3137

3238
#include "qgsgeometry.h"

src/core/qgsfield.cpp

+71-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
#include <QDataStream>
2323
#include <QtCore/qmath.h>
2424

25+
/***************************************************************************
26+
* This class is considered CRITICAL and any change MUST be accompanied with
27+
* full unit tests in testqgsfield.cpp.
28+
* See details in QEP #17
29+
****************************************************************************/
2530

2631
#if 0
2732
QgsField::QgsField( QString nam, QString typ, int len, int prec, bool num,
@@ -48,13 +53,18 @@ QgsField::QgsField( const QgsField &other )
4853

4954
}
5055

56+
/***************************************************************************
57+
* This class is considered CRITICAL and any change MUST be accompanied with
58+
* full unit tests in testqgsfield.cpp.
59+
* See details in QEP #17
60+
****************************************************************************/
61+
5162
QgsField &QgsField::operator =( const QgsField & other )
5263
{
5364
d = other.d;
5465
return *this;
5566
}
5667

57-
5868
QgsField::~QgsField()
5969
{
6070
}
@@ -99,6 +109,12 @@ QString QgsField::comment() const
99109
return d->comment;
100110
}
101111

112+
/***************************************************************************
113+
* This class is considered CRITICAL and any change MUST be accompanied with
114+
* full unit tests in testqgsfield.cpp.
115+
* See details in QEP #17
116+
****************************************************************************/
117+
102118
void QgsField::setName( const QString& name )
103119
{
104120
d->name = name;
@@ -128,6 +144,12 @@ void QgsField::setComment( const QString& comment )
128144
d->comment = comment;
129145
}
130146

147+
/***************************************************************************
148+
* This class is considered CRITICAL and any change MUST be accompanied with
149+
* full unit tests in testqgsfield.cpp.
150+
* See details in QEP #17
151+
****************************************************************************/
152+
131153
QString QgsField::displayString( const QVariant& v ) const
132154
{
133155
if ( v.isNull() )
@@ -142,6 +164,12 @@ QString QgsField::displayString( const QVariant& v ) const
142164
return v.toString();
143165
}
144166

167+
/***************************************************************************
168+
* This class is considered CRITICAL and any change MUST be accompanied with
169+
* full unit tests in testqgsfield.cpp.
170+
* See details in QEP #17
171+
****************************************************************************/
172+
145173
bool QgsField::convertCompatible( QVariant& v ) const
146174
{
147175
if ( v.isNull() )
@@ -203,6 +231,11 @@ bool QgsField::convertCompatible( QVariant& v ) const
203231
return true;
204232
}
205233

234+
/***************************************************************************
235+
* This class is considered CRITICAL and any change MUST be accompanied with
236+
* full unit tests in testqgsfield.cpp.
237+
* See details in QEP #17
238+
****************************************************************************/
206239

207240
QDataStream& operator<<( QDataStream& out, const QgsField& field )
208241
{
@@ -231,6 +264,13 @@ QDataStream& operator>>( QDataStream& in, QgsField& field )
231264

232265
////////////////////////////////////////////////////////////////////////////
233266

267+
268+
/***************************************************************************
269+
* This class is considered CRITICAL and any change MUST be accompanied with
270+
* full unit tests in testqgsfields.cpp.
271+
* See details in QEP #17
272+
****************************************************************************/
273+
234274
QgsFields::QgsFields()
235275
{
236276
d = new QgsFieldsPrivate( );
@@ -258,6 +298,12 @@ void QgsFields::clear()
258298
d->nameToIndex.clear();
259299
}
260300

301+
/***************************************************************************
302+
* This class is considered CRITICAL and any change MUST be accompanied with
303+
* full unit tests in testqgsfields.cpp.
304+
* See details in QEP #17
305+
****************************************************************************/
306+
261307
bool QgsFields::append( const QgsField& field, FieldOrigin origin, int originIndex )
262308
{
263309
if ( d->nameToIndex.contains( field.name() ) )
@@ -303,6 +349,12 @@ void QgsFields::extend( const QgsFields& other )
303349
}
304350
}
305351

352+
/***************************************************************************
353+
* This class is considered CRITICAL and any change MUST be accompanied with
354+
* full unit tests in testqgsfields.cpp.
355+
* See details in QEP #17
356+
****************************************************************************/
357+
306358
bool QgsFields::isEmpty() const
307359
{
308360
return d->fields.isEmpty();
@@ -343,6 +395,12 @@ const QgsField &QgsFields::field( const QString &name ) const
343395
return d->fields[ indexFromName( name )].field;
344396
}
345397

398+
/***************************************************************************
399+
* This class is considered CRITICAL and any change MUST be accompanied with
400+
* full unit tests in testqgsfields.cpp.
401+
* See details in QEP #17
402+
****************************************************************************/
403+
346404
const QgsField &QgsFields::operator[]( int i ) const
347405
{
348406
return d->fields[i].field;
@@ -379,6 +437,12 @@ bool QgsFields::operator==( const QgsFields &other ) const
379437
return d->fields == other.d->fields;
380438
}
381439

440+
/***************************************************************************
441+
* This class is considered CRITICAL and any change MUST be accompanied with
442+
* full unit tests in testqgsfields.cpp.
443+
* See details in QEP #17
444+
****************************************************************************/
445+
382446
int QgsFields::fieldNameIndex( const QString& fieldName ) const
383447
{
384448
for ( int idx = 0; idx < count(); ++idx )
@@ -404,6 +468,12 @@ QgsAttributeList QgsFields::allAttributesList() const
404468
return lst;
405469
}
406470

471+
/***************************************************************************
472+
* This class is considered CRITICAL and any change MUST be accompanied with
473+
* full unit tests in testqgsfields.cpp.
474+
* See details in QEP #17
475+
****************************************************************************/
476+
407477
QDataStream& operator<<( QDataStream& out, const QgsFields& fields )
408478
{
409479
out << ( quint32 )fields.size();

0 commit comments

Comments
 (0)