Finish unit tests for the DownloadUpdateTask class

This commit is contained in:
Jan Dalheimer
2013-12-15 18:50:56 +01:00
parent 3e8bcc1cf6
commit 7f884a18a8
3 changed files with 109 additions and 35 deletions

View File

@ -54,13 +54,11 @@ public:
QString url;
QString compressionType;
};
typedef QList<FileSource> FileSourceList;
/*!
* Structure that describes an entry in a GoUpdate version's `Files` list.
*/
struct VersionFileEntry
{
QString path;
@ -68,12 +66,8 @@ public:
FileSourceList sources;
QString md5;
};
typedef QList<VersionFileEntry> VersionFileList;
protected:
friend class DownloadUpdateTaskTest;
/*!
* Structure that describes an operation to perform when installing updates.
*/
@ -104,9 +98,12 @@ protected:
// Yeah yeah, polymorphism blah blah inheritance, blah blah object oriented. I'm lazy, OK?
};
typedef QList<UpdateOperation> UpdateOperationList;
protected:
friend class DownloadUpdateTaskTest;
/*!
* Used for arguments to parseVersionInfo and friends to specify which version info file to parse.
*/
@ -159,6 +156,12 @@ protected:
* Takes a list of file entries for the current version's files and the new version's files
* and populates the downloadList and operationList with information about how to download and install the update.
*/
virtual void processFileLists(NetJob *job, const VersionFileList &currentVersion, const VersionFileList &newVersion, UpdateOperationList &ops);
/*!
* Calls \see processFileLists to populate the \see m_operationList and a NetJob, and then executes
* the NetJob to fetch all needed files
*/
virtual void processFileLists();
/*!
@ -166,7 +169,6 @@ protected:
*/
virtual bool writeInstallScript(UpdateOperationList& opsList, QString scriptFile);
VersionFileList m_downloadList;
UpdateOperationList m_operationList;
VersionFileList m_nVersionFileList;