Browse Source

TgaImporter: test for opening inexistent files.

pull/34/head
Vladimír Vondruš 14 years ago
parent
commit
eab9b13250
  1. 9
      src/Plugins/TgaImporter/Test/TgaImporterTest.cpp
  2. 1
      src/Plugins/TgaImporter/Test/TgaImporterTest.h

9
src/Plugins/TgaImporter/Test/TgaImporterTest.cpp

@ -27,6 +27,15 @@ QTEST_APPLESS_MAIN(Magnum::Trade::TgaImporter::Test::TgaImporterTest)
namespace Magnum { namespace Trade { namespace TgaImporter { namespace Test {
void TgaImporterTest::openInexistent() {
ostringstream debug;
Error::setOutput(&debug);
TgaImporter importer;
QVERIFY(!importer.open("inexistent.file"));
QCOMPARE(debug.str().c_str(), "TgaImporter: cannot open file inexistent.file\n");
}
void TgaImporterTest::paletted() {
const char data[] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
istringstream in(string(data, sizeof(data)));

1
src/Plugins/TgaImporter/Test/TgaImporterTest.h

@ -23,6 +23,7 @@ class TgaImporterTest: public QObject {
Q_OBJECT
private slots:
void openInexistent();
void paletted();
void nonRgb();
void bits16();

Loading…
Cancel
Save