|
|
|
@ -41,6 +41,8 @@ struct AnyImageConverterTest: TestSuite::Tester { |
|
|
|
|
|
|
|
|
|
|
|
void tga(); |
|
|
|
void tga(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void uppercase(); |
|
|
|
|
|
|
|
|
|
|
|
void unknown(); |
|
|
|
void unknown(); |
|
|
|
|
|
|
|
|
|
|
|
/* Explicitly forbid system-wide plugin dependencies */ |
|
|
|
/* Explicitly forbid system-wide plugin dependencies */ |
|
|
|
@ -49,7 +51,7 @@ struct AnyImageConverterTest: TestSuite::Tester { |
|
|
|
|
|
|
|
|
|
|
|
AnyImageConverterTest::AnyImageConverterTest() { |
|
|
|
AnyImageConverterTest::AnyImageConverterTest() { |
|
|
|
addTests({&AnyImageConverterTest::tga, |
|
|
|
addTests({&AnyImageConverterTest::tga, |
|
|
|
|
|
|
|
&AnyImageConverterTest::uppercase, |
|
|
|
&AnyImageConverterTest::unknown}); |
|
|
|
&AnyImageConverterTest::unknown}); |
|
|
|
|
|
|
|
|
|
|
|
/* Load the plugin directly from the build tree. Otherwise it's static and
|
|
|
|
/* Load the plugin directly from the build tree. Otherwise it's static and
|
|
|
|
@ -89,6 +91,21 @@ void AnyImageConverterTest::tga() { |
|
|
|
CORRADE_VERIFY(Utility::Directory::fileExists(filename)); |
|
|
|
CORRADE_VERIFY(Utility::Directory::fileExists(filename)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AnyImageConverterTest::uppercase() { |
|
|
|
|
|
|
|
if(!(_manager.loadState("TgaImageConverter") & PluginManager::LoadState::Loaded)) |
|
|
|
|
|
|
|
CORRADE_SKIP("TgaImageConverter plugin not enabled, cannot test"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const std::string filename = Utility::Directory::join(ANYIMAGECONVERTER_TEST_DIR, "output.TGA"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Utility::Directory::fileExists(filename)) |
|
|
|
|
|
|
|
CORRADE_VERIFY(Utility::Directory::rm(filename)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Just test that the exported file exists */ |
|
|
|
|
|
|
|
Containers::Pointer<AbstractImageConverter> converter = _manager.instantiate("AnyImageConverter"); |
|
|
|
|
|
|
|
CORRADE_VERIFY(converter->exportToFile(Image, filename)); |
|
|
|
|
|
|
|
CORRADE_VERIFY(Utility::Directory::fileExists(filename)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void AnyImageConverterTest::unknown() { |
|
|
|
void AnyImageConverterTest::unknown() { |
|
|
|
std::ostringstream output; |
|
|
|
std::ostringstream output; |
|
|
|
Error redirectError{&output}; |
|
|
|
Error redirectError{&output}; |
|
|
|
|