Skip to content

Fix --string-non-empty option #2909

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

Conversation

romainbrenguier
Copy link
Contributor

This was broken and the option had no effect

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Let's please stop doing any command-line option parsing in the language front-end. Undocumented command-line options are a no-go.

@@ -85,6 +85,8 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
object_factory_parameters.max_nondet_string_length =
safe_string2size_t(cmd.get_value("max-nondet-string-length"));
}
if(cmd.isset("string-non-empty"))
object_factory_parameters.min_nondet_string_length = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please not have more command-line parsing in the language front-end? See
#2907 and #2908. Let alone doing so via an undocumented option?

Copy link
Collaborator

Choose a reason for hiding this comment

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

While I remain unhappy it seems that #2908 is not currently progressing so I won't further block on this.

@@ -28,6 +28,9 @@ struct object_factory_parameterst final
/// Maximum value for the non-deterministically-chosen length of a string.
size_t max_nondet_string_length=MAX_NONDET_STRING_LENGTH;

/// Maximum value for the non-deterministically-chosen length of a string.
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 ⛏️ Typo: Minimum

@romainbrenguier romainbrenguier force-pushed the bugfix/string-non-empty branch from 0e36b4d to 2d7e636 Compare October 2, 2018 08:31
@romainbrenguier
Copy link
Contributor Author

@thk123 @tautschnig this is ready for review

Copy link
Contributor

@thk123 thk123 left a comment

Choose a reason for hiding this comment

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

Test is missing one assertion status - please add. Also, any reason to have a binary flag rather than just a min-string-length option?

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Ok from my point of view, except the *.desc files as noted below. The where-to-parse-command-line-options is postponed.

assertion.* line 13 function java::Test.checkMinLength.*: FAILURE
assertion.* line 17 function java::Test.checkMinLength.*: FAILURE
assertion.* line 19 function java::Test.checkMinLength.*: FAILURE

Copy link
Collaborator

Choose a reason for hiding this comment

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

No blank lines here please, it confuses test runs on Windows. The same applies to the other *.desc files in this commit.

@@ -85,6 +85,8 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
object_factory_parameters.max_nondet_string_length =
safe_string2size_t(cmd.get_value("max-nondet-string-length"));
}
if(cmd.isset("string-non-empty"))
object_factory_parameters.min_nondet_string_length = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

While I remain unhappy it seems that #2908 is not currently progressing so I won't further block on this.

@romainbrenguier romainbrenguier force-pushed the bugfix/string-non-empty branch from 2d7e636 to 72350c2 Compare October 2, 2018 09:20
@romainbrenguier romainbrenguier force-pushed the bugfix/string-non-empty branch from 72350c2 to cf123f0 Compare October 2, 2018 09:21
@romainbrenguier
Copy link
Contributor Author

@thk123

Also, any reason to have a binary flag rather than just a min-string-length option?

No particular reason, I'm just fixing the previously existing feature that was broken, but it could be replaced by a min-string-length option in the future.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

This PR failed Diffblue compatibility checks (cbmc commit: 0e36b4d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86575976
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

This PR failed Diffblue compatibility checks (cbmc commit: 2d7e636).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86578648
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

This PR failed Diffblue compatibility checks (cbmc commit: 72350c2).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86579860
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

Passed Diffblue compatibility checks (cbmc commit: cf123f0).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/86580449

@romainbrenguier romainbrenguier merged commit 2c47e04 into diffblue:develop Oct 2, 2018
@romainbrenguier romainbrenguier deleted the bugfix/string-non-empty branch October 2, 2018 12:47
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.

5 participants