~elopio/gallery-app/revert_workaround-1302706-click_toolbar_button_failure

« back to all changes in this revision

Viewing changes to tests/unittests/resource/tst_resource.cpp

  • Committer: Leo Arias
  • Date: 2015-05-15 08:05:23 UTC
  • mfrom: (954.1.241 gallery-app)
  • Revision ID: leo.arias@canonical.com-20150515080523-i2of3vr8h7dioj59
Now the toolbar object is not needed at all.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    void picturesDirectory();
32
32
    void databaseDirectory();
33
33
    void thumbnailDirectory();
34
 
    void maxTextureSize();
35
34
};
36
35
 
37
36
void tst_Resource::picturesDirectory()
38
37
{
39
 
    Resource resource(false, "", 0);
 
38
    Resource resource(false, "");
40
39
    QCOMPARE(resource.mediaDirectories().size(), 2);
41
40
    QCOMPARE(resource.mediaDirectories().at(0), QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
42
41
 
43
42
    QString picDir("/tmp");
44
 
    Resource resource2(false, picDir, 0);
 
43
    Resource resource2(false, picDir);
45
44
    QCOMPARE(resource2.mediaDirectories().size(), 1);
46
45
    QCOMPARE(resource2.mediaDirectories().at(0), picDir);
47
46
}
48
47
 
49
48
void tst_Resource::databaseDirectory()
50
49
{
51
 
    Resource resource(false, "", 0);
 
50
    Resource resource(false, "");
52
51
    QString dbDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation) +
53
52
            QDir::separator() + Resource::DATABASE_DIR;
54
53
    QCOMPARE(resource.databaseDirectory(), dbDir);
55
54
 
56
55
    QString picDir("/tmp");
57
 
    Resource resource2(false, picDir, 0);
 
56
    Resource resource2(false, picDir);
58
57
    dbDir = picDir + "/." + Resource::DATABASE_DIR;
59
58
    QCOMPARE(resource2.databaseDirectory(), dbDir);
60
59
}
61
60
 
62
61
void tst_Resource::thumbnailDirectory()
63
62
{
64
 
    Resource resource(false, "", 0);
 
63
    Resource resource(false, "");
65
64
    QString dbDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) +
66
65
            QDir::separator() + Resource::THUMBNAIL_DIR;
67
66
    QCOMPARE(resource.thumbnailDirectory(), dbDir);
68
67
 
69
68
    QString picDir("/tmp");
70
 
    Resource resource2(false, picDir, 0);
 
69
    Resource resource2(false, picDir);
71
70
    dbDir = picDir + "/." + Resource::THUMBNAIL_DIR;
72
71
    QCOMPARE(resource2.thumbnailDirectory(), dbDir);
73
72
}
74
73
 
75
 
void tst_Resource::maxTextureSize()
76
 
{
77
 
    Resource resource(false, "", 0);
78
 
    QCOMPARE(resource.maxTextureSize(), 0);
79
 
}
80
 
 
81
74
QTEST_MAIN(tst_Resource);
82
75
 
83
76
#include "tst_resource.moc"