[LYN-7529] Create unit tests for ResolveSourceFileDependencyPath (#4790)
* Add unit tests for ResolveSourceFileDependencyPath Fix crash when file is not in scan folder Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Switch to using vector of AZ strings for better error output Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Switch to using UnorderedElementsAre Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add some comments and fix typo Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
@@ -3576,23 +3576,24 @@ namespace AssetProcessor
|
||||
// Absolute path, just check the 1 scan folder
|
||||
if (AZ::IO::PathView(encodedFileData.toUtf8().constData()).IsAbsolute())
|
||||
{
|
||||
QString scanFolderName;
|
||||
if (!m_platformConfig->ConvertToRelativePath(encodedFileData, resultDatabaseSourceName, scanFolderName))
|
||||
auto scanFolderInfo = m_platformConfig->GetScanFolderForFile(encodedFileData);
|
||||
|
||||
if (!m_platformConfig->ConvertToRelativePath(encodedFileData, scanFolderInfo, resultDatabaseSourceName))
|
||||
{
|
||||
AZ_Warning(
|
||||
AssetProcessor::ConsoleChannel, false,
|
||||
"'%s' does not appear to be in any input folder. Use relative paths instead.",
|
||||
sourceDependency.m_sourceFileDependencyPath.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make an absolute path that is ScanFolderPath + Part of search path before the wildcard
|
||||
QDir rooted(scanFolderInfo->ScanPath());
|
||||
QString scanFolderAndKnownSubPath = rooted.absoluteFilePath(knownPathBeforeWildcard);
|
||||
|
||||
auto scanFolderInfo = m_platformConfig->GetScanFolderByPath(scanFolderName);
|
||||
|
||||
// Make an absolute path that is ScanFolderPath + Part of search path before the wildcard
|
||||
QDir rooted(scanFolderName);
|
||||
QString scanFolderAndKnownSubPath = rooted.absoluteFilePath(knownPathBeforeWildcard);
|
||||
|
||||
resolvedDependencyList.append(m_platformConfig->FindWildcardMatches(
|
||||
scanFolderAndKnownSubPath, relativeSearch, false, scanFolderInfo->RecurseSubFolders()));
|
||||
resolvedDependencyList.append(m_platformConfig->FindWildcardMatches(
|
||||
scanFolderAndKnownSubPath, relativeSearch, false, scanFolderInfo->RecurseSubFolders()));
|
||||
}
|
||||
}
|
||||
else // Relative path, check every scan folder
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user