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

Disable null values #120

Merged

Conversation

khbminus
Copy link
Contributor

This pull request added a new flag: kex.generateNullValues with the default value of true.

If the flag is set to false, it will replace all null values immediately after it's obtained from SMT solver to the default value.

For the classes the method sets all the fields that are defined in their default values as well.

An implementation with tests that covers all basic variants of types and java
Now, if the object should be generated, all necessary fields will be set to the default value
set(name to fieldType, transformExistingDescriptor(desc, fieldType, cm, alreadyCopied))
}
}
}.also { alreadyCopied[descriptor] = it }
Copy link
Member

Choose a reason for hiding this comment

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

You need to add descriptor to alreadyCopied before calling transformExistingDescriptor recursively.
Because currently your implementaion will not protect you from loops inside object, e.g.:

x = foo.Node {
   (link, foo.Node) = x
}

Added a cache to comprehend possible cycles in the generation loops as well as instantiated all the array's elements
@khbminus khbminus force-pushed the khbminus/disable-null-values branch from 1467ee7 to 190a8a4 Compare August 20, 2024 14:59
@AbdullinAM AbdullinAM merged commit 00a3b16 into vorpal-research:master Aug 20, 2024
1 of 3 checks passed
AbdullinAM added a commit that referenced this pull request Aug 22, 2024
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.

2 participants