-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
60b308e
commit c5817cb
Showing
2 changed files
with
65 additions
and
1 deletion.
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,57 @@ | ||
/*************************************************************************** | ||
test_qgsserver_wms_exceptions.cpp | ||
--------------------------------- | ||
Date : 27 Mar 2019 | ||
Copyright : (C) 2019 by Paul Blottiere | ||
Email : paul dot blottiere @ oslandia.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 "qgswmsserviceexception.h" | ||
|
||
/** | ||
* \ingroup UnitTests | ||
* This is a unit test for the WMS Exceptions | ||
*/ | ||
class TestQgsServerWmsExceptions : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
void initTestCase(); | ||
void cleanupTestCase(); | ||
|
||
void exception_code(); | ||
}; | ||
|
||
void TestQgsServerWmsExceptions::initTestCase() | ||
{ | ||
QgsApplication::init(); | ||
QgsApplication::initQgis(); | ||
} | ||
|
||
void TestQgsServerWmsExceptions::cleanupTestCase() | ||
{ | ||
QgsApplication::exitQgis(); | ||
} | ||
|
||
void TestQgsServerWmsExceptions::exception_code() | ||
{ | ||
QgsWms::QgsServiceException::ExceptionCode code = QgsWms::QgsServiceException::OGC_INVALID_FORMAT; | ||
QgsWms::QgsServiceException exception0( code, QString(), 400 ); | ||
QCOMPARE( exception0.code(), QString( "InvalidFormat" ) ); | ||
|
||
code = QgsWms::QgsServiceException::QGIS_ERROR; | ||
QgsWms::QgsServiceException exception1( code, QString(), 400 ); | ||
QCOMPARE( exception1.code(), QString( "Error" ) ); | ||
} | ||
|
||
QGSTEST_MAIN( TestQgsServerWmsExceptions ) | ||
#include "test_qgsserver_wms_exceptions.moc" |