Skip to content

Commit

Permalink
Move tests expected images to res directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 21, 2024
1 parent 8b51854 commit 86507e7
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tests/ProgressBarCounterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void ProgressBarCounterTest::checkInitialPaint()
{
ProgressBarCounter progressBar(QLatin1String("Initial"), max_);
auto actual{progressBar.grab().toImage()};
QImage expected(":/counterInitial.png");
QImage expected(":/res/counterInitial.png");
expected = expected.convertToFormat(actual.format());
QCOMPARE(actual, expected);
}
Expand All @@ -52,7 +52,7 @@ void ProgressBarCounterTest::checkPaintAfterUpdate()
ProgressBarCounter progressBar(QLatin1String("Updated"), max_);
progressBar.updateProgress(10);
auto actual{progressBar.grab().toImage()};
QImage expected(":/counterUpdated.png");
QImage expected(":/res/counterUpdated.png");
expected = expected.convertToFormat(actual.format());
QCOMPARE(actual, expected);
}
Expand All @@ -62,7 +62,7 @@ void ProgressBarCounterTest::checkPaintFinished()
ProgressBarCounter progressBar(QLatin1String("Finished"), max_);
progressBar.updateProgress(100);
auto actual{progressBar.grab().toImage()};
QImage expected(":/counterFinished.png");
QImage expected(":/res/counterFinished.png");
expected = expected.convertToFormat(actual.format());
QCOMPARE(actual, expected);
}
4 changes: 2 additions & 2 deletions tests/ProgressBarInfiniteTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void ProgressBarInfiniteTest::checkInitialPaint()
{
ProgressBarInfinite progressBar(QLatin1String("Initial"));
auto actual{progressBar.grab().toImage()};
QImage expected(":/infinityInitial.png");
QImage expected(":/res/infinityInitial.png");
expected = expected.convertToFormat(actual.format());
QCOMPARE(actual, expected);
}
Expand All @@ -40,7 +40,7 @@ void ProgressBarInfiniteTest::checkPaintAfterUpdate()
QApplication::sendEvent(&progressBar, &event);

auto actual{progressBar.grab().toImage()};
QImage expected(":/infinityUpdated.png");
QImage expected(":/res/infinityUpdated.png");
expected = expected.convertToFormat(actual.format());
QCOMPARE(actual, expected);
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
10 changes: 5 additions & 5 deletions tests/testResources.qrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<RCC>
<qresource prefix="/">
<file>infinityInitial.png</file>
<file>infinityUpdated.png</file>
<file>counterInitial.png</file>
<file>counterUpdated.png</file>
<file>counterFinished.png</file>
<file>res/infinityInitial.png</file>
<file>res/infinityUpdated.png</file>
<file>res/counterInitial.png</file>
<file>res/counterUpdated.png</file>
<file>res/counterFinished.png</file>
</qresource>
</RCC>

0 comments on commit 86507e7

Please sign in to comment.