Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[nemo-transfer-engine] Added tests.xml and updated unit tests to foll…
…ow the documentation.
  • Loading branch information
Marko Mattila committed Apr 10, 2013
1 parent 6a7fee1 commit 72ad836
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
File renamed without changes
10 changes: 7 additions & 3 deletions tests/tests.pro
@@ -1,4 +1,5 @@
TEMPLATE = app
TARGET = ut_nemo-transfer-engine
DEPENDPATH += .
INCLUDEPATH += . ../src ../lib

Expand Down Expand Up @@ -30,8 +31,11 @@ LIBS += -lquillmetadata
QT += testlib

PATH = /opt/tests/nemo-transfer-engine
resources.files = testimage.jpg
resources.path = $$PATH

test_def.files = tests.xml
test_def.path = $$PATH
resources.files = images/testimage.jpg
resources.path = $$PATH/images
target.path = $$PATH

INSTALLS += target resources
INSTALLS += target resources test_def
12 changes: 12 additions & 0 deletions tests/tests.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<testdefinition version="1.0">
<suite name="NemoTransferEngine" domain="middleware">
<description>Nemo Transfer Engine automatic tests</description>
<set name="unit-tests" feature="Internal UI Components">
<description>Nemo Transfer Engine unit tests</description>
<case manual="false" name="enginetests">
<step>/opt/tests/nemo-transfer-engine/ut_nemo-transfer-engine</step>
</case>
</set>
</suite>
</testdefinition>
10 changes: 5 additions & 5 deletions tests/ut_imageoperation.cpp
Expand Up @@ -95,10 +95,10 @@ void ut_imageoperation::testUniqueFilePath()
void ut_imageoperation::testScale()
{

QImage img("testimage.jpg");
QImage img("images/testimage.jpg");
QVERIFY(!img.isNull());

QString filePath("testimage.jpg");
QString filePath("images/testimage.jpg");

QString target = ImageOperation::uniqueFilePath(filePath);

Expand Down Expand Up @@ -136,8 +136,8 @@ void ut_imageoperation::testDropMetadata()
// title description, but it contains the most essential fields related
// to location and the author.
// First make sure that there is metadata
QCOMPARE(QuillMetadata::canRead("testimage.jpg"), true);
QuillMetadata md("testimage.jpg");
QCOMPARE(QuillMetadata::canRead("images/testimage.jpg"), true);
QuillMetadata md("images/testimage.jpg");
QCOMPARE(md.isValid(), true);

QVariant creator = md.entry(QuillMetadata::Tag_Creator);
Expand All @@ -155,7 +155,7 @@ void ut_imageoperation::testDropMetadata()
QCOMPARE(lat.isNull(), false);
QCOMPARE(lon.isNull(), false);

QString path = ImageOperation::removeImageMetadata("testimage.jpg");
QString path = ImageOperation::removeImageMetadata("images/testimage.jpg");
QVERIFY(!path.isNull());
QCOMPARE(QFile::exists(path), true);

Expand Down

0 comments on commit 72ad836

Please sign in to comment.