Skip to content

Commit

Permalink
register meta type
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 25, 2025
1 parent baf84aa commit d8027ab
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions tests/src/app/testqgsapplocatorfilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@
#include <QClipboard>


struct Result
{
Result( QString displayString, const QgsPointXY &point, double scale = 0 )
: displayString( displayString )
, point( point )
, scale( scale )
{}

QString displayString;
QgsPointXY point;
double scale = 0;
};

typedef QList<Result> Results;

Q_DECLARE_METATYPE( Results )

/**
* \ingroup UnitTests
* This is a unit test for the field calculator
Expand All @@ -42,21 +59,6 @@ class TestQgsAppLocatorFilters : public QObject
Q_OBJECT

public:
struct Result
{
Result( QString displayString, const QgsPointXY &point, double scale = 0 )
: displayString( displayString )
, point( point )
, scale( scale )
{}

QString displayString;
QgsPointXY point;
double scale = 0;
};

typedef QList<Result> Results;

private slots:
void initTestCase(); // will be called before the first testfunction is executed.
void cleanupTestCase(); // will be called after the last testfunction was executed.
Expand Down Expand Up @@ -376,6 +378,8 @@ QList<QgsLocatorResult> TestQgsAppLocatorFilters::gatherResults( QgsLocatorFilte

void TestQgsAppLocatorFilters::testGoto_data()
{
qRegisterMetaType<Results>( "Results" );

QTest::addColumn<QString>( "string" );
QTest::addColumn<Results>( "expected" );

Expand Down

0 comments on commit d8027ab

Please sign in to comment.