Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Test value of dinputOnly for migrated profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryochan7 committed Dec 21, 2023
1 parent 35b3c03 commit 4200580
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DS4Windows/DS4Control/ScpUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3207,6 +3207,7 @@ public class BackingStore
public const int DEFAULT_DS4_BT_POLL_RATE = 4;
public const int DEFAULT_RUMBLE = 100;
public const double DEFAULT_ANALOG_SENS = 1.0;
public const bool DEFAULT_DINPUT_ONLY = false;

// Stick output curve consts in place more as a precaution
public const string DEFAULT_STICK_OUTPUT_CURVE = "linear";
Expand Down Expand Up @@ -3516,7 +3517,10 @@ public void setSZOutCurveMode(int index, int value)
};

public string[] launchProgram = new string[Global.TEST_PROFILE_ITEM_COUNT] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
public bool[] dinputOnly = new bool[Global.TEST_PROFILE_ITEM_COUNT] { false, false, false, false, false, false, false, false, false };
public bool[] dinputOnly = new bool[Global.TEST_PROFILE_ITEM_COUNT]
{ DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY,
DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY,
DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY, DEFAULT_DINPUT_ONLY };
public bool[] startTouchpadOff = new bool[Global.TEST_PROFILE_ITEM_COUNT] { false, false, false, false, false, false, false, false, false };
public TouchpadOutMode[] touchOutMode = new TouchpadOutMode[Global.TEST_PROFILE_ITEM_COUNT] { TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse,
TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse, TouchpadOutMode.Mouse };
Expand Down Expand Up @@ -9295,7 +9299,7 @@ private void ResetProfile(int device)
lightInfo.ledAsBattery = false;

launchProgram[device] = string.Empty;
dinputOnly[device] = false;
dinputOnly[device] = DEFAULT_DINPUT_ONLY;
startTouchpadOff[device] = false;
touchOutMode[device] = TouchpadOutMode.Mouse;
sATriggers[device] = BackingStore.DEFAULT_SA_TRIGGERS;
Expand Down
4 changes: 4 additions & 0 deletions DS4WindowsTests/ProfileMigrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ public void CheckJaysProfileRead()
Assert.AreEqual("0,0,255",
$"{profileColor.red},{profileColor.green},{profileColor.blue}");

// Test if output device type has been set properly. Uses default value from ProfileDTO
Assert.AreEqual(OutContType.X360, tempStore.outputDevType[0]);
Assert.AreEqual(BackingStore.DEFAULT_DINPUT_ONLY, tempStore.dinputOnly[0]);

// Check that profile migration worked as expected
string testMigratedProfileStr = ObtainConvertedJaysXML(tempStore);
Assert.AreEqual(ds4winJays2KingsExpectedMigratedProfile, testMigratedProfileStr);
Expand Down

0 comments on commit 4200580

Please sign in to comment.