Skip to content
Permalink
Browse files

Fix sip build

  • Loading branch information
nyalldawson committed Nov 9, 2020
1 parent 00b9da6 commit 8d54dc8f9a70f3e8a63918fcb86f2f22c812cc5c
@@ -46,7 +46,7 @@ Ctor
Returns name of the attribute
%End

size_t size() const;
int size() const;
%Docstring
Returns size of the attribute in bytes
%End
@@ -133,7 +133,7 @@ Returns the index of the attribute with the specified ``name``.
Returns -1 if a matching attribute was not found.
%End

size_t pointRecordSize() const;
int pointRecordSize() const;
%Docstring
Returns total size of record
%End
@@ -53,7 +53,7 @@ class CORE_EXPORT QgsPointCloudAttribute
QString name() const { return mName; }

//! Returns size of the attribute in bytes
size_t size() const { return mSize; }
int size() const { return mSize; }

//! Returns the data type
DataType type() const { return mType; }
@@ -84,7 +84,7 @@ class CORE_EXPORT QgsPointCloudAttribute
void updateSize();

QString mName;
size_t mSize = 0;
int mSize = 0;
DataType mType;
};

@@ -133,17 +133,17 @@ class CORE_EXPORT QgsPointCloudAttributeCollection
int indexOf( const QString &name ) const;

//! Returns total size of record
size_t pointRecordSize() const { return mSize; }
int pointRecordSize() const { return mSize; }

private:
std::size_t mSize = 0;
int mSize = 0;
QVector<QgsPointCloudAttribute> mAttributes;

struct CachedAttributeData
{
int index;
std::size_t offset;
CachedAttributeData( int index, std::size_t offset )
int offset;
CachedAttributeData( int index, int offset )
: index( index )
, offset( offset )
{}
@@ -79,7 +79,7 @@ void TestQgsPointCloudAttribute::testAttribute()
QgsPointCloudAttribute attribute( QStringLiteral( "name" ), QgsPointCloudAttribute::DataType::Float );
QCOMPARE( attribute.name(), QStringLiteral( "name" ) );
QCOMPARE( attribute.type(), QgsPointCloudAttribute::DataType::Float );
QCOMPARE( attribute.size(), static_cast< std::size_t >( 4 ) );
QCOMPARE( attribute.size(), 4 );
}

void TestQgsPointCloudAttribute::testAttributeDisplayType()
@@ -106,7 +106,7 @@ void TestQgsPointCloudAttribute::testCollection()
QgsPointCloudAttributeCollection collection;
QVERIFY( collection.attributes().empty() );
QCOMPARE( collection.count(), 0 );
QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 0 ) );
QCOMPARE( collection.pointRecordSize(), 0 );
int offset = 0;
QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) );

@@ -115,7 +115,7 @@ void TestQgsPointCloudAttribute::testCollection()
QCOMPARE( collection.count(), 1 );
QCOMPARE( collection.at( 0 ).name(), QStringLiteral( "at1" ) );
QCOMPARE( collection.attributes().at( 0 ).name(), QStringLiteral( "at1" ) );
QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 4 ) );
QCOMPARE( collection.pointRecordSize(), 4 );
QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) );
QCOMPARE( collection.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) );
QCOMPARE( collection.indexOf( QStringLiteral( "test" ) ), -1 );
@@ -129,7 +129,7 @@ void TestQgsPointCloudAttribute::testCollection()
QCOMPARE( collection.at( 1 ).name(), QStringLiteral( "at2" ) );
QCOMPARE( collection.attributes().at( 0 ).name(), QStringLiteral( "at1" ) );
QCOMPARE( collection.attributes().at( 1 ).name(), QStringLiteral( "at2" ) );
QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 6 ) );
QCOMPARE( collection.pointRecordSize(), 6 );
QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) );
QCOMPARE( collection.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) );
QCOMPARE( offset, 0 );
@@ -145,7 +145,7 @@ void TestQgsPointCloudAttribute::testCollection()
QCOMPARE( collection.attributes().at( 0 ).name(), QStringLiteral( "at1" ) );
QCOMPARE( collection.attributes().at( 1 ).name(), QStringLiteral( "at2" ) );
QCOMPARE( collection.attributes().at( 2 ).name(), QStringLiteral( "at3" ) );
QCOMPARE( collection.pointRecordSize(), static_cast< std::size_t >( 14 ) );
QCOMPARE( collection.pointRecordSize(), 14 );
QVERIFY( !collection.find( QStringLiteral( "test" ), offset ) );
QCOMPARE( collection.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) );
QCOMPARE( offset, 0 );
@@ -164,7 +164,7 @@ void TestQgsPointCloudAttribute::testCollection()
QCOMPARE( collection2.attributes().at( 0 ).name(), QStringLiteral( "at1" ) );
QCOMPARE( collection2.attributes().at( 1 ).name(), QStringLiteral( "at2" ) );
QCOMPARE( collection2.attributes().at( 2 ).name(), QStringLiteral( "at3" ) );
QCOMPARE( collection2.pointRecordSize(), static_cast< std::size_t >( 14 ) );
QCOMPARE( collection2.pointRecordSize(), 14 );
QVERIFY( !collection2.find( QStringLiteral( "test" ), offset ) );
QCOMPARE( collection2.find( QStringLiteral( "at1" ), offset )->name(), QStringLiteral( "at1" ) );
QCOMPARE( offset, 0 );

0 comments on commit 8d54dc8

Please sign in to comment.
You can’t perform that action at this time.