Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ba7cfb
commit 35bac3e
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/*************************************************************************** | ||
test_qgsserver_wms_parameters.cpp | ||
--------------------------------- | ||
Date : 02 Sept 2020 | ||
Copyright : (C) 2020 by Paul Blottiere | ||
Email : paul dot blottiere @ gmail.com | ||
*************************************************************************** | ||
* * | ||
* 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 "qgstest.h" | ||
#include "qgswmsrequest.h" | ||
|
||
/** | ||
* \ingroup UnitTests | ||
* This is a unit test for the WMS parameters class | ||
*/ | ||
class TestQgsServerWmsRequest : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
void initTestCase(); | ||
void cleanupTestCase(); | ||
|
||
void cst(); | ||
}; | ||
|
||
void TestQgsServerWmsRequest::initTestCase() | ||
{ | ||
QgsApplication::init(); | ||
QgsApplication::initQgis(); | ||
} | ||
|
||
void TestQgsServerWmsRequest::cleanupTestCase() | ||
{ | ||
QgsApplication::exitQgis(); | ||
} | ||
|
||
void TestQgsServerWmsRequest::cst() | ||
{ | ||
QgsServerRequest request; | ||
request.setParameter( "VERSION", "1.0.0" ); | ||
|
||
// the base class for parameters provides raw values... | ||
QCOMPARE( request.serverParameters().version(), "1.0.0" ); | ||
|
||
// ...whereas the wms parameters class interprets values to be valid in the | ||
// WMS context | ||
QgsWms::QgsWmsRequest wmsRequest( request ); | ||
QCOMPARE( wmsRequest.wmsParameters().version(), "1.1.1" ); | ||
} | ||
|
||
QGSTEST_MAIN( TestQgsServerWmsRequest ) | ||
#include "test_qgsserver_wms_request.moc" |