diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-08-07 17:24:50 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-14 03:20:25 +0200 |
commit | 131b3e5dcad979c039ec79789da3ac06cffed16c (patch) | |
tree | 86e52564ed35cf4fedf5ed2fbe476f11e2b06bf8 /tests | |
parent | 415f65fbff0ebbdeab09bbed8c06872352e3f5ca (diff) |
QStandardPaths: add a test that just dumps the values
Change-Id: I79bcc1974988b3d712a40e89a3ec4aeb7be1fb5e
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 501dde1ba5..b63dbc449c 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -56,11 +56,14 @@ #define Q_XDG_PLATFORM #endif +const int MaxStandardLocation = QStandardPaths::GenericCacheLocation; + class tst_qstandardpaths : public QObject { Q_OBJECT private slots: + void dump(); void testDefaultLocations(); void testCustomLocations(); void enableTestMode(); @@ -108,6 +111,39 @@ private: QTemporaryDir m_globalAppTempDir; }; +static const char * const enumNames[MaxStandardLocation + 1 - int(QStandardPaths::DesktopLocation)] = { + "DesktopLocation", + "DocumentsLocation", + "FontsLocation", + "ApplicationsLocation", + "MusicLocation", + "MoviesLocation", + "PicturesLocation", + "TempLocation", + "HomeLocation", + "DataLocation", + "CacheLocation", + "GenericDataLocation", + "RuntimeLocation", + "ConfigLocation", + "DownloadLocation", + "GenericCacheLocation" +}; + +void tst_qstandardpaths::dump() +{ +#ifdef Q_XDG_PLATFORM + setDefaultLocations(); +#endif + // This is not a test. It merely dumps the output. + for (int i = QStandardPaths::DesktopLocation; i <= MaxStandardLocation; ++i) { + QStandardPaths::StandardLocation s = QStandardPaths::StandardLocation(i); + qDebug() << enumNames[i] + << QStandardPaths::writableLocation(s) + << QStandardPaths::standardLocations(s); + } +} + void tst_qstandardpaths::testDefaultLocations() { #ifdef Q_XDG_PLATFORM |