Skip to content

Add support for nullable fields in deep equals #768

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 1 commit into from
Aug 25, 2022

Conversation

sofurihafe
Copy link
Member

Description

Before this PR, there was a test (PR) that was added in order to improve current deepequals implementation.

This PR improves current deepequals implementation.
When generating parametrized tests, we wrap field access in null check in order to make a generic execution more common for every execution. So, if there is a class with a nullable field, which has a field as well, as a result, in one execution we try to access the field's field, in another we assert it to be null. And we choose only one generic execution which is impossible in this case.

Fixes # (767)

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Automated Testing

Run utbot-samples with enabled parametrized test generation.

Manual Scenario

  1. Enable parametrized test generation,
  2. Run testClassWithNullableField test,
  3. Verify that the test passes & is generated correctly.

@sofurihafe sofurihafe linked an issue Aug 23, 2022 that may be closed by this pull request
@sofurihafe sofurihafe force-pushed the andrey-t/deep-equals-upgrade branch 3 times, most recently from 433567d to 8e8c0a4 Compare August 25, 2022 18:11
@sofurihafe sofurihafe force-pushed the andrey-t/deep-equals-upgrade branch from 8e8c0a4 to e263aaf Compare August 25, 2022 18:23
@EgorkaKulikov EgorkaKulikov enabled auto-merge (squash) August 25, 2022 18:27
@EgorkaKulikov EgorkaKulikov merged commit 928d6ad into main Aug 25, 2022
@EgorkaKulikov EgorkaKulikov deleted the andrey-t/deep-equals-upgrade branch August 25, 2022 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Failing ClassWithNullableField deepequals test
2 participants