Skip to content

Avoid remembering and restoring enum constants #1416

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

Merged
merged 3 commits into from
Nov 25, 2022

Conversation

EgorkaKulikov
Copy link
Collaborator

Description

Usually we remember the state of a static variable before the main body of each generated test and restore this state at the end. But enum constants are such statics that do not require such actions.

Fixes # (1397)
Fixes # (306)

Type of Change

  • Minor bug fix (non-breaking small changes)

How Has This Been Tested?

Manual Scenario

  • Scenarios described in both mentioned issues
  • Standard enums regression

@EgorkaKulikov EgorkaKulikov force-pushed the egor/enums_against_statics_and_reflection branch from b90c6c1 to 38bf5fd Compare November 25, 2022 09:03
@@ -74,6 +75,7 @@ class ComplexEnumExamplesTest : UtValueTestCaseChecker(
}

@Test
@Disabled("TODO: nested anonymous classes are not supported: https://github.com/UnitTestBot/UTBotJava/issues/617")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that the reason for disabling here differs from issue mentioned in 617, so maybe create an another issue?

@EgorkaKulikov EgorkaKulikov merged commit 4b9ca2d into main Nov 25, 2022
@EgorkaKulikov EgorkaKulikov deleted the egor/enums_against_statics_and_reflection branch November 25, 2022 10:19
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.

Enum instantiating with unnecessary reflection Static Enum values are needlessly overwritten
2 participants