Skip to content

Commit 6874ce6

Browse files
author
AJubrey
committed
[ADDED] cleardccoptions function
[RENAMED] setup function [ADDED] comments for easy reading of tests
1 parent 5dc1e6b commit 6874ce6

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,12 @@ public void ClearDCCOptionNames()
457457
dccOptionNames.Clear();
458458
}
459459

460+
public void ClearDCCOptions()
461+
{
462+
SetDCCOptionNames(null);
463+
SetDCCOptionPaths(null);
464+
}
465+
460466
/// <summary>
461467
///
462468
/// Find the latest program available and make that the default choice.

Assets/FbxExporters/Editor/UnitTests/FbxExportSettingsTest.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,24 @@ public void TestGetDCCOptions()
267267
[Test]
268268
public void FindDCCInstallsTest1()
269269
{
270+
271+
/*
272+
* different directory roots denoted by ' (eg.) (maya 2017 in rootDir1) = a (maya 2017 in rootDir2) = a'
273+
* a (maya2017)
274+
* b (maya2018)
275+
* c (mayaLT2017)
276+
* d (mayaLT2018)
277+
* e (3dsmax2017)
278+
* f (3dsmax2018)
279+
*/
280+
281+
// case 1.1: VI=a ML=b', result=2
282+
// case 1.2: VL=a ML=d' result=2
283+
// case 1.3: VL=c ML=b' result=2
284+
// case 1.4: VL=c ML=d' result=2
285+
// case 1.5: VL=e ML=b' result=2
286+
// case 1.6: VL=e ML=d' result=2
287+
270288
string rootDir1 = GetRandomFileNamePath(extName: "");
271289
string rootDir2 = GetRandomFileNamePath(extName: "");
272290

@@ -327,7 +345,7 @@ public void FindDCCInstallsTest1()
327345

328346
//SetUp
329347
//make the hierarchy for the single app path we need
330-
CreateDummyInstalls(vendorInstallFolders);
348+
VendorLocations_Setup(vendorInstallFolders);
331349

332350
TestLocations(envVendorLocations, envMayaLocation, expectedResult);
333351

@@ -354,8 +372,7 @@ public void TestLocations(string vendorLocation, string mayaLocation, int expect
354372
SetEnvironmentVariables(vendorLocation, mayaLocation);
355373

356374
//Nullify these lists so that we guarantee that FindDccInstalls will be called.
357-
ExportSettings.instance.SetDCCOptionNames(null);
358-
ExportSettings.instance.SetDCCOptionPaths(null);
375+
ExportSettings.instance.ClearDCCOptions();
359376

360377
GUIContent[] options = ExportSettings.GetDCCOptions();
361378

@@ -382,7 +399,7 @@ public void TestLocations(string vendorLocation, string mayaLocation, int expect
382399
/// <param name="mayaLocationPath"></param>
383400
public void SetEnvironmentVariables(string vendorLocation, string mayaLocationPath)
384401
{
385-
if (vendorLocation != null)
402+
if (!string.IsNullOrEmpty(vendorLocation))
386403
{
387404
//if the given vendor location isn't null, set the environment variable to it.
388405
System.Environment.SetEnvironmentVariable("UNITY_FBX_3DAPP_VENDOR_LOCATIONS", vendorLocation);
@@ -394,7 +411,7 @@ public void SetEnvironmentVariables(string vendorLocation, string mayaLocationPa
394411
}
395412
}
396413

397-
public void CreateDummyInstalls(List<string> paths)
414+
public void VendorLocations_Setup(List<string> paths)
398415
{
399416
foreach (var pathToExe in paths)
400417
{

0 commit comments

Comments
 (0)