Browse Source

Any*{Importer,Converter}: less engrish in error messages.

catastrophic-cross
Vladimír Vondruš 6 years ago
parent
commit
5d9d529010
  1. 2
      src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp
  2. 6
      src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp
  3. 6
      src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp
  4. 9
      src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp
  5. 6
      src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp
  6. 10
      src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp
  7. 8
      src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp
  8. 6
      src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp
  9. 6
      src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

2
src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp

@ -311,7 +311,7 @@ void ScreenshotGLTest::saveFailed() {
MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(!succeeded);
CORRADE_COMPARE(out.str(), "Trade::AnyImageConverter::exportToFile(): cannot determine type of file image.poo\n");
CORRADE_COMPARE(out.str(), "Trade::AnyImageConverter::exportToFile(): cannot determine the format of image.poo\n");
}
}}}}

6
src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp

@ -51,7 +51,7 @@ void AnyImporter::doOpenFile(const std::string& filename) {
/** @todo lowercase only the extension, once Directory::split() is done */
const std::string normalized = Utility::String::lowercase(filename);
/* Detect type from extension */
/* Detect the plugin from extension */
std::string plugin;
if(Utility::String::endsWith(normalized, ".aac"))
plugin = "AacAudioImporter";
@ -64,13 +64,13 @@ void AnyImporter::doOpenFile(const std::string& filename) {
else if(Utility::String::endsWith(normalized, ".flac"))
plugin = "FlacAudioImporter";
else {
Error() << "Audio::AnyImporter::openFile(): cannot determine type of file" << filename;
Error{} << "Audio::AnyImporter::openFile(): cannot determine the format of" << filename;
return;
}
/* Try to load the plugin */
if(!(manager()->load(plugin) & PluginManager::LoadState::Loaded)) {
Error() << "Audio::AnyImporter::openFile(): cannot load" << plugin << "plugin";
Error{} << "Audio::AnyImporter::openFile(): cannot load the" << plugin << "plugin";
return;
}

6
src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp

@ -116,10 +116,10 @@ void AnyImporterTest::detect() {
/* Can't use raw string literals in macros on GCC 4.8 */
#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nAudio::AnyImporter::openFile(): cannot load {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nAudio::AnyImporter::openFile(): cannot load the {0} plugin\n", data.plugin));
#else
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} was not found\nAudio::AnyImporter::openFile(): cannot load {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} was not found\nAudio::AnyImporter::openFile(): cannot load the {0} plugin\n", data.plugin));
#endif
}
@ -130,7 +130,7 @@ void AnyImporterTest::unknown() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("AnyAudioImporter");
CORRADE_VERIFY(!importer->openFile("sound.mid"));
CORRADE_COMPARE(output.str(), "Audio::AnyImporter::openFile(): cannot determine type of file sound.mid\n");
CORRADE_COMPARE(output.str(), "Audio::AnyImporter::openFile(): cannot determine the format of sound.mid\n");
}
}}}}

9
src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp

@ -50,7 +50,7 @@ bool AnyImageConverter::doExportToFile(const ImageView2D& image, const std::stri
/** @todo lowercase only the extension, once Directory::split() is done */
const std::string normalized = Utility::String::lowercase(filename);
/* Detect type from extension */
/* Detect the plugin from extension */
std::string plugin;
if(Utility::String::endsWith(normalized, ".bmp"))
plugin = "BmpImageConverter";
@ -72,13 +72,13 @@ bool AnyImageConverter::doExportToFile(const ImageView2D& image, const std::stri
Utility::String::endsWith(normalized, ".vst"))
plugin = "TgaImageConverter";
else {
Error() << "Trade::AnyImageConverter::exportToFile(): cannot determine type of file" << filename;
Error{} << "Trade::AnyImageConverter::exportToFile(): cannot determine the format of" << filename;
return false;
}
/* Try to load the plugin */
if(!(manager()->load(plugin) & PluginManager::LoadState::Loaded)) {
Error() << "Trade::AnyImageConverter::exportToFile(): cannot load" << plugin << "plugin";
Error{} << "Trade::AnyImageConverter::exportToFile(): cannot load the" << plugin << "plugin";
return false;
}
@ -92,12 +92,11 @@ bool AnyImageConverter::doExportToFile(const CompressedImageView2D&, const std::
/* No file formats to store compressed data yet */
Error() << "Trade::AnyImageConverter::exportToFile(): cannot determine type of file" << filename << "to store compressed data";
Error{} << "Trade::AnyImageConverter::exportToFile(): cannot determine the format of" << filename << "to store compressed data";
return false;
}
}}
CORRADE_PLUGIN_REGISTER(AnyImageConverter, Magnum::Trade::AnyImageConverter,
"cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1")

6
src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp

@ -133,10 +133,10 @@ void AnyImageConverterTest::detect() {
/* Can't use raw string literals in macros on GCC 4.8 */
#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nTrade::AnyImageConverter::exportToFile(): cannot load {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nTrade::AnyImageConverter::exportToFile(): cannot load the {0} plugin\n", data.plugin));
#else
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnyImageConverter::exportToFile(): cannot load {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnyImageConverter::exportToFile(): cannot load the {0} plugin\n", data.plugin));
#endif
}
@ -147,7 +147,7 @@ void AnyImageConverterTest::unknown() {
Containers::Pointer<AbstractImageConverter> converter = _manager.instantiate("AnyImageConverter");
CORRADE_VERIFY(!converter->exportToFile(Image, "image.xcf"));
CORRADE_COMPARE(output.str(), "Trade::AnyImageConverter::exportToFile(): cannot determine type of file image.xcf\n");
CORRADE_COMPARE(output.str(), "Trade::AnyImageConverter::exportToFile(): cannot determine the format of image.xcf\n");
}
}}}}

10
src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp

@ -57,7 +57,7 @@ void AnyImageImporter::doOpenFile(const std::string& filename) {
/** @todo lowercase only the extension, once Directory::split() is done */
const std::string normalized = Utility::String::lowercase(filename);
/* Detect type from extension */
/* Detect the plugin from extension */
std::string plugin;
if(Utility::String::endsWith(normalized, ".basis"))
plugin = "BasisImporter";
@ -109,13 +109,13 @@ void AnyImageImporter::doOpenFile(const std::string& filename) {
Utility::String::endsWith(normalized, ".vst"))
plugin = "TgaImporter";
else {
Error() << "Trade::AnyImageImporter::openFile(): cannot determine type of file" << filename;
Error{} << "Trade::AnyImageImporter::openFile(): cannot determine the format of" << filename;
return;
}
/* Try to load the plugin */
if(!(manager()->load(plugin) & PluginManager::LoadState::Loaded)) {
Error() << "Trade::AnyImageImporter::openFile(): cannot load" << plugin << "plugin";
Error{} << "Trade::AnyImageImporter::openFile(): cannot load the" << plugin << "plugin";
return;
}
@ -180,13 +180,13 @@ void AnyImageImporter::doOpenData(Containers::ArrayView<const char> data) {
if(data.size() > 1) signature |= data[1] << 16;
if(data.size() > 2) signature |= data[2] << 8;
if(data.size() > 3) signature |= data[3];
Error() << "Trade::AnyImageImporter::openData(): cannot determine type from signature" << reinterpret_cast<void*>(signature);
Error{} << "Trade::AnyImageImporter::openData(): cannot determine the format from signature" << reinterpret_cast<void*>(signature);
return;
}
/* Try to load the plugin */
if(!(manager()->load(plugin) & PluginManager::LoadState::Loaded)) {
Error() << "Trade::AnyImageImporter::openData(): cannot load" << plugin << "plugin";
Error{} << "Trade::AnyImageImporter::openData(): cannot load the" << plugin << "plugin";
return;
}

8
src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp

@ -152,10 +152,10 @@ void AnyImageImporterTest::detect() {
/* Can't use raw string literals in macros on GCC 4.8 */
#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nTrade::AnyImageImporter::{1}(): cannot load {0} plugin\n", data.plugin, data.callback ? "openData" : "openFile"));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nTrade::AnyImageImporter::{1}(): cannot load the {0} plugin\n", data.plugin, data.callback ? "openData" : "openFile"));
#else
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnyImageImporter::{1}(): cannot load {0} plugin\n", data.plugin, data.callback ? "openData" : "openFile"));
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnyImageImporter::{1}(): cannot load the {0} plugin\n", data.plugin, data.callback ? "openData" : "openFile"));
#endif
}
@ -166,7 +166,7 @@ void AnyImageImporterTest::unknownExtension() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("AnyImageImporter");
CORRADE_VERIFY(!importer->openFile("image.xcf"));
CORRADE_COMPARE(output.str(), "Trade::AnyImageImporter::openFile(): cannot determine type of file image.xcf\n");
CORRADE_COMPARE(output.str(), "Trade::AnyImageImporter::openFile(): cannot determine the format of image.xcf\n");
}
void AnyImageImporterTest::unknownSignature() {
@ -178,7 +178,7 @@ void AnyImageImporterTest::unknownSignature() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("AnyImageImporter");
CORRADE_VERIFY(!importer->openData(data));
CORRADE_COMPARE(output.str(), "Trade::AnyImageImporter::openData(): cannot determine type from signature 0x253a0000\n");
CORRADE_COMPARE(output.str(), "Trade::AnyImageImporter::openData(): cannot determine the format from signature 0x253a0000\n");
}
void AnyImageImporterTest::emptyData() {

6
src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp

@ -71,7 +71,7 @@ void AnySceneImporter::doOpenFile(const std::string& filename) {
/** @todo lowercase only the extension, once Directory::split() is done */
const std::string normalized = Utility::String::lowercase(filename);
/* Detect type from extension */
/* Detect the plugin from extension */
std::string plugin;
if(Utility::String::endsWith(normalized, ".3ds") ||
Utility::String::endsWith(normalized, ".ase"))
@ -129,13 +129,13 @@ void AnySceneImporter::doOpenFile(const std::string& filename) {
Utility::String::endsWith(normalized, ".zgl"))
plugin = "XglImporter";
else {
Error() << "Trade::AnySceneImporter::openFile(): cannot determine type of file" << filename;
Error{} << "Trade::AnySceneImporter::openFile(): cannot determine the format of" << filename;
return;
}
/* Try to load the plugin */
if(!(manager()->load(plugin) & PluginManager::LoadState::Loaded)) {
Error() << "Trade::AnySceneImporter::openFile(): cannot load" << plugin << "plugin";
Error{} << "Trade::AnySceneImporter::openFile(): cannot load the" << plugin << "plugin";
return;
}

6
src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

@ -160,10 +160,10 @@ void AnySceneImporterTest::detect() {
/* Can't use raw string literals in macros on GCC 4.8 */
#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nTrade::AnySceneImporter::openFile(): cannot load {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\nTrade::AnySceneImporter::openFile(): cannot load the {0} plugin\n", data.plugin));
#else
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnySceneImporter::openFile(): cannot load {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnySceneImporter::openFile(): cannot load the {0} plugin\n", data.plugin));
#endif
}
@ -174,7 +174,7 @@ void AnySceneImporterTest::unknown() {
Containers::Pointer<AbstractImporter> importer = _manager.instantiate("AnySceneImporter");
CORRADE_VERIFY(!importer->openFile("mesh.wtf"));
CORRADE_COMPARE(output.str(), "Trade::AnySceneImporter::openFile(): cannot determine type of file mesh.wtf\n");
CORRADE_COMPARE(output.str(), "Trade::AnySceneImporter::openFile(): cannot determine the format of mesh.wtf\n");
}
}}}}

Loading…
Cancel
Save