Skip to content

Commit 0ff9053

Browse files
committed
fix integration install location unit test
- testing with custom vendor location empty and maya location not empty was failing because if custom vendor location is empty it would return the files in the default install location, which vary by machine. - instead only look for default vendor location if environment variable does not exist
1 parent 4a81b68 commit 0ff9053

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Assets/com.unity.formats.fbx.tests/FbxExportSettingsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ private void TestLocations(Dictionary<string,List<string>> data)
482482
ExportSettings.instance.ClearDCCOptions();
483483

484484
GUIContent[] options = ExportSettings.GetDCCOptions();
485-
Assert.AreEqual(options.Length, expectedResult);
485+
Assert.AreEqual(expectedResult, options.Length);
486486

487487
if (data.ContainsKey("expected3DApp"))
488488
{

Packages/com.unity.formats.fbx/Editor/Scripts/FbxExportSettings.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,13 @@ private static string GetMayaLocationFromEnvironmentVariable(string env)
283283
/// </summary>
284284
private static HashSet<string> GetCustomVendorLocations()
285285
{
286-
HashSet<string> result = new HashSet<string>();
286+
HashSet<string> result = null;
287287

288288
var environmentVariable = Environment.GetEnvironmentVariable("UNITY_3DAPP_VENDOR_LOCATIONS");
289289

290290
if (!string.IsNullOrEmpty(environmentVariable))
291291
{
292+
result = new HashSet<string>();
292293
string[] locations = environmentVariable.Split(';');
293294
foreach (var location in locations)
294295
{
@@ -298,8 +299,6 @@ private static HashSet<string> GetCustomVendorLocations()
298299
}
299300
}
300301
}
301-
302-
303302
return result;
304303
}
305304

@@ -347,7 +346,7 @@ public static string[] DCCVendorLocations
347346
{
348347
HashSet<string> result = GetCustomVendorLocations();
349348

350-
if (result == null || result.Count < 1)
349+
if (result == null)
351350
{
352351
result = GetDefaultVendorLocations();
353352
}

0 commit comments

Comments
 (0)