~ubuntu-branches/ubuntu/saucy/ubuntu-download-manager/saucy-proposed

« back to all changes in this revision

Viewing changes to ubuntu-download-manager-tests/test_group_download.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Manuel de la Pena, Ubuntu daily release
  • Date: 2013-09-28 21:33:00 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20130928213300-170s47wsz3grt2m3
Tags: 0.2+13.10.20130928.2-0ubuntu1
[ Manuel de la Pena ]
* Add BaseTestCase that removes the qDebug output so that we have a
  cleaner tests results output. (LP: #1230210)
* Allow the hash method to be empty. (LP: #1232050)
* Use syslog when running as a system bus service rather than logging
  to a file. (LP: #1230236)
* Remove the XDG implementation and use the standard paths class found
  in qt. (LP: #1226998)
* Keep track of the replies so that when the daemon is stoppable we
  clear the cache. (LP: #1229463)

[ Ubuntu daily release ]
* Automatic snapshot from revision 144

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "./test_group_download.h"
23
23
 
24
24
TestGroupDownload::TestGroupDownload(QObject *parent)
25
 
    : QObject(parent) {
 
25
    : BaseTestCase("TestGroupDownload", parent) {
26
26
}
27
27
 
28
28
void
29
29
TestGroupDownload::init() {
 
30
    BaseTestCase::init();
30
31
    _id = QUuid::createUuid();
31
32
    _path = "/group/dbus/path";
32
33
    _isConfined = true;
48
49
 
49
50
void
50
51
TestGroupDownload::cleanup() {
 
52
    BaseTestCase::cleanup();
 
53
 
51
54
    if (_networkInfo != NULL)
52
55
        delete _networkInfo;
53
56
    if (_nam != NULL)
806
809
TestGroupDownload::testInvalidHashAlgorithm() {
807
810
    QList<GroupDownloadStruct> downloadsStruct;
808
811
    downloadsStruct.append(GroupDownloadStruct("http://one.ubuntu.com",
809
 
        "local_file", ""));
 
812
        "local_file", "asasas"));
810
813
    downloadsStruct.append(GroupDownloadStruct("http://ubuntu.com",
811
 
        "other_local_file", ""));
 
814
        "other_local_file", "sasas"));
812
815
    downloadsStruct.append(GroupDownloadStruct("http://reddit.com",
813
 
        "other_reddit_local_file", ""));
 
816
        "other_reddit_local_file", "sasaas"));
814
817
 
815
818
    GroupDownload* group = new GroupDownload(_id, _path, false, _rootPath,
816
819
        downloadsStruct, "wrong", _isGSMDownloadAllowed, _metadata, _headers,
831
834
    QTest::newRow("sha256") << "sha256";
832
835
    QTest::newRow("sha384") << "sha384";
833
836
    QTest::newRow("sha512") << "sha512";
 
837
    QTest::newRow("Empty string") << "";
834
838
}
835
839
 
836
840
void
838
842
    QFETCH(QString, algo);
839
843
    QList<GroupDownloadStruct> downloadsStruct;
840
844
    downloadsStruct.append(GroupDownloadStruct("http://one.ubuntu.com",
841
 
        "local_file", ""));
 
845
        "local_file", "asasas"));
842
846
    downloadsStruct.append(GroupDownloadStruct("http://ubuntu.com",
843
 
        "other_local_file", ""));
 
847
        "other_local_file", "asasas"));
844
848
    downloadsStruct.append(GroupDownloadStruct("http://reddit.com",
845
 
        "other_reddit_local_file", ""));
 
849
        "other_reddit_local_file", "sasa"));
846
850
 
847
851
    GroupDownload* group = new GroupDownload(_id, _path, false, _rootPath,
848
852
        downloadsStruct, algo, _isGSMDownloadAllowed, _metadata, _headers,