#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
if (!primaryFound && !renderFound) {
- TCU_THROW(NotSupportedError, "Nether DRM primary nor render device files were found");
+ TCU_THROW(NotSupportedError, "Neither DRM primary nor render device files were found");
}
}
{
DynamicLibrary::DynamicLibrary (const char* fileName)
- : m_library(DE_NULL)
+ : m_library(nullptr)
{
m_library = deDynamicLibrary_open(fileName);
if (!m_library)
}
DynamicLibrary::DynamicLibrary (const char* fileNames[])
- : m_library(DE_NULL)
+ : m_library(nullptr)
{
- for (int i = 0; !m_library && fileNames[i]; i++)
+ for (size_t i = 0u; fileNames[i] != nullptr; ++i)
{
m_library = deDynamicLibrary_open(fileNames[i]);
- if (!m_library)
- throw std::runtime_error(std::string("Failed to open dynamic library: '") + fileNames[0] + "'");
+ if (m_library)
+ break;
+ }
+
+ if (!m_library)
+ {
+ std::string nameList;
+ for (size_t i = 0u; fileNames[i] != nullptr; ++i)
+ nameList += (nameList.empty() ? "" : ", ") + std::string(fileNames[i]);
+ const std::string msg = "Failed to open dynamic library: tried " + nameList;
+ throw std::runtime_error(msg);
}
}