on xenial help sign in
Making the test class a friend so that we can make the functions protected
commite0a1f8a0ece7748b6c22347f1f5918d53bf5aaf9 authorTed Gould <ted@gould.cx> dateTue 29 Apr 2014, 14:22 (12 years ago) parent267a16b
1 file changed+3−3
plugins/Unity/Launcher/backend/launcherbackend.h+3−3
plugins/Unity/Launcher/backend/launcherbackend.h+3−3
@@ -33,11 +33,13 @@ class AccountsServiceDBusAdaptor;
3333 */
3434
3535class LauncherBackendItem;
36+class LauncherBackendTest;
3637
3738class LauncherBackend : public QDBusVirtualObject
3839{
3940 Q_OBJECT
4041
42+ friend LauncherBackendTest;
4143
4244public:
4345 LauncherBackend(QObject *parent = 0);
@@ -184,9 +186,7 @@ private:
184186
185187 void emitPropChangedDbus(const QString& appId, const QString& property, QVariant &value) const;
186188
187−#ifdef LAUNCHER_TESTING
188−public: /* Only public to make them easier to test independently */
189−#endif
189+protected: /* Protected to allow testing */
190190 LauncherBackendItem* getItem(const QString& appId) const;
191191
192192 static QString decodeAppId(const QString& path);