Browse Source

Any*{Importer,Converter}: no, raw string literals make no sense here.

Test code probably from the time when I didn't know about C string
literal concatenation yet?
pull/592/head
Vladimír Vondruš 4 years ago
parent
commit
424d666bab
  1. 9
      src/MagnumPlugins/AnyAudioImporter/Test/AnyAudioImporterTest.cpp
  2. 9
      src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp
  3. 9
      src/MagnumPlugins/AnySceneConverter/Test/AnySceneConverterTest.cpp
  4. 9
      src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

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

@ -121,13 +121,16 @@ void AnyImporterTest::detect() {
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->openFile(data.filename));
/* 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 the {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\n"
"Audio::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 the {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} was not found\n"
"Audio::AnyImporter::openFile(): cannot load the {0} plugin\n",
data.plugin));
#endif
}

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

@ -297,13 +297,16 @@ void AnyImageImporterTest::detect() {
CORRADE_VERIFY(read);
CORRADE_VERIFY(!importer->openData(*read));
} else CORRADE_VERIFY(!importer->openFile(filename));
/* 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 the {0} plugin\n", data.plugin, data.asData ? "openData" : "openFile"));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\n"
"Trade::AnyImageImporter::{1}(): cannot load the {0} plugin\n",
data.plugin, data.asData ? "openData" : "openFile"));
#else
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnyImageImporter::{1}(): cannot load the {0} plugin\n", data.plugin, data.asData ? "openData" : "openFile"));
"PluginManager::Manager::load(): plugin {0} was not found\n"
"Trade::AnyImageImporter::{1}(): cannot load the {0} plugin\n",
data.plugin, data.asData ? "openData" : "openFile"));
#endif
}

9
src/MagnumPlugins/AnySceneConverter/Test/AnySceneConverterTest.cpp

@ -130,13 +130,16 @@ void AnySceneConverterTest::detect() {
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!converter->convertToFile(MeshData{MeshPrimitive::Triangles, 0}, data.filename));
/* 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::AnySceneConverter::convertToFile(): cannot load the {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\n"
"Trade::AnySceneConverter::convertToFile(): cannot load the {0} plugin\n",
data.plugin));
#else
CORRADE_COMPARE(out.str(), Utility::formatString(
"PluginManager::Manager::load(): plugin {0} was not found\nTrade::AnySceneConverter::convertToFile(): cannot load the {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} was not found\n"
"Trade::AnySceneConverter::convertToFile(): cannot load the {0} plugin\n",
data.plugin));
#endif
}

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

@ -182,13 +182,16 @@ void AnySceneImporterTest::detect() {
std::ostringstream out;
Error redirectError{&out};
CORRADE_VERIFY(!importer->openFile(data.filename));
/* 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 the {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} is not static and was not found in nonexistent\n"
"Trade::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 the {0} plugin\n", data.plugin));
"PluginManager::Manager::load(): plugin {0} was not found\n"
"Trade::AnySceneImporter::openFile(): cannot load the {0} plugin\n",
data.plugin));
#endif
}

Loading…
Cancel
Save