From 131b3e5dcad979c039ec79789da3ac06cffed16c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 7 Aug 2013 17:24:50 -0700 Subject: QStandardPaths: add a test that just dumps the values Change-Id: I79bcc1974988b3d712a40e89a3ec4aeb7be1fb5e Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> --- .../io/qstandardpaths/tst_qstandardpaths.cpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests/auto') 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 -- cgit v1.2.3