Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: InputTestFixture stepping updates in [UnityTest]s incorrectly (case 1341740). #1438

Merged
merged 5 commits into from Nov 29, 2021

Conversation

Rene-Damm
Copy link
Contributor

@Rene-Damm Rene-Damm commented Oct 25, 2021

Fixes 1341740 (FogBugz).

Description

Do this in a [UnityTest] would fail

Press(Gamepad.current.buttonSouth);
yield return null;
Assert.That(Gamepad.current.buttonSouth.wasPressedThisFrame, Is.True);

The reason is that calling Press with the default queueEventOnly=false argument would imply running an InputSystem.Update right away. Thus an extra frame would be inserted.

Changes made

queueEventOnly is now always considered true in a [UnityTest].

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@Rene-Damm Rene-Damm requested a review from jimon October 25, 2021 21:12
Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like change causes multiple test failures, incorrect fix or test cases needs update due to new corrected behavior?

@Rene-Damm Rene-Damm changed the title FIX: InputTestFixture stepping updates in [UnityTests] incorrectly (case 1341740). FIX: InputTestFixture stepping updates in [UnityTest]s incorrectly (case 1341740). Nov 29, 2021
@Rene-Damm Rene-Damm merged commit 8c0115c into develop Nov 29, 2021
@Rene-Damm Rene-Damm deleted the fix-inputtestfixture-input-updates-in-unitytests branch November 29, 2021 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants