From 5d9d5290103c1e302f599b61c99b1aa871ef90e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 17 Apr 2020 19:56:25 +0200 Subject: [PATCH] Any*{Importer,Converter}: less engrish in error messages. --- src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp | 2 +- src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp | 6 +++--- .../AnyAudioImporter/Test/AnyAudioImporterTest.cpp | 6 +++--- .../AnyImageConverter/AnyImageConverter.cpp | 9 ++++----- .../AnyImageConverter/Test/AnyImageConverterTest.cpp | 6 +++--- .../AnyImageImporter/AnyImageImporter.cpp | 10 +++++----- .../AnyImageImporter/Test/AnyImageImporterTest.cpp | 8 ++++---- .../AnySceneImporter/AnySceneImporter.cpp | 6 +++--- .../AnySceneImporter/Test/AnySceneImporterTest.cpp | 6 +++--- 9 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp b/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp index d2e92801c..c4e0b72e9 100644 --- a/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp +++ b/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"); } }}}} diff --git a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp b/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp index d20db24a5..0b9dc3162 100644 --- a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp +++ b/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; } diff --git a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp b/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp index 2e32adbee..b6446cff7 100644 --- a/src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp +++ b/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 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"); } }}}} diff --git a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp index fba7866d5..ad11cb3d6 100644 --- a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp +++ b/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") diff --git a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp b/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp index d9a6cfabf..6fc6916d7 100644 --- a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp +++ b/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 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"); } }}}} diff --git a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp index 7cb387011..b5886d22e 100644 --- a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp +++ b/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 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(signature); + Error{} << "Trade::AnyImageImporter::openData(): cannot determine the format from signature" << reinterpret_cast(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; } diff --git a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp index ff73e427b..e1819865f 100644 --- a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp +++ b/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 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 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() { diff --git a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp b/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp index 94cff9e0e..f0a562a57 100644 --- a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp +++ b/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; } diff --git a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp b/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp index b451a8b8f..79ec4bca1 100644 --- a/src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp +++ b/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 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"); } }}}}